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