clang  16.0.0git
TargetInfo.h
Go to the documentation of this file.
1 //===---- TargetInfo.h - Encapsulate target details -------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // These classes wrap the information about a call or function
10 // definition used to handle ABI compliancy.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_LIB_CODEGEN_TARGETINFO_H
15 #define LLVM_CLANG_LIB_CODEGEN_TARGETINFO_H
16 
17 #include "CGBuilder.h"
18 #include "CodeGenModule.h"
19 #include "CGValue.h"
20 #include "clang/AST/Type.h"
21 #include "clang/Basic/LLVM.h"
22 #include "clang/Basic/SyncScope.h"
23 #include "llvm/ADT/SmallString.h"
24 #include "llvm/ADT/StringRef.h"
25 
26 namespace llvm {
27 class Constant;
28 class GlobalValue;
29 class Type;
30 class Value;
31 }
32 
33 namespace clang {
34 class Decl;
35 
36 namespace CodeGen {
37 class ABIInfo;
38 class CallArgList;
39 class CodeGenFunction;
40 class CGBlockInfo;
41 class SwiftABIInfo;
42 
43 /// TargetCodeGenInfo - This class organizes various target-specific
44 /// codegeneration issues, like target-specific attributes, builtins and so
45 /// on.
47  std::unique_ptr<ABIInfo> Info;
48 
49 protected:
50  // Target hooks supporting Swift calling conventions. The target must
51  // initialize this field if it claims to support these calling conventions
52  // by returning true from TargetInfo::checkCallingConvention for them.
53  std::unique_ptr<SwiftABIInfo> SwiftInfo;
54 
55 public:
56  TargetCodeGenInfo(std::unique_ptr<ABIInfo> Info);
57  virtual ~TargetCodeGenInfo();
58 
59  /// getABIInfo() - Returns ABI info helper for the target.
60  const ABIInfo &getABIInfo() const { return *Info; }
61 
62  /// Returns Swift ABI info helper for the target.
63  const SwiftABIInfo &getSwiftABIInfo() const {
64  assert(SwiftInfo && "Swift ABI info has not been initialized");
65  return *SwiftInfo;
66  }
67 
68  /// setTargetAttributes - Provides a convenient hook to handle extra
69  /// target-specific attributes for the given global.
70  virtual void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV,
71  CodeGen::CodeGenModule &M) const {}
72 
73  /// emitTargetMetadata - Provides a convenient hook to handle extra
74  /// target-specific metadata for the given globals.
75  virtual void emitTargetMetadata(
77  const llvm::MapVector<GlobalDecl, StringRef> &MangledDeclNames) const {}
78 
79  /// Any further codegen related checks that need to be done on a function call
80  /// in a target specific manner.
82  const FunctionDecl *Caller,
83  const FunctionDecl *Callee,
84  const CallArgList &Args) const {}
85 
86  /// Determines the size of struct _Unwind_Exception on this platform,
87  /// in 8-bit units. The Itanium ABI defines this as:
88  /// struct _Unwind_Exception {
89  /// uint64 exception_class;
90  /// _Unwind_Exception_Cleanup_Fn exception_cleanup;
91  /// uint64 private_1;
92  /// uint64 private_2;
93  /// };
94  virtual unsigned getSizeOfUnwindException() const;
95 
96  /// Controls whether __builtin_extend_pointer should sign-extend
97  /// pointers to uint64_t or zero-extend them (the default). Has
98  /// no effect for targets:
99  /// - that have 64-bit pointers, or
100  /// - that cannot address through registers larger than pointers, or
101  /// - that implicitly ignore/truncate the top bits when addressing
102  /// through such registers.
103  virtual bool extendPointerWithSExt() const { return false; }
104 
105  /// Determines the DWARF register number for the stack pointer, for
106  /// exception-handling purposes. Implements __builtin_dwarf_sp_column.
107  ///
108  /// Returns -1 if the operation is unsupported by this target.
110  return -1;
111  }
112 
113  /// Initializes the given DWARF EH register-size table, a char*.
114  /// Implements __builtin_init_dwarf_reg_size_table.
115  ///
116  /// Returns true if the operation is unsupported by this target.
118  llvm::Value *Address) const {
119  return true;
120  }
121 
122  /// Performs the code-generation required to convert a return
123  /// address as stored by the system into the actual address of the
124  /// next instruction that will be executed.
125  ///
126  /// Used by __builtin_extract_return_addr().
128  llvm::Value *Address) const {
129  return Address;
130  }
131 
132  /// Performs the code-generation required to convert the address
133  /// of an instruction into a return address suitable for storage
134  /// by the system in a return slot.
135  ///
136  /// Used by __builtin_frob_return_addr().
138  llvm::Value *Address) const {
139  return Address;
140  }
141 
142  /// Performs a target specific test of a floating point value for things
143  /// like IsNaN, Infinity, ... Nullptr is returned if no implementation
144  /// exists.
145  virtual llvm::Value *
146  testFPKind(llvm::Value *V, unsigned BuiltinID, CGBuilderTy &Builder,
147  CodeGenModule &CGM) const {
148  assert(V->getType()->isFloatingPointTy() && "V should have an FP type.");
149  return nullptr;
150  }
151 
152  /// Corrects the low-level LLVM type for a given constraint and "usual"
153  /// type.
154  ///
155  /// \returns A pointer to a new LLVM type, possibly the same as the original
156  /// on success; 0 on failure.
158  StringRef Constraint,
159  llvm::Type *Ty) const {
160  return Ty;
161  }
162 
163  /// Target hook to decide whether an inline asm operand can be passed
164  /// by value.
166  llvm::Type *Ty) const {
167  return false;
168  }
169 
170  /// Adds constraints and types for result registers.
172  CodeGen::CodeGenFunction &CGF, CodeGen::LValue ReturnValue,
173  std::string &Constraints, std::vector<llvm::Type *> &ResultRegTypes,
174  std::vector<llvm::Type *> &ResultTruncRegTypes,
175  std::vector<CodeGen::LValue> &ResultRegDests, std::string &AsmString,
176  unsigned NumOutputs) const {}
177 
178  /// doesReturnSlotInterfereWithArgs - Return true if the target uses an
179  /// argument slot for an 'sret' type.
180  virtual bool doesReturnSlotInterfereWithArgs() const { return true; }
181 
182  /// Retrieve the address of a function to call immediately before
183  /// calling objc_retainAutoreleasedReturnValue. The
184  /// implementation of objc_autoreleaseReturnValue sniffs the
185  /// instruction stream following its return address to decide
186  /// whether it's a call to objc_retainAutoreleasedReturnValue.
187  /// This can be prohibitively expensive, depending on the
188  /// relocation model, and so on some targets it instead sniffs for
189  /// a particular instruction sequence. This functions returns
190  /// that instruction sequence in inline assembly, which will be
191  /// empty if none is required.
192  virtual StringRef getARCRetainAutoreleasedReturnValueMarker() const {
193  return "";
194  }
195 
196  /// Determine whether a call to objc_retainAutoreleasedReturnValue or
197  /// objc_unsafeClaimAutoreleasedReturnValue should be marked as 'notail'.
198  virtual bool markARCOptimizedReturnCallsAsNoTail() const { return false; }
199 
200  /// Return a constant used by UBSan as a signature to identify functions
201  /// possessing type information, or 0 if the platform is unsupported.
202  virtual llvm::Constant *
204  return nullptr;
205  }
206 
207  /// Determine whether a call to an unprototyped functions under
208  /// the given calling convention should use the variadic
209  /// convention or the non-variadic convention.
210  ///
211  /// There's a good reason to make a platform's variadic calling
212  /// convention be different from its non-variadic calling
213  /// convention: the non-variadic arguments can be passed in
214  /// registers (better for performance), and the variadic arguments
215  /// can be passed on the stack (also better for performance). If
216  /// this is done, however, unprototyped functions *must* use the
217  /// non-variadic convention, because C99 states that a call
218  /// through an unprototyped function type must succeed if the
219  /// function was defined with a non-variadic prototype with
220  /// compatible parameters. Therefore, splitting the conventions
221  /// makes it impossible to call a variadic function through an
222  /// unprototyped type. Since function prototypes came out in the
223  /// late 1970s, this is probably an acceptable trade-off.
224  /// Nonetheless, not all platforms are willing to make it, and in
225  /// particularly x86-64 bends over backwards to make the
226  /// conventions compatible.
227  ///
228  /// The default is false. This is correct whenever:
229  /// - the conventions are exactly the same, because it does not
230  /// matter and the resulting IR will be somewhat prettier in
231  /// certain cases; or
232  /// - the conventions are substantively different in how they pass
233  /// arguments, because in this case using the variadic convention
234  /// will lead to C99 violations.
235  ///
236  /// However, some platforms make the conventions identical except
237  /// for passing additional out-of-band information to a variadic
238  /// function: for example, x86-64 passes the number of SSE
239  /// arguments in %al. On these platforms, it is desirable to
240  /// call unprototyped functions using the variadic convention so
241  /// that unprototyped calls to varargs functions still succeed.
242  ///
243  /// Relatedly, platforms which pass the fixed arguments to this:
244  /// A foo(B, C, D);
245  /// differently than they would pass them to this:
246  /// A foo(B, C, D, ...);
247  /// may need to adjust the debugger-support code in Sema to do the
248  /// right thing when calling a function with no know signature.
249  virtual bool isNoProtoCallVariadic(const CodeGen::CallArgList &args,
250  const FunctionNoProtoType *fnType) const;
251 
252  /// Gets the linker options necessary to link a dependent library on this
253  /// platform.
254  virtual void getDependentLibraryOption(llvm::StringRef Lib,
255  llvm::SmallString<24> &Opt) const;
256 
257  /// Gets the linker options necessary to detect object file mismatches on
258  /// this platform.
259  virtual void getDetectMismatchOption(llvm::StringRef Name,
260  llvm::StringRef Value,
261  llvm::SmallString<32> &Opt) const {}
262 
263  /// Get LLVM calling convention for OpenCL kernel.
264  virtual unsigned getOpenCLKernelCallingConv() const;
265 
266  /// Get target specific null pointer.
267  /// \param T is the LLVM type of the null pointer.
268  /// \param QT is the clang QualType of the null pointer.
269  /// \return ConstantPointerNull with the given type \p T.
270  /// Each target can override it to return its own desired constant value.
271  virtual llvm::Constant *getNullPointer(const CodeGen::CodeGenModule &CGM,
272  llvm::PointerType *T, QualType QT) const;
273 
274  /// Get target favored AST address space of a global variable for languages
275  /// other than OpenCL and CUDA.
276  /// If \p D is nullptr, returns the default target favored address space
277  /// for global variable.
279  const VarDecl *D) const;
280 
281  /// Get the AST address space for alloca.
282  virtual LangAS getASTAllocaAddressSpace() const { return LangAS::Default; }
283 
284  /// Perform address space cast of an expression of pointer type.
285  /// \param V is the LLVM value to be casted to another address space.
286  /// \param SrcAddr is the language address space of \p V.
287  /// \param DestAddr is the targeted language address space.
288  /// \param DestTy is the destination LLVM pointer type.
289  /// \param IsNonNull is the flag indicating \p V is known to be non null.
290  virtual llvm::Value *performAddrSpaceCast(CodeGen::CodeGenFunction &CGF,
291  llvm::Value *V, LangAS SrcAddr,
292  LangAS DestAddr, llvm::Type *DestTy,
293  bool IsNonNull = false) const;
294 
295  /// Perform address space cast of a constant expression of pointer type.
296  /// \param V is the LLVM constant to be casted to another address space.
297  /// \param SrcAddr is the language address space of \p V.
298  /// \param DestAddr is the targeted language address space.
299  /// \param DestTy is the destination LLVM pointer type.
300  virtual llvm::Constant *performAddrSpaceCast(CodeGenModule &CGM,
301  llvm::Constant *V,
302  LangAS SrcAddr, LangAS DestAddr,
303  llvm::Type *DestTy) const;
304 
305  /// Get address space of pointer parameter for __cxa_atexit.
307  return LangAS::Default;
308  }
309 
310  /// Get the syncscope used in LLVM IR.
311  virtual llvm::SyncScope::ID getLLVMSyncScopeID(const LangOptions &LangOpts,
313  llvm::AtomicOrdering Ordering,
314  llvm::LLVMContext &Ctx) const;
315 
316  /// Interface class for filling custom fields of a block literal for OpenCL.
318  public:
319  typedef std::pair<llvm::Value *, StringRef> ValueTy;
322  /// Get the custom field types for OpenCL blocks.
324  /// Get the custom field values for OpenCL blocks.
326  getCustomFieldValues(CodeGenFunction &CGF, const CGBlockInfo &Info) = 0;
327  virtual bool areAllCustomFieldValuesConstant(const CGBlockInfo &Info) = 0;
328  /// Get the custom field values for OpenCL blocks if all values are LLVM
329  /// constants.
331  getCustomFieldValues(CodeGenModule &CGM, const CGBlockInfo &Info) = 0;
332  };
334  return nullptr;
335  }
336 
337  /// Create an OpenCL kernel for an enqueued block. The kernel function is
338  /// a wrapper for the block invoke function with target-specific calling
339  /// convention and ABI as an OpenCL kernel. The wrapper function accepts
340  /// block context and block arguments in target-specific way and calls
341  /// the original block invoke function.
342  virtual llvm::Function *
344  llvm::Function *BlockInvokeFunc,
345  llvm::Type *BlockTy) const;
346 
347  /// \return true if the target supports alias from the unmangled name to the
348  /// mangled name of functions declared within an extern "C" region and marked
349  /// as 'used', and having internal linkage.
350  virtual bool shouldEmitStaticExternCAliases() const { return true; }
351 
352  virtual void setCUDAKernelCallingConvention(const FunctionType *&FT) const {}
353 
354  /// Return the device-side type for the CUDA device builtin surface type.
355  virtual llvm::Type *getCUDADeviceBuiltinSurfaceDeviceType() const {
356  // By default, no change from the original one.
357  return nullptr;
358  }
359  /// Return the device-side type for the CUDA device builtin texture type.
360  virtual llvm::Type *getCUDADeviceBuiltinTextureDeviceType() const {
361  // By default, no change from the original one.
362  return nullptr;
363  }
364 
365  /// Emit the device-side copy of the builtin surface type.
367  LValue Dst,
368  LValue Src) const {
369  // DO NOTHING by default.
370  return false;
371  }
372  /// Emit the device-side copy of the builtin texture type.
374  LValue Dst,
375  LValue Src) const {
376  // DO NOTHING by default.
377  return false;
378  }
379 };
380 
381 } // namespace CodeGen
382 } // namespace clang
383 
384 #endif // LLVM_CLANG_LIB_CODEGEN_TARGETINFO_H
llvm
YAML serialization mapping.
Definition: Dominators.h:30
clang::CodeGen::TargetCodeGenInfo::TargetOpenCLBlockHelper
Interface class for filling custom fields of a block literal for OpenCL.
Definition: TargetInfo.h:317
clang::CodeGen::TargetCodeGenInfo::testFPKind
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,...
Definition: TargetInfo.h:146
clang::CodeGen::SwiftABIInfo
Target specific hooks for defining how a type should be passed or returned from functions with one of...
Definition: ABIInfo.h:117
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::CodeGen::TargetCodeGenInfo::getOpenCLKernelCallingConv
virtual unsigned getOpenCLKernelCallingConv() const
Get LLVM calling convention for OpenCL kernel.
Definition: TargetInfo.cpp:495
clang::CodeGen::TargetCodeGenInfo::~TargetCodeGenInfo
virtual ~TargetCodeGenInfo()
clang::CodeGen::TargetCodeGenInfo::setTargetAttributes
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...
Definition: TargetInfo.h:70
clang::CodeGen::TargetCodeGenInfo::TargetOpenCLBlockHelper::getCustomFieldTypes
virtual llvm::SmallVector< llvm::Type *, 1 > getCustomFieldTypes()=0
Get the custom field types for OpenCL blocks.
clang::CodeGen::TargetCodeGenInfo::markARCOptimizedReturnCallsAsNoTail
virtual bool markARCOptimizedReturnCallsAsNoTail() const
Determine whether a call to objc_retainAutoreleasedReturnValue or objc_unsafeClaimAutoreleasedReturnV...
Definition: TargetInfo.h:198
clang::CodeGen::TargetCodeGenInfo::isNoProtoCallVariadic
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...
Definition: TargetInfo.cpp:476
llvm::SmallVector
Definition: LLVM.h:38
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::CodeGen::TargetCodeGenInfo
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
Definition: TargetInfo.h:46
clang::CodeGen::TargetCodeGenInfo::extendPointerWithSExt
virtual bool extendPointerWithSExt() const
Controls whether __builtin_extend_pointer should sign-extend pointers to uint64_t or zero-extend them...
Definition: TargetInfo.h:103
clang::CodeGen::TargetCodeGenInfo::getLLVMSyncScopeID
virtual llvm::SyncScope::ID getLLVMSyncScopeID(const LangOptions &LangOpts, SyncScope Scope, llvm::AtomicOrdering Ordering, llvm::LLVMContext &Ctx) const
Get the syncscope used in LLVM IR.
Definition: TargetInfo.cpp:544
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:737
clang::CodeGen::CGBlockInfo
CGBlockInfo - Information to generate a block literal.
Definition: CGBlocks.h:156
clang::CodeGen::TargetCodeGenInfo::emitCUDADeviceBuiltinTextureDeviceCopy
virtual bool emitCUDADeviceBuiltinTextureDeviceCopy(CodeGenFunction &CGF, LValue Dst, LValue Src) const
Emit the device-side copy of the builtin texture type.
Definition: TargetInfo.h:373
clang::CodeGen::TargetCodeGenInfo::getDwarfEHStackPointer
virtual int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const
Determines the DWARF register number for the stack pointer, for exception-handling purposes.
Definition: TargetInfo.h:109
clang::CodeGen::TargetCodeGenInfo::createEnqueuedBlockKernel
virtual llvm::Function * createEnqueuedBlockKernel(CodeGenFunction &CGF, llvm::Function *BlockInvokeFunc, llvm::Type *BlockTy) const
Create an OpenCL kernel for an enqueued block.
Definition: TargetInfo.cpp:12310
clang::CodeGen::TargetCodeGenInfo::isScalarizableAsmOperand
virtual bool isScalarizableAsmOperand(CodeGen::CodeGenFunction &CGF, llvm::Type *Ty) const
Target hook to decide whether an inline asm operand can be passed by value.
Definition: TargetInfo.h:165
clang::CodeGen::TargetCodeGenInfo::getCUDADeviceBuiltinTextureDeviceType
virtual llvm::Type * getCUDADeviceBuiltinTextureDeviceType() const
Return the device-side type for the CUDA device builtin texture type.
Definition: TargetInfo.h:360
clang::CodeGen::TargetCodeGenInfo::setCUDAKernelCallingConvention
virtual void setCUDAKernelCallingConvention(const FunctionType *&FT) const
Definition: TargetInfo.h:352
clang::FunctionType
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3675
clang::FunctionNoProtoType
Represents a K&R-style 'int foo()' function, which has no information available about its arguments.
Definition: Type.h:3978
clang::CodeGen::CGBuilderTy
Definition: CGBuilder.h:45
clang::CodeGen::AlignmentSource::Decl
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
clang::CodeGen::TargetCodeGenInfo::getCUDADeviceBuiltinSurfaceDeviceType
virtual llvm::Type * getCUDADeviceBuiltinSurfaceDeviceType() const
Return the device-side type for the CUDA device builtin surface type.
Definition: TargetInfo.h:355
clang::CodeGen::TargetCodeGenInfo::decodeReturnAddress
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...
Definition: TargetInfo.h:127
clang::CodeGen::TargetCodeGenInfo::getAddrSpaceOfCxaAtexitPtrParam
virtual LangAS getAddrSpaceOfCxaAtexitPtrParam() const
Get address space of pointer parameter for __cxa_atexit.
Definition: TargetInfo.h:306
V
#define V(N, I)
Definition: ASTContext.h:3237
clang::CodeGen::TargetCodeGenInfo::adjustInlineAsmType
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.
Definition: TargetInfo.h:157
clang::CodeGen::TargetCodeGenInfo::emitCUDADeviceBuiltinSurfaceDeviceCopy
virtual bool emitCUDADeviceBuiltinSurfaceDeviceCopy(CodeGenFunction &CGF, LValue Dst, LValue Src) const
Emit the device-side copy of the builtin surface type.
Definition: TargetInfo.h:366
clang::CodeGen::TargetCodeGenInfo::getUBSanFunctionSignature
virtual llvm::Constant * getUBSanFunctionSignature(CodeGen::CodeGenModule &CGM) const
Return a constant used by UBSan as a signature to identify functions possessing type information,...
Definition: TargetInfo.h:203
CGValue.h
clang::Scope
Scope - A scope is a transient data structure that is used while parsing the program.
Definition: Scope.h:40
clang::CodeGen::TargetCodeGenInfo::TargetOpenCLBlockHelper::ValueTy
std::pair< llvm::Value *, StringRef > ValueTy
Definition: TargetInfo.h:319
clang::CodeGen::TargetCodeGenInfo::getNullPointer
virtual llvm::Constant * getNullPointer(const CodeGen::CodeGenModule &CGM, llvm::PointerType *T, QualType QT) const
Get target specific null pointer.
Definition: TargetInfo.cpp:509
clang::CodeGen::TargetCodeGenInfo::getASTAllocaAddressSpace
virtual LangAS getASTAllocaAddressSpace() const
Get the AST address space for alloca.
Definition: TargetInfo.h:282
Type.h
llvm::SmallString
Definition: LLVM.h:37
clang::CodeGen::TargetCodeGenInfo::getTargetOpenCLBlockHelper
virtual TargetOpenCLBlockHelper * getTargetOpenCLBlockHelper() const
Definition: TargetInfo.h:333
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:906
clang::SyncScope
SyncScope
Defines synch scope values used internally by clang.
Definition: SyncScope.h:42
clang::CodeGen::TargetCodeGenInfo::emitTargetMetadata
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...
Definition: TargetInfo.h:75
clang::CodeGen::TargetCodeGenInfo::getSizeOfUnwindException
virtual unsigned getSizeOfUnwindException() const
Determines the size of struct _Unwind_Exception on this platform, in 8-bit units.
Definition: TargetInfo.cpp:466
clang::CodeGen::Address
An aligned address.
Definition: Address.h:74
CodeGenModule.h
clang::CodeGen::TargetCodeGenInfo::checkFunctionCallABI
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...
Definition: TargetInfo.h:81
clang::CodeGen::TargetCodeGenInfo::TargetOpenCLBlockHelper::TargetOpenCLBlockHelper
TargetOpenCLBlockHelper()
Definition: TargetInfo.h:320
clang::LangAS
LangAS
Defines the address space values used by the address space qualifier of QualType.
Definition: AddressSpaces.h:25
clang::CodeGen::LValue
LValue - This represents an lvalue references.
Definition: CGValue.h:171
clang::CodeGen::TargetCodeGenInfo::TargetOpenCLBlockHelper::areAllCustomFieldValuesConstant
virtual bool areAllCustomFieldValuesConstant(const CGBlockInfo &Info)=0
clang::CodeGen::TargetCodeGenInfo::shouldEmitStaticExternCAliases
virtual bool shouldEmitStaticExternCAliases() const
Definition: TargetInfo.h:350
clang::CodeGen::CodeGenFunction
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
Definition: CodeGenFunction.h:231
clang::CodeGen::TargetCodeGenInfo::initDwarfEHRegSizeTable
virtual bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const
Initializes the given DWARF EH register-size table, a char*.
Definition: TargetInfo.h:117
clang::CodeGen::TargetCodeGenInfo::TargetOpenCLBlockHelper::getCustomFieldValues
virtual llvm::SmallVector< ValueTy, 1 > getCustomFieldValues(CodeGenFunction &CGF, const CGBlockInfo &Info)=0
Get the custom field values for OpenCL blocks.
clang::CodeGen::CodeGenModule
This class organizes the cross-function state that is used while generating LLVM code.
Definition: CodeGenModule.h:279
Value
Value
Definition: UninitializedValues.cpp:103
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:83
CGBuilder.h
clang::CodeGen::TargetCodeGenInfo::getABIInfo
const ABIInfo & getABIInfo() const
getABIInfo() - Returns ABI info helper for the target.
Definition: TargetInfo.h:60
LLVM.h
clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace
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.
Definition: TargetInfo.cpp:514
clang::CodeGen::TargetCodeGenInfo::getDependentLibraryOption
virtual void getDependentLibraryOption(llvm::StringRef Lib, llvm::SmallString< 24 > &Opt) const
Gets the linker options necessary to link a dependent library on this platform.
Definition: TargetInfo.cpp:486
clang::LangOptions
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:81
clang::CodeGen::TargetCodeGenInfo::getARCRetainAutoreleasedReturnValueMarker
virtual StringRef getARCRetainAutoreleasedReturnValueMarker() const
Retrieve the address of a function to call immediately before calling objc_retainAutoreleasedReturnVa...
Definition: TargetInfo.h:192
clang::LangAS::Default
@ Default
clang::CodeGen::TargetCodeGenInfo::TargetCodeGenInfo
TargetCodeGenInfo(std::unique_ptr< ABIInfo > Info)
Definition: TargetInfo.cpp:459
clang::Builtin::ID
ID
Definition: Builtins.h:52
clang::CodeGen::TargetCodeGenInfo::getSwiftABIInfo
const SwiftABIInfo & getSwiftABIInfo() const
Returns Swift ABI info helper for the target.
Definition: TargetInfo.h:63
clang
Definition: CalledOnceCheck.h:17
clang::CodeGen::TargetCodeGenInfo::doesReturnSlotInterfereWithArgs
virtual bool doesReturnSlotInterfereWithArgs() const
doesReturnSlotInterfereWithArgs - Return true if the target uses an argument slot for an 'sret' type.
Definition: TargetInfo.h:180
clang::CodeGen::TargetCodeGenInfo::encodeReturnAddress
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 ...
Definition: TargetInfo.h:137
clang::CodeGen::TargetCodeGenInfo::getDetectMismatchOption
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.
Definition: TargetInfo.h:259
clang::CodeGen::TargetCodeGenInfo::TargetOpenCLBlockHelper::~TargetOpenCLBlockHelper
virtual ~TargetOpenCLBlockHelper()
Definition: TargetInfo.h:321
clang::CodeGen::TargetCodeGenInfo::performAddrSpaceCast
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.
Definition: TargetInfo.cpp:522
SyncScope.h
clang::CodeGen::TargetCodeGenInfo::SwiftInfo
std::unique_ptr< SwiftABIInfo > SwiftInfo
Definition: TargetInfo.h:53
clang::CodeGen::CallArgList
CallArgList - Type for representing both the value and type of arguments in a call.
Definition: CGCall.h:259
clang::FunctionDecl
Represents a function declaration or definition.
Definition: Decl.h:1904
clang::CodeGen::TargetCodeGenInfo::addReturnRegisterOutputs
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.
Definition: TargetInfo.h:171
clang::CodeGen::ABIInfo
ABIInfo - Target specific hooks for defining how a type should be passed or returned from functions.
Definition: ABIInfo.h:45
Type
MatchType Type
Definition: ASTMatchFinder.cpp:71