clang
3.9.0
|
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues, like target-specific attributes, builtins and so on. More...
#include <TargetInfo.h>
Public Member Functions | |
TargetCodeGenInfo (ABIInfo *info=nullptr) | |
virtual | ~TargetCodeGenInfo () |
const ABIInfo & | getABIInfo () const |
getABIInfo() - Returns ABI info helper for the target. More... | |
virtual void | setTargetAttributes (const Decl *D, llvm::GlobalValue *GV, CodeGen::CodeGenModule &M) const |
setTargetAttributes - Provides a convenient hook to handle extra target-specific attributes for the given global. More... | |
virtual void | emitTargetMD (const Decl *D, llvm::GlobalValue *GV, CodeGen::CodeGenModule &M) const |
emitTargetMD - Provides a convenient hook to handle extra target-specific metadata for the given global. More... | |
virtual unsigned | getSizeOfUnwindException () const |
Determines the size of struct _Unwind_Exception on this platform, in 8-bit units. More... | |
virtual bool | extendPointerWithSExt () const |
Controls whether __builtin_extend_pointer should sign-extend pointers to uint64_t or zero-extend them (the default). More... | |
virtual int | getDwarfEHStackPointer (CodeGen::CodeGenModule &M) const |
Determines the DWARF register number for the stack pointer, for exception-handling purposes. More... | |
virtual bool | initDwarfEHRegSizeTable (CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const |
Initializes the given DWARF EH register-size table, a char*. More... | |
virtual llvm::Value * | decodeReturnAddress (CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const |
Performs the code-generation required to convert a return address as stored by the system into the actual address of the next instruction that will be executed. More... | |
virtual llvm::Value * | encodeReturnAddress (CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const |
Performs the code-generation required to convert the address of an instruction into a return address suitable for storage by the system in a return slot. More... | |
virtual llvm::Type * | adjustInlineAsmType (CodeGen::CodeGenFunction &CGF, StringRef Constraint, llvm::Type *Ty) const |
Corrects the low-level LLVM type for a given constraint and "usual" type. More... | |
virtual void | addReturnRegisterOutputs (CodeGen::CodeGenFunction &CGF, CodeGen::LValue ReturnValue, std::string &Constraints, std::vector< llvm::Type * > &ResultRegTypes, std::vector< llvm::Type * > &ResultTruncRegTypes, std::vector< CodeGen::LValue > &ResultRegDests, std::string &AsmString, unsigned NumOutputs) const |
Adds constraints and types for result registers. More... | |
virtual bool | doesReturnSlotInterfereWithArgs () const |
doesReturnSlotInterfereWithArgs - Return true if the target uses an argument slot for an 'sret' type. More... | |
virtual StringRef | getARCRetainAutoreleasedReturnValueMarker () const |
Retrieve the address of a function to call immediately before calling objc_retainAutoreleasedReturnValue. More... | |
virtual llvm::Constant * | getUBSanFunctionSignature (CodeGen::CodeGenModule &CGM) const |
Return a constant used by UBSan as a signature to identify functions possessing type information, or 0 if the platform is unsupported. More... | |
virtual bool | isNoProtoCallVariadic (const CodeGen::CallArgList &args, const FunctionNoProtoType *fnType) const |
Determine whether a call to an unprototyped functions under the given calling convention should use the variadic convention or the non-variadic convention. More... | |
virtual void | getDependentLibraryOption (llvm::StringRef Lib, llvm::SmallString< 24 > &Opt) const |
Gets the linker options necessary to link a dependent library on this platform. More... | |
virtual void | getDetectMismatchOption (llvm::StringRef Name, llvm::StringRef Value, llvm::SmallString< 32 > &Opt) const |
Gets the linker options necessary to detect object file mismatches on this platform. More... | |
virtual unsigned | getOpenCLKernelCallingConv () const |
Get LLVM calling convention for OpenCL kernel. More... | |
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues, like target-specific attributes, builtins and so on.
Definition at line 44 of file lib/CodeGen/TargetInfo.h.
|
inline |
Definition at line 49 of file lib/CodeGen/TargetInfo.h.
|
virtual |
Definition at line 342 of file CodeGen/TargetInfo.cpp.
|
inlinevirtual |
Adds constraints and types for result registers.
Definition at line 133 of file lib/CodeGen/TargetInfo.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitAsmStmt().
|
inlinevirtual |
Corrects the low-level LLVM type for a given constraint and "usual" type.
Definition at line 126 of file lib/CodeGen/TargetInfo.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitAsmStmt().
|
inlinevirtual |
Performs the code-generation required to convert a return address as stored by the system into the actual address of the next instruction that will be executed.
Used by __builtin_extract_return_addr().
Definition at line 106 of file lib/CodeGen/TargetInfo.h.
|
inlinevirtual |
doesReturnSlotInterfereWithArgs - Return true if the target uses an argument slot for an 'sret' type.
Definition at line 142 of file lib/CodeGen/TargetInfo.h.
Referenced by clang::CodeGen::CodeGenModule::ReturnSlotInterferesWithArgs().
|
inlinevirtual |
emitTargetMD - Provides a convenient hook to handle extra target-specific metadata for the given global.
Definition at line 62 of file lib/CodeGen/TargetInfo.h.
|
inlinevirtual |
Performs the code-generation required to convert the address of an instruction into a return address suitable for storage by the system in a return slot.
Used by __builtin_frob_return_addr().
Definition at line 116 of file lib/CodeGen/TargetInfo.h.
|
inlinevirtual |
Controls whether __builtin_extend_pointer should sign-extend pointers to uint64_t or zero-extend them (the default).
Has no effect for targets:
Definition at line 82 of file lib/CodeGen/TargetInfo.h.
|
inline |
getABIInfo() - Returns ABI info helper for the target.
Definition at line 53 of file lib/CodeGen/TargetInfo.h.
Referenced by clang::CodeGen::CodeGenModule::CodeGenModule(), and getSwiftABIInfo().
|
inlinevirtual |
Retrieve the address of a function to call immediately before calling objc_retainAutoreleasedReturnValue.
The implementation of objc_autoreleaseReturnValue sniffs the instruction stream following its return address to decide whether it's a call to objc_retainAutoreleasedReturnValue. This can be prohibitively expensive, depending on the relocation model, and so on some targets it instead sniffs for a particular instruction sequence. This functions returns that instruction sequence in inline assembly, which will be empty if none is required.
Definition at line 154 of file lib/CodeGen/TargetInfo.h.
Referenced by emitAutoreleasedReturnValueMarker().
|
virtual |
Gets the linker options necessary to link a dependent library on this platform.
Definition at line 366 of file CodeGen/TargetInfo.cpp.
Referenced by clang::CodeGen::CodeGenModule::AddDependentLib(), and addLinkOptionsPostorder().
|
inlinevirtual |
Gets the linker options necessary to detect object file mismatches on this platform.
Definition at line 217 of file lib/CodeGen/TargetInfo.h.
Referenced by clang::CodeGen::CodeGenModule::AddDetectMismatch().
|
inlinevirtual |
Determines the DWARF register number for the stack pointer, for exception-handling purposes.
Implements __builtin_dwarf_sp_column.
Returns -1 if the operation is unsupported by this target.
Definition at line 88 of file lib/CodeGen/TargetInfo.h.
|
virtual |
Get LLVM calling convention for OpenCL kernel.
Definition at line 375 of file CodeGen/TargetInfo.cpp.
References AttributeLangSupport::C.
|
virtual |
Determines the size of struct _Unwind_Exception on this platform, in 8-bit units.
The Itanium ABI defines this as: struct _Unwind_Exception { uint64 exception_class; _Unwind_Exception_Cleanup_Fn exception_cleanup; uint64 private_1; uint64 private_2; };
Definition at line 346 of file CodeGen/TargetInfo.cpp.
Referenced by InitCatchParam().
|
inlinevirtual |
Return a constant used by UBSan as a signature to identify functions possessing type information, or 0 if the platform is unsupported.
Definition at line 161 of file lib/CodeGen/TargetInfo.h.
Referenced by clang::CodeGen::CodeGenFunction::StartFunction().
|
inlinevirtual |
Initializes the given DWARF EH register-size table, a char*.
Implements __builtin_init_dwarf_reg_size_table.
Returns true if the operation is unsupported by this target.
Definition at line 96 of file lib/CodeGen/TargetInfo.h.
|
virtual |
Determine whether a call to an unprototyped functions under the given calling convention should use the variadic convention or the non-variadic convention.
There's a good reason to make a platform's variadic calling convention be different from its non-variadic calling convention: the non-variadic arguments can be passed in registers (better for performance), and the variadic arguments can be passed on the stack (also better for performance). If this is done, however, unprototyped functions must use the non-variadic convention, because C99 states that a call through an unprototyped function type must succeed if the function was defined with a non-variadic prototype with compatible parameters. Therefore, splitting the conventions makes it impossible to call a variadic function through an unprototyped type. Since function prototypes came out in the late 1970s, this is probably an acceptable trade-off. Nonetheless, not all platforms are willing to make it, and in particularly x86-64 bends over backwards to make the conventions compatible.
The default is false. This is correct whenever:
However, some platforms make the conventions identical except for passing additional out-of-band information to a variadic function: for example, x86-64 passes the number of SSE arguments in al. On these platforms, it is desirable to call unprototyped functions using the variadic convention so that unprototyped calls to varargs functions still succeed.
Relatedly, platforms which pass the fixed arguments to this: A foo(B, C, D); differently than they would pass them to this: A foo(B, C, D, ...); may need to adjust the debugger-support code in Sema to do the right thing when calling a function with no know signature.
Definition at line 356 of file CodeGen/TargetInfo.cpp.
Referenced by arrangeFreeFunctionLikeCall().
|
inlinevirtual |
setTargetAttributes - Provides a convenient hook to handle extra target-specific attributes for the given global.
Definition at line 57 of file lib/CodeGen/TargetInfo.h.