xref: /freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/JITLink/i386.cpp (revision 525fe93dc7487a1e63a90f6a2b956abc601963c1)
1 //===---- i386.cpp - Generic JITLink i386 edge kinds, utilities -----===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Generic utilities for graphs representing i386 objects.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "llvm/ExecutionEngine/JITLink/i386.h"
14 
15 #define DEBUG_TYPE "jitlink"
16 
17 namespace llvm::jitlink::i386 {
18 
19 const char *getEdgeKindName(Edge::Kind K) {
20   switch (K) {
21   case None:
22     return "None";
23   case Pointer32:
24     return "Pointer32";
25   case PCRel32:
26     return "PCRel32";
27   case Pointer16:
28     return "Pointer16";
29   case PCRel16:
30     return "PCRel16";
31   case Delta32:
32     return "Delta32";
33   case Delta32FromGOT:
34     return "Delta32FromGOT";
35   case RequestGOTAndTransformToDelta32FromGOT:
36     return "RequestGOTAndTransformToDelta32FromGOT";
37   }
38 
39   return getGenericEdgeKindName(K);
40 }
41 
42 const char NullPointerContent[PointerSize] = {0x00, 0x00, 0x00, 0x00};
43 } // namespace llvm::jitlink::i386
44