LLVM: lib/Target/Target.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
22#include
23
24using namespace llvm;
25
29
34
40
44
48
52
56
61
63 std::string StringRep = unwrap(TD)->getStringRepresentation();
64 return strdup(StringRep.c_str());
65}
66
70
72 return unwrap(TD)->getPointerSize(0);
73}
74
76 return unwrap(TD)->getPointerSize(AS);
77}
78
82
87
91
95
99
103
107
109 return unwrap(TD)->getABITypeAlign(unwrap(Ty)).value();
110}
111
113 return unwrap(TD)->getABITypeAlign(unwrap(Ty)).value();
114}
115
117 return unwrap(TD)->getPrefTypeAlign(unwrap(Ty)).value();
118}
119
126
128 unsigned long long Offset) {
130 return unwrap(TD)->getStructLayout(STy)->getElementContainingOffset(Offset);
131}
132
134 unsigned Element) {
136 return unwrap(TD)->getStructLayout(STy)->getElementOffset(Element);
137}
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Module.h This file contains the declarations for the Module class.
static TableGen::Emitter::OptClass< SkeletonEmitter > X("gen-skeleton-class", "Generate example skeleton class")
LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD)
Definition Target.cpp:79
LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS)
Definition Target.cpp:83
A parsed version of the target data layout string in and methods for querying it.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
A global registry used in conjunction with static constructors to make pluggable components (like tar...
Class to represent struct types.
Implementation of the target library information.
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
struct LLVMOpaquePassManager * LLVMPassManagerRef
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
struct LLVMOpaqueType * LLVMTypeRef
Each value in the LLVM IR has a type, an LLVMTypeRef.
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M)
Obtain the data layout for a module.
Definition Target.cpp:41
LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep)
Creates target data from a target layout string.
Definition Target.cpp:49
unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the preferred alignment of a type in bytes for a target.
Definition Target.cpp:116
unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the call frame alignment of a type in bytes for a target.
Definition Target.cpp:112
unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD, LLVMTypeRef StructTy, unsigned Element)
Computes the byte offset of the indexed struct element for a target.
Definition Target.cpp:133
void LLVMDisposeTargetData(LLVMTargetDataRef TD)
Deallocates a TargetData.
Definition Target.cpp:53
void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI, LLVMPassManagerRef PM)
Adds target library information to a pass manager.
Definition Target.cpp:57
LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD)
Returns the byte order of a target, either LLVMBigEndian or LLVMLittleEndian.
Definition Target.cpp:67
unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD, LLVMValueRef GlobalVar)
Computes the preferred alignment of a global variable in bytes for a target.
Definition Target.cpp:120
unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the storage size of a type in bytes for a target.
Definition Target.cpp:100
unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the ABI size of a type in bytes for a target.
Definition Target.cpp:104
unsigned LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned AS)
Returns the pointer size in bytes for a target for a specified address space.
Definition Target.cpp:75
unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the ABI alignment of a type in bytes for a target.
Definition Target.cpp:108
unsigned LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy, unsigned long long Offset)
Computes the structure element that contains the byte offset for a target.
Definition Target.cpp:127
LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD)
Returns the integer type that is the same size as a pointer on a target.
Definition Target.cpp:88
char * LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD)
Converts target data to a target layout string.
Definition Target.cpp:62
unsigned LLVMPointerSize(LLVMTargetDataRef TD)
Returns the pointer size in bytes for a target.
Definition Target.cpp:71
LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C, LLVMTargetDataRef TD, unsigned AS)
Returns the integer type that is the same size as a pointer on a target.
Definition Target.cpp:92
struct LLVMOpaqueTargetLibraryInfotData * LLVMTargetLibraryInfoRef
void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL)
Set the data layout for a module.
Definition Target.cpp:45
unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the size of a type in bits for a target.
Definition Target.cpp:96
struct LLVMOpaqueTargetData * LLVMTargetDataRef
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI LLVMContextRef getGlobalContextForCAPI()
Get the deprecated global context for use by the C API.
LLVM_ABI void initializeRuntimeLibraryInfoWrapperPass(PassRegistry &)
Attribute unwrap(LLVMAttributeRef Attr)
LLVM_ABI void initializeTarget(PassRegistry &)
Initialize all passes linked into the CodeGen library.
Definition Target.cpp:35
LLVM_ABI void initializeTargetTransformInfoWrapperPassPass(PassRegistry &)
LLVM_ABI void initializeTargetLibraryInfoWrapperPassPass(PassRegistry &)
LLVMAttributeRef wrap(Attribute Attr)