A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://clang.llvm.org/doxygen/classclang_1_1CodeGen_1_1TargetCodeGenInfo.html below:

clang: clang::CodeGen::TargetCodeGenInfo Class Reference

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 (std::unique_ptr< ABIInfo > Info)   virtual  ~TargetCodeGenInfo ()   const ABIInfogetABIInfo () const   getABIInfo() - Returns ABI info helper for the target.
  const SwiftABIInfogetSwiftABIInfo () const   Returns Swift ABI info helper for the target.
  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.
  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 given globals.
  virtual void  emitTargetGlobals (CodeGen::CodeGenModule &CGM) const   Provides a convenient hook to handle extra target-specific globals.
  virtual void  checkFunctionABI (CodeGenModule &CGM, const FunctionDecl *Decl) const   Any further codegen related checks that need to be done on a function signature in a target specific manner.
  virtual void  checkFunctionCallABI (CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDecl *Caller, const FunctionDecl *Callee, const CallArgList &Args, QualType ReturnType) const   Any further codegen related checks that need to be done on a function call in a target specific manner.
  virtual bool  wouldInliningViolateFunctionCallABI (const FunctionDecl *Caller, const FunctionDecl *Callee) const   Returns 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).
  virtual unsigned  getSizeOfUnwindException () const   Determines the size of struct _Unwind_Exception on this platform, in 8-bit units.
  virtual bool  extendPointerWithSExt () const   Controls whether __builtin_extend_pointer should sign-extend pointers to uint64_t or zero-extend them (the default).
  virtual int  getDwarfEHStackPointer (CodeGen::CodeGenModule &M) const   Determines the DWARF register number for the stack pointer, for exception-handling purposes.
  virtual bool  initDwarfEHRegSizeTable (CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const   Initializes the given DWARF EH register-size table, a char*.
  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.
  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.
  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, ... Nullptr is returned if no implementation exists.
  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  isScalarizableAsmOperand (CodeGen::CodeGenFunction &CGF, llvm::Type *Ty) const   Target hook to decide whether an inline asm operand can be passed by value.
  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.
  virtual bool  doesReturnSlotInterfereWithArgs () const   doesReturnSlotInterfereWithArgs - Return true if the target uses an argument slot for an 'sret' type.
  virtual StringRef  getARCRetainAutoreleasedReturnValueMarker () const   Retrieve the address of a function to call immediately before calling objc_retainAutoreleasedReturnValue.
  virtual bool  markARCOptimizedReturnCallsAsNoTail () const   Determine whether a call to objc_retainAutoreleasedReturnValue or objc_unsafeClaimAutoreleasedReturnValue should be marked as 'notail'.
  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.
  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.
  virtual void  getDependentLibraryOption (llvm::StringRef Lib, llvm::SmallString< 24 > &Opt) const   Gets the linker options necessary to link a dependent library on this platform.
  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 unsigned  getOpenCLKernelCallingConv () const   Get LLVM calling convention for OpenCL kernel.
  virtual llvm::Constant *  getNullPointer (const CodeGen::CodeGenModule &CGM, llvm::PointerType *T, QualType QT) const   Get target specific null pointer.
  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 LangAS  getASTAllocaAddressSpace () const   Get the AST address space for alloca.
  Address  performAddrSpaceCast (CodeGen::CodeGenFunction &CGF, Address Addr, LangAS SrcAddr, LangAS DestAddr, llvm::Type *DestTy, bool IsNonNull=false) const   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.
  virtual llvm::Constant *  performAddrSpaceCast (CodeGenModule &CGM, llvm::Constant *V, LangAS SrcAddr, LangAS DestAddr, llvm::Type *DestTy) const   Perform address space cast of a constant expression of pointer type.
  virtual LangAS  getAddrSpaceOfCxaAtexitPtrParam () const   Get address space of pointer parameter for __cxa_atexit.
  virtual llvm::SyncScope::ID  getLLVMSyncScopeID (const LangOptions &LangOpts, SyncScope Scope, llvm::AtomicOrdering Ordering, llvm::LLVMContext &Ctx) const   Get the syncscope used in LLVM IR.
  virtual void  setTargetAtomicMetadata (CodeGenFunction &CGF, llvm::Instruction &AtomicInst, const AtomicExpr *Expr=nullptr) const   Allow the target to apply other metadata to an atomic instruction.
  virtual TargetOpenCLBlockHelpergetTargetOpenCLBlockHelper () const   virtual llvm::Value *  createEnqueuedBlockKernel (CodeGenFunction &CGF, llvm::Function *BlockInvokeFunc, llvm::Type *BlockTy) const   Create an OpenCL kernel for an enqueued block.
  virtual bool  shouldEmitStaticExternCAliases () const   virtual bool  shouldEmitDWARFBitFieldSeparators () const   virtual void  setCUDAKernelCallingConvention (const FunctionType *&FT) const   virtual llvm::Type *  getCUDADeviceBuiltinSurfaceDeviceType () const   Return the device-side type for the CUDA device builtin surface type.
  virtual llvm::Type *  getCUDADeviceBuiltinTextureDeviceType () const   Return the device-side type for the CUDA device builtin texture type.
  virtual llvm::Type *  getWasmExternrefReferenceType () const   Return the WebAssembly externref reference type.
  virtual llvm::Type *  getWasmFuncrefReferenceType () const   Return the WebAssembly funcref reference type.
  virtual bool  emitCUDADeviceBuiltinSurfaceDeviceCopy (CodeGenFunction &CGF, LValue Dst, LValue Src) const   Emit the device-side copy of the builtin surface type.
  virtual bool  emitCUDADeviceBuiltinTextureDeviceCopy (CodeGenFunction &CGF, LValue Dst, LValue Src) const   Emit the device-side copy of the builtin texture type.
  virtual llvm::Type *  getOpenCLType (CodeGenModule &CGM, const Type *T) const   Return an LLVM type that corresponds to an OpenCL type.
  virtual llvm::Type *  getHLSLType (CodeGenModule &CGM, const Type *T) const   Return an LLVM type that corresponds to a HLSL type.
 

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< ABIInfoInfo )

Definition at line 70 of file TargetInfo.cpp.

◆ ~TargetCodeGenInfo() TargetCodeGenInfo::~TargetCodeGenInfo ( ) virtualdefault ◆ addReturnRegisterOutputs() virtual void clang::CodeGen::TargetCodeGenInfo::addReturnRegisterOutputs ( CodeGen::CodeGenFunctionCGF, 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 inlinevirtual

Adds constraints and types for result registers.

Definition at line 204 of file TargetInfo.h.

◆ addStackProbeTargetAttributes() void TargetCodeGenInfo::addStackProbeTargetAttributes ( const DeclD, llvm::GlobalValue *  GV, CodeGen::CodeGenModuleCGM  ) const protected ◆ adjustInlineAsmType() virtual llvm::Type * clang::CodeGen::TargetCodeGenInfo::adjustInlineAsmType ( CodeGen::CodeGenFunctionCGF, StringRef  Constraint, llvm::Type *  Ty  ) const inlinevirtual

Corrects the low-level LLVM type for a given constraint and "usual" type.

Returns
A pointer to a new LLVM type, possibly the same as the original on success; 0 on failure.

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 ( CodeGenFunctionCGF, llvm::Function *  Invoke, llvm::Type *  BlockTy  ) const virtual ◆ decodeReturnAddress() virtual llvm::Value * clang::CodeGen::TargetCodeGenInfo::decodeReturnAddress ( CodeGen::CodeGenFunctionCGF, llvm::Value *  Address  ) const 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 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::CodeGenModuleCGM, const llvm::MapVector< GlobalDecl, StringRef > &  MangledDeclNames  ) const inlinevirtual ◆ encodeReturnAddress() virtual llvm::Value * clang::CodeGen::TargetCodeGenInfo::encodeReturnAddress ( CodeGen::CodeGenFunctionCGF, llvm::Value *  Address  ) const 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 170 of file TargetInfo.h.

◆ extendPointerWithSExt() virtual bool clang::CodeGen::TargetCodeGenInfo::extendPointerWithSExt ( ) const 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 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 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 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 ( CodeGenModuleCGM, const TypeT  ) const inlinevirtual ◆ getLLVMSyncScopeID() llvm::SyncScope::ID TargetCodeGenInfo::getLLVMSyncScopeID ( const LangOptionsLangOpts, 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 ( CodeGenModuleCGM, const TypeT  ) const inlinevirtual ◆ getSizeOfUnwindException() unsigned TargetCodeGenInfo::getSizeOfUnwindException ( ) const 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 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::CodeGenModuleCGM ) 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 inlinevirtual

Determine 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 ( CodeGenModuleCGM, llvm::Constant *  V, LangAS  SrcAddr, LangAS  DestAddr, llvm::Type *  DestTy  ) const virtual

Perform address space cast of a constant expression of pointer type.

Parameters
V is the LLVM constant to be casted to another address space. SrcAddr is the language address space of 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 ) staticprotected

Definition 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 ( CodeGenFunctionCGF, llvm::Instruction &  AtomicInst, const AtomicExprExpr = nullptr  ) const inlinevirtual ◆ setTargetAttributes() virtual void clang::CodeGen::TargetCodeGenInfo::setTargetAttributes ( const DeclD, llvm::GlobalValue *  GV, CodeGen::CodeGenModuleM  ) const inlinevirtual ◆ shouldEmitDWARFBitFieldSeparators() virtual bool clang::CodeGen::TargetCodeGenInfo::shouldEmitDWARFBitFieldSeparators ( ) const inlinevirtual
Returns
true if annonymous zero-sized bitfields should be emitted to correctly distinguish between struct types whose memory layout is the same, but whose layout may differ when used as argument passed by value

Definition at line 400 of file TargetInfo.h.

◆ shouldEmitStaticExternCAliases() virtual bool clang::CodeGen::TargetCodeGenInfo::shouldEmitStaticExternCAliases ( ) const inlinevirtual
Returns
true if the target supports alias from the unmangled name to the mangled name of functions declared within an extern "C" region and marked as 'used', and having internal linkage.

Definition 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 FunctionDeclCaller, const FunctionDeclCallee  ) const inlinevirtual

Returns 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 protected

The 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