Go to the documentation of this file.
14 #ifndef LLVM_CLANG_LIB_CODEGEN_TARGETINFO_H
15 #define LLVM_CLANG_LIB_CODEGEN_TARGETINFO_H
23 #include "llvm/ADT/SmallString.h"
24 #include "llvm/ADT/StringRef.h"
39 class CodeGenFunction;
46 std::unique_ptr<ABIInfo> Info =
nullptr;
64 const llvm::MapVector<GlobalDecl, StringRef> &MangledDeclNames)
const {}
132 virtual llvm::Value *
135 assert(
V->getType()->isFloatingPointTy() &&
"V should have an FP type.");
145 StringRef Constraint,
146 llvm::Type *Ty)
const {
153 llvm::Type *Ty)
const {
160 std::string &Constraints, std::vector<llvm::Type *> &ResultRegTypes,
161 std::vector<llvm::Type *> &ResultTruncRegTypes,
162 std::vector<CodeGen::LValue> &ResultRegDests,
std::string &AsmString,
163 unsigned NumOutputs)
const {}
189 virtual llvm::Constant *
247 llvm::StringRef
Value,
259 llvm::PointerType *T,
QualType QT)
const;
278 llvm::Value *
V,
LangAS SrcAddr,
279 LangAS DestAddr, llvm::Type *DestTy,
280 bool IsNonNull =
false)
const;
290 llvm::Type *DestTy)
const;
300 llvm::AtomicOrdering Ordering,
301 llvm::LLVMContext &Ctx)
const;
306 typedef std::pair<llvm::Value *, StringRef>
ValueTy;
329 virtual llvm::Function *
331 llvm::Function *BlockInvokeFunc,
332 llvm::Type *BlockTy)
const;
371 #endif // LLVM_CLANG_LIB_CODEGEN_TARGETINFO_H
YAML serialization mapping.
Interface class for filling custom fields of a block literal for OpenCL.
virtual llvm::Value * testFPKind(llvm::Value *V, unsigned BuiltinID, CGBuilderTy &Builder, CodeGenModule &CGM) const
Performs a target specific test of a floating point value for things like IsNaN, Infinity,...
virtual unsigned getOpenCLKernelCallingConv() const
Get LLVM calling convention for OpenCL kernel.
virtual ~TargetCodeGenInfo()
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 g...
virtual llvm::SmallVector< llvm::Type *, 1 > getCustomFieldTypes()=0
Get the custom field types for OpenCL blocks.
virtual bool markARCOptimizedReturnCallsAsNoTail() const
Determine whether a call to objc_retainAutoreleasedReturnValue or objc_unsafeClaimAutoreleasedReturnV...
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 t...
Encodes a location in the source.
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
virtual bool extendPointerWithSExt() const
Controls whether __builtin_extend_pointer should sign-extend pointers to uint64_t or zero-extend them...
virtual llvm::SyncScope::ID getLLVMSyncScopeID(const LangOptions &LangOpts, SyncScope Scope, llvm::AtomicOrdering Ordering, llvm::LLVMContext &Ctx) const
Get the syncscope used in LLVM IR.
A (possibly-)qualified type.
CGBlockInfo - Information to generate a block literal.
virtual bool emitCUDADeviceBuiltinTextureDeviceCopy(CodeGenFunction &CGF, LValue Dst, LValue Src) const
Emit the device-side copy of the builtin texture type.
virtual int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const
Determines the DWARF register number for the stack pointer, for exception-handling purposes.
virtual llvm::Function * createEnqueuedBlockKernel(CodeGenFunction &CGF, llvm::Function *BlockInvokeFunc, llvm::Type *BlockTy) const
Create an OpenCL kernel for an enqueued block.
virtual bool isScalarizableAsmOperand(CodeGen::CodeGenFunction &CGF, llvm::Type *Ty) const
Target hook to decide whether an inline asm operand can be passed by value.
virtual llvm::Type * getCUDADeviceBuiltinTextureDeviceType() const
Return the device-side type for the CUDA device builtin texture type.
virtual void setCUDAKernelCallingConvention(const FunctionType *&FT) const
FunctionType - C99 6.7.5.3 - Function Declarators.
Represents a K&R-style 'int foo()' function, which has no information available about its arguments.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
virtual llvm::Type * getCUDADeviceBuiltinSurfaceDeviceType() const
Return the device-side type for the CUDA device builtin surface type.
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 ac...
virtual LangAS getAddrSpaceOfCxaAtexitPtrParam() const
Get address space of pointer parameter for __cxa_atexit.
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.
virtual bool emitCUDADeviceBuiltinSurfaceDeviceCopy(CodeGenFunction &CGF, LValue Dst, LValue Src) const
Emit the device-side copy of the builtin surface type.
virtual llvm::Constant * getUBSanFunctionSignature(CodeGen::CodeGenModule &CGM) const
Return a constant used by UBSan as a signature to identify functions possessing type information,...
Scope - A scope is a transient data structure that is used while parsing the program.
std::pair< llvm::Value *, StringRef > ValueTy
virtual llvm::Constant * getNullPointer(const CodeGen::CodeGenModule &CGM, llvm::PointerType *T, QualType QT) const
Get target specific null pointer.
virtual LangAS getASTAllocaAddressSpace() const
Get the AST address space for alloca.
virtual TargetOpenCLBlockHelper * getTargetOpenCLBlockHelper() const
Represents a variable declaration or definition.
SyncScope
Defines synch scope values used internally by clang.
virtual void emitTargetMetadata(CodeGen::CodeGenModule &CGM, const llvm::MapVector< GlobalDecl, StringRef > &MangledDeclNames) const
emitTargetMetadata - Provides a convenient hook to handle extra target-specific metadata for the give...
virtual unsigned getSizeOfUnwindException() const
Determines the size of struct _Unwind_Exception on this platform, in 8-bit units.
virtual void checkFunctionCallABI(CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDecl *Caller, const FunctionDecl *Callee, const CallArgList &Args) const
Any further codegen related checks that need to be done on a function call in a target specific manne...
TargetOpenCLBlockHelper()
LangAS
Defines the address space values used by the address space qualifier of QualType.
LValue - This represents an lvalue references.
virtual bool areAllCustomFieldValuesConstant(const CGBlockInfo &Info)=0
virtual bool shouldEmitStaticExternCAliases() const
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
virtual bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const
Initializes the given DWARF EH register-size table, a char*.
virtual llvm::SmallVector< ValueTy, 1 > getCustomFieldValues(CodeGenFunction &CGF, const CGBlockInfo &Info)=0
Get the custom field values for OpenCL blocks.
This class organizes the cross-function state that is used while generating LLVM code.
Decl - This represents one declaration (or definition), e.g.
const ABIInfo & getABIInfo() const
getABIInfo() - Returns ABI info helper for the target.
virtual LangAS getGlobalVarAddressSpace(CodeGenModule &CGM, const VarDecl *D) const
Get target favored AST address space of a global variable for languages other than OpenCL and CUDA.
virtual void getDependentLibraryOption(llvm::StringRef Lib, llvm::SmallString< 24 > &Opt) const
Gets the linker options necessary to link a dependent library on this platform.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
virtual StringRef getARCRetainAutoreleasedReturnValueMarker() const
Retrieve the address of a function to call immediately before calling objc_retainAutoreleasedReturnVa...
TargetCodeGenInfo(std::unique_ptr< ABIInfo > Info)
virtual bool doesReturnSlotInterfereWithArgs() const
doesReturnSlotInterfereWithArgs - Return true if the target uses an argument slot for an 'sret' type.
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 ...
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.
virtual ~TargetOpenCLBlockHelper()
virtual llvm::Value * performAddrSpaceCast(CodeGen::CodeGenFunction &CGF, llvm::Value *V, LangAS SrcAddr, LangAS DestAddr, llvm::Type *DestTy, bool IsNonNull=false) const
Perform address space cast of an expression of pointer type.
CallArgList - Type for representing both the value and type of arguments in a call.
Represents a function declaration or definition.
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.
ABIInfo - Target specific hooks for defining how a type should be passed or returned from functions.