TargetCodeGenInfo - This class organizes various target-specific codegeneration issues, like target-specific attributes, builtins and so on. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/TargetInfo.h"
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues, like target-specific attributes, builtins and so on.
Definition at line 47 of file TargetInfo.h.
◆ TargetCodeGenInfo() TargetCodeGenInfo::TargetCodeGenInfo ( std::unique_ptr< ABIInfo > Info )Definition at line 70 of file TargetInfo.cpp.
◆ ~TargetCodeGenInfo() TargetCodeGenInfo::~TargetCodeGenInfo ( ) virtualdefault ◆ addReturnRegisterOutputs() virtual void clang::CodeGen::TargetCodeGenInfo::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 inlinevirtualAdds constraints and types for result registers.
Definition at line 204 of file TargetInfo.h.
◆ addStackProbeTargetAttributes() void TargetCodeGenInfo::addStackProbeTargetAttributes ( const Decl * D, llvm::GlobalValue * GV, CodeGen::CodeGenModule & CGM ) const protected ◆ adjustInlineAsmType() virtual llvm::Type * clang::CodeGen::TargetCodeGenInfo::adjustInlineAsmType ( CodeGen::CodeGenFunction & CGF, StringRef Constraint, llvm::Type * Ty ) const inlinevirtualCorrects the low-level LLVM type for a given constraint and "usual" type.
Definition at line 190 of file TargetInfo.h.
◆ checkFunctionABI()Any further codegen related checks that need to be done on a function signature in a target specific manner.
Definition at line 90 of file TargetInfo.h.
◆ checkFunctionCallABI()Any further codegen related checks that need to be done on a function call in a target specific manner.
Definition at line 95 of file TargetInfo.h.
◆ createEnqueuedBlockKernel() llvm::Value * TargetCodeGenInfo::createEnqueuedBlockKernel ( CodeGenFunction & CGF, llvm::Function * Invoke, llvm::Type * BlockTy ) const virtual ◆ decodeReturnAddress() virtual llvm::Value * clang::CodeGen::TargetCodeGenInfo::decodeReturnAddress ( CodeGen::CodeGenFunction & CGF, llvm::Value * Address ) const inlinevirtualPerforms 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 160 of file TargetInfo.h.
◆ doesReturnSlotInterfereWithArgs() virtual bool clang::CodeGen::TargetCodeGenInfo::doesReturnSlotInterfereWithArgs ( ) const inlinevirtual ◆ emitCUDADeviceBuiltinSurfaceDeviceCopy()Emit the device-side copy of the builtin surface type.
Definition at line 422 of file TargetInfo.h.
◆ emitCUDADeviceBuiltinTextureDeviceCopy()Emit the device-side copy of the builtin texture type.
Definition at line 429 of file TargetInfo.h.
◆ emitTargetGlobals() ◆ emitTargetMetadata() virtual void clang::CodeGen::TargetCodeGenInfo::emitTargetMetadata ( CodeGen::CodeGenModule & CGM, const llvm::MapVector< GlobalDecl, StringRef > & MangledDeclNames ) const inlinevirtual ◆ encodeReturnAddress() virtual llvm::Value * clang::CodeGen::TargetCodeGenInfo::encodeReturnAddress ( CodeGen::CodeGenFunction & CGF, llvm::Value * Address ) const inlinevirtualPerforms 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 170 of file TargetInfo.h.
◆ extendPointerWithSExt() virtual bool clang::CodeGen::TargetCodeGenInfo::extendPointerWithSExt ( ) const inlinevirtualControls 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 136 of file TargetInfo.h.
◆ getABIInfo() [1/2] const T & clang::CodeGen::TargetCodeGenInfo::getABIInfo ( ) const inlineprotected ◆ getABIInfo() [2/2] const ABIInfo & clang::CodeGen::TargetCodeGenInfo::getABIInfo ( ) const inline ◆ getAddrSpaceOfCxaAtexitPtrParam() virtual LangAS clang::CodeGen::TargetCodeGenInfo::getAddrSpaceOfCxaAtexitPtrParam ( ) const inlinevirtual ◆ getARCRetainAutoreleasedReturnValueMarker() virtual StringRef clang::CodeGen::TargetCodeGenInfo::getARCRetainAutoreleasedReturnValueMarker ( ) const inlinevirtualRetrieve 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 225 of file TargetInfo.h.
Referenced by emitAutoreleasedReturnValueMarker().
◆ getASTAllocaAddressSpace() virtual LangAS clang::CodeGen::TargetCodeGenInfo::getASTAllocaAddressSpace ( ) const inlinevirtual ◆ getCUDADeviceBuiltinSurfaceDeviceType() virtual llvm::Type * clang::CodeGen::TargetCodeGenInfo::getCUDADeviceBuiltinSurfaceDeviceType ( ) const inlinevirtual ◆ getCUDADeviceBuiltinTextureDeviceType() virtual llvm::Type * clang::CodeGen::TargetCodeGenInfo::getCUDADeviceBuiltinTextureDeviceType ( ) const inlinevirtual ◆ getDependentLibraryOption() void TargetCodeGenInfo::getDependentLibraryOption ( llvm::StringRef Lib, llvm::SmallString< 24 > & Opt ) const virtual ◆ getDetectMismatchOption() virtual void clang::CodeGen::TargetCodeGenInfo::getDetectMismatchOption ( llvm::StringRef Name, llvm::StringRef Value, llvm::SmallString< 32 > & Opt ) const inlinevirtual ◆ getDwarfEHStackPointer()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 142 of file TargetInfo.h.
◆ getGlobalVarAddressSpace() ◆ getHLSLType() virtual llvm::Type * clang::CodeGen::TargetCodeGenInfo::getHLSLType ( CodeGenModule & CGM, const Type * T ) const inlinevirtual ◆ getLLVMSyncScopeID() llvm::SyncScope::ID TargetCodeGenInfo::getLLVMSyncScopeID ( const LangOptions & LangOpts, SyncScope Scope, llvm::AtomicOrdering Ordering, llvm::LLVMContext & Ctx ) const virtual ◆ getNullPointer() ◆ getOpenCLKernelCallingConv() unsigned TargetCodeGenInfo::getOpenCLKernelCallingConv ( ) const virtual ◆ getOpenCLType() virtual llvm::Type * clang::CodeGen::TargetCodeGenInfo::getOpenCLType ( CodeGenModule & CGM, const Type * T ) const inlinevirtual ◆ getSizeOfUnwindException() unsigned TargetCodeGenInfo::getSizeOfUnwindException ( ) const virtualDetermines 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 77 of file TargetInfo.cpp.
Referenced by InitCatchParam().
◆ getSwiftABIInfo() const SwiftABIInfo & clang::CodeGen::TargetCodeGenInfo::getSwiftABIInfo ( ) const inline ◆ getTargetOpenCLBlockHelper() ◆ getUBSanFunctionSignature() virtual llvm::Constant * clang::CodeGen::TargetCodeGenInfo::getUBSanFunctionSignature ( CodeGen::CodeGenModule & CGM ) const inlinevirtual ◆ getWasmExternrefReferenceType() virtual llvm::Type * clang::CodeGen::TargetCodeGenInfo::getWasmExternrefReferenceType ( ) const inlinevirtual ◆ getWasmFuncrefReferenceType() virtual llvm::Type * clang::CodeGen::TargetCodeGenInfo::getWasmFuncrefReferenceType ( ) const inlinevirtual ◆ initBranchProtectionFnAttributes() ◆ initDwarfEHRegSizeTable()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 150 of file TargetInfo.h.
◆ isNoProtoCallVariadic()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 87 of file TargetInfo.cpp.
Referenced by arrangeFreeFunctionLikeCall().
◆ isScalarizableAsmOperand()Target hook to decide whether an inline asm operand can be passed by value.
Definition at line 198 of file TargetInfo.h.
Referenced by EmitAsmStores().
◆ markARCOptimizedReturnCallsAsNoTail() virtual bool clang::CodeGen::TargetCodeGenInfo::markARCOptimizedReturnCallsAsNoTail ( ) const inlinevirtualDetermine whether a call to objc_retainAutoreleasedReturnValue or objc_unsafeClaimAutoreleasedReturnValue should be marked as 'notail'.
Definition at line 231 of file TargetInfo.h.
Referenced by emitOptimizedARCReturnCall().
◆ performAddrSpaceCast() [1/3] ◆ performAddrSpaceCast() [2/3] ◆ performAddrSpaceCast() [3/3] llvm::Constant * TargetCodeGenInfo::performAddrSpaceCast ( CodeGenModule & CGM, llvm::Constant * V, LangAS SrcAddr, LangAS DestAddr, llvm::Type * DestTy ) const virtualPerform address space cast of a constant expression of pointer type.
V
. DestAddr is the targeted language address space. DestTy is the destination LLVM pointer type.
Definition at line 146 of file TargetInfo.cpp.
◆ qualifyWindowsLibrary() std::string TargetCodeGenInfo::qualifyWindowsLibrary ( StringRef Lib ) staticprotectedDefinition at line 1605 of file X86.cpp.
◆ setBranchProtectionFnAttributes() ◆ setCUDAKernelCallingConvention() virtual void clang::CodeGen::TargetCodeGenInfo::setCUDAKernelCallingConvention ( const FunctionType *& FT ) const inlinevirtual ◆ setTargetAtomicMetadata() virtual void clang::CodeGen::TargetCodeGenInfo::setTargetAtomicMetadata ( CodeGenFunction & CGF, llvm::Instruction & AtomicInst, const AtomicExpr * Expr =nullptr
) const inlinevirtual ◆ setTargetAttributes() virtual void clang::CodeGen::TargetCodeGenInfo::setTargetAttributes ( const Decl * D, llvm::GlobalValue * GV, CodeGen::CodeGenModule & M ) const inlinevirtual ◆ shouldEmitDWARFBitFieldSeparators() virtual bool clang::CodeGen::TargetCodeGenInfo::shouldEmitDWARFBitFieldSeparators ( ) const inlinevirtual
Definition at line 400 of file TargetInfo.h.
◆ shouldEmitStaticExternCAliases() virtual bool clang::CodeGen::TargetCodeGenInfo::shouldEmitStaticExternCAliases ( ) const inlinevirtualDefinition at line 395 of file TargetInfo.h.
◆ testFPKind()Performs a target specific test of a floating point value for things like IsNaN, Infinity, ... Nullptr is returned if no implementation exists.
Definition at line 179 of file TargetInfo.h.
References V.
Referenced by tryUseTestFPKind().
◆ wouldInliningViolateFunctionCallABI() virtual bool clang::CodeGen::TargetCodeGenInfo::wouldInliningViolateFunctionCallABI ( const FunctionDecl * Caller, const FunctionDecl * Callee ) const inlinevirtualReturns true if inlining the function call would produce incorrect code for the current target and should be ignored (even with the always_inline or flatten attributes).
Note: This probably should be handled in LLVM. However, the LLVM alwaysinline
attribute currently means the inliner will ignore mismatched attributes (which sometimes can generate invalid code). So, this hook allows targets to avoid adding the LLVM alwaysinline
attribute based on C/C++ attributes or other target-specific reasons.
See previous discussion here: https://discourse.llvm.org/t/rfc-avoid-inlining-alwaysinline-functions-when-they-cannot-be-inlined/79528
Definition at line 114 of file TargetInfo.h.
◆ SwiftInfo std::unique_ptr<SwiftABIInfo> clang::CodeGen::TargetCodeGenInfo::SwiftInfo protectedThe documentation for this class was generated from the following files:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4