clang  15.0.0git
CodeGenTypes.h
Go to the documentation of this file.
1 //===--- CodeGenTypes.h - Type translation for LLVM CodeGen -----*- 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 // This is the code that handles AST -> LLVM type lowering.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENTYPES_H
14 #define LLVM_CLANG_LIB_CODEGEN_CODEGENTYPES_H
15 
16 #include "CGCall.h"
17 #include "clang/Basic/ABI.h"
19 #include "llvm/ADT/DenseMap.h"
20 #include "llvm/IR/Module.h"
21 
22 namespace llvm {
23 class FunctionType;
24 class DataLayout;
25 class Type;
26 class LLVMContext;
27 class StructType;
28 }
29 
30 namespace clang {
31 class ASTContext;
32 template <typename> class CanQual;
33 class CXXConstructorDecl;
34 class CXXMethodDecl;
35 class CodeGenOptions;
36 class FunctionProtoType;
37 class QualType;
38 class RecordDecl;
39 class TagDecl;
40 class TargetInfo;
41 class Type;
42 typedef CanQual<Type> CanQualType;
43 class GlobalDecl;
44 
45 namespace CodeGen {
46 class ABIInfo;
47 class CGCXXABI;
48 class CGRecordLayout;
49 class CodeGenModule;
50 class RequiredArgs;
51 
52 /// This class organizes the cross-module state that is used while lowering
53 /// AST types to LLVM types.
54 class CodeGenTypes {
55  CodeGenModule &CGM;
56  // Some of this stuff should probably be left on the CGM.
57  ASTContext &Context;
58  llvm::Module &TheModule;
59  const TargetInfo &Target;
60  CGCXXABI &TheCXXABI;
61 
62  // This should not be moved earlier, since its initialization depends on some
63  // of the previous reference members being already initialized
64  const ABIInfo &TheABIInfo;
65 
66  /// The opaque type map for Objective-C interfaces. All direct
67  /// manipulation is done by the runtime interfaces, which are
68  /// responsible for coercing to the appropriate type; these opaque
69  /// types are never refined.
70  llvm::DenseMap<const ObjCInterfaceType*, llvm::Type *> InterfaceTypes;
71 
72  /// Maps clang struct type with corresponding record layout info.
73  llvm::DenseMap<const Type*, std::unique_ptr<CGRecordLayout>> CGRecordLayouts;
74 
75  /// Contains the LLVM IR type for any converted RecordDecl.
76  llvm::DenseMap<const Type*, llvm::StructType *> RecordDeclTypes;
77 
78  /// Hold memoized CGFunctionInfo results.
79  llvm::FoldingSet<CGFunctionInfo> FunctionInfos{FunctionInfosLog2InitSize};
80 
81  /// This set keeps track of records that we're currently converting
82  /// to an IR type. For example, when converting:
83  /// struct A { struct B { int x; } } when processing 'x', the 'A' and 'B'
84  /// types will be in this set.
85  llvm::SmallPtrSet<const Type*, 4> RecordsBeingLaidOut;
86 
87  llvm::SmallPtrSet<const CGFunctionInfo*, 4> FunctionsBeingProcessed;
88 
89  /// True if we didn't layout a function due to a being inside
90  /// a recursive struct conversion, set this to true.
91  bool SkippedLayout;
92 
93  SmallVector<const RecordDecl *, 8> DeferredRecords;
94 
95  /// This map keeps cache of llvm::Types and maps clang::Type to
96  /// corresponding llvm::Type.
97  llvm::DenseMap<const Type *, llvm::Type *> TypeCache;
98 
99  llvm::DenseMap<const Type *, llvm::Type *> RecordsWithOpaqueMemberPointers;
100 
101  static constexpr unsigned FunctionInfosLog2InitSize = 9;
102  /// Helper for ConvertType.
103  llvm::Type *ConvertFunctionTypeInternal(QualType FT);
104 
105 public:
107  ~CodeGenTypes();
108 
109  const llvm::DataLayout &getDataLayout() const {
110  return TheModule.getDataLayout();
111  }
112  ASTContext &getContext() const { return Context; }
113  const ABIInfo &getABIInfo() const { return TheABIInfo; }
114  const TargetInfo &getTarget() const { return Target; }
115  CGCXXABI &getCXXABI() const { return TheCXXABI; }
116  llvm::LLVMContext &getLLVMContext() { return TheModule.getContext(); }
117  const CodeGenOptions &getCodeGenOpts() const;
118 
119  /// Convert clang calling convention to LLVM callilng convention.
121 
122  /// Derives the 'this' type for codegen purposes, i.e. ignoring method CVR
123  /// qualification.
125 
126  /// ConvertType - Convert type T into a llvm::Type.
127  llvm::Type *ConvertType(QualType T);
128 
129  /// ConvertTypeForMem - Convert type T into a llvm::Type. This differs from
130  /// ConvertType in that it is used to convert to the memory representation for
131  /// a type. For example, the scalar representation for _Bool is i1, but the
132  /// memory representation is usually i8 or i32, depending on the target.
133  llvm::Type *ConvertTypeForMem(QualType T, bool ForBitField = false);
134 
135  /// GetFunctionType - Get the LLVM function type for \arg Info.
136  llvm::FunctionType *GetFunctionType(const CGFunctionInfo &Info);
137 
138  llvm::FunctionType *GetFunctionType(GlobalDecl GD);
139 
140  /// isFuncTypeConvertible - Utility to check whether a function type can
141  /// be converted to an LLVM type (i.e. doesn't depend on an incomplete tag
142  /// type).
143  bool isFuncTypeConvertible(const FunctionType *FT);
145 
146  /// Determine if a C++ inheriting constructor should have parameters matching
147  /// those of its inherited constructor.
148  bool inheritingCtorHasParams(const InheritedConstructor &Inherited,
149  CXXCtorType Type);
150 
151  /// GetFunctionTypeForVTable - Get the LLVM function type for use in a vtable,
152  /// given a CXXMethodDecl. If the method to has an incomplete return type,
153  /// and/or incomplete argument types, this will return the opaque type.
154  llvm::Type *GetFunctionTypeForVTable(GlobalDecl GD);
155 
157 
158  /// UpdateCompletedType - When we find the full definition for a TagDecl,
159  /// replace the 'opaque' type we previously made for it if applicable.
160  void UpdateCompletedType(const TagDecl *TD);
161 
162  /// Remove stale types from the type cache when an inheritance model
163  /// gets assigned to a class.
164  void RefreshTypeCacheForClass(const CXXRecordDecl *RD);
165 
166  // The arrangement methods are split into three families:
167  // - those meant to drive the signature and prologue/epilogue
168  // of a function declaration or definition,
169  // - those meant for the computation of the LLVM type for an abstract
170  // appearance of a function, and
171  // - those meant for performing the IR-generation of a call.
172  // They differ mainly in how they deal with optional (i.e. variadic)
173  // arguments, as well as unprototyped functions.
174  //
175  // Key points:
176  // - The CGFunctionInfo for emitting a specific call site must include
177  // entries for the optional arguments.
178  // - The function type used at the call site must reflect the formal
179  // signature of the declaration being called, or else the call will
180  // go awry.
181  // - For the most part, unprototyped functions are called by casting to
182  // a formal signature inferred from the specific argument types used
183  // at the call-site. However, some targets (e.g. x86-64) screw with
184  // this for compatibility reasons.
185 
187 
188  /// Given a function info for a declaration, return the function info
189  /// for a call with the given arguments.
190  ///
191  /// Often this will be able to simply return the declaration info.
192  const CGFunctionInfo &arrangeCall(const CGFunctionInfo &declFI,
193  const CallArgList &args);
194 
195  /// Free functions are functions that are compatible with an ordinary
196  /// C function pointer type.
199  const FunctionType *Ty,
200  bool ChainCall);
203 
204  /// A nullary function is a freestanding function of type 'void ()'.
205  /// This method works for both calls and declarations.
207 
208  /// A builtin function is a freestanding function using the default
209  /// C conventions.
210  const CGFunctionInfo &
212  const FunctionArgList &args);
213  const CGFunctionInfo &
215  ArrayRef<CanQualType> argTypes);
217  const CallArgList &args);
218 
219  /// Objective-C methods are C functions with some implicit parameters.
222  QualType receiverType);
224  QualType returnType,
225  const CallArgList &args);
226 
227  /// Block invocation functions are C functions with an implicit parameter.
229  const FunctionProtoType *type,
230  const FunctionArgList &args);
232  const FunctionType *type);
233 
234  /// C++ methods have some special rules and also have implicit parameters.
238  const CXXConstructorDecl *D,
239  CXXCtorType CtorKind,
240  unsigned ExtraPrefixArgs,
241  unsigned ExtraSuffixArgs,
242  bool PassProtoArgs = true);
243 
245  const FunctionProtoType *type,
246  RequiredArgs required,
247  unsigned numPrefixArgs);
248  const CGFunctionInfo &
251  CXXCtorType CT);
253  const FunctionProtoType *FTP,
254  const CXXMethodDecl *MD);
255 
256  /// "Arrange" the LLVM information for a call or type with the given
257  /// signature. This is largely an internal method; other clients
258  /// should use one of the above routines, which ultimately defer to
259  /// this.
260  ///
261  /// \param argTypes - must all actually be canonical as params
263  bool instanceMethod,
264  bool chainCall,
265  ArrayRef<CanQualType> argTypes,
268  RequiredArgs args);
269 
270  /// Compute a new LLVM record layout object for the given record.
271  std::unique_ptr<CGRecordLayout> ComputeRecordLayout(const RecordDecl *D,
272  llvm::StructType *Ty);
273 
274  /// addRecordTypeName - Compute a name from the given record decl with an
275  /// optional suffix and name the given LLVM type using it.
276  void addRecordTypeName(const RecordDecl *RD, llvm::StructType *Ty,
277  StringRef suffix);
278 
279 
280 public: // These are internal details of CGT that shouldn't be used externally.
281  /// ConvertRecordDeclType - Lay out a tagged decl type like struct or union.
282  llvm::StructType *ConvertRecordDeclType(const RecordDecl *TD);
283 
284  /// getExpandedTypes - Expand the type \arg Ty into the LLVM
285  /// argument types it would be passed as. See ABIArgInfo::Expand.
286  void getExpandedTypes(QualType Ty,
288 
289  /// IsZeroInitializable - Return whether a type can be
290  /// zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
292 
293  /// Check if the pointer type can be zero-initialized (in the C++ sense)
294  /// with an LLVM zeroinitializer.
296 
297  /// IsZeroInitializable - Return whether a record type can be
298  /// zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
299  bool isZeroInitializable(const RecordDecl *RD);
300 
301  bool isRecordLayoutComplete(const Type *Ty) const;
302  bool noRecordsBeingLaidOut() const {
303  return RecordsBeingLaidOut.empty();
304  }
305  bool isRecordBeingLaidOut(const Type *Ty) const {
306  return RecordsBeingLaidOut.count(Ty);
307  }
308 
309 };
310 
311 } // end namespace CodeGen
312 } // end namespace clang
313 
314 #endif
clang::CodeGen::CodeGenTypes::getContext
ASTContext & getContext() const
Definition: CodeGenTypes.h:112
clang::CodeGen::CodeGenTypes::getTarget
const TargetInfo & getTarget() const
Definition: CodeGenTypes.h:114
llvm
YAML serialization mapping.
Definition: Dominators.h:30
clang::CXXConstructorDecl
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2434
clang::CodeGen::CodeGenTypes::noRecordsBeingLaidOut
bool noRecordsBeingLaidOut() const
Definition: CodeGenTypes.h:302
type
clang::CodeGen::CodeGenTypes::getABIInfo
const ABIInfo & getABIInfo() const
Definition: CodeGenTypes.h:113
clang::CodeGen::CodeGenTypes::arrangeUnprototypedObjCMessageSend
const CGFunctionInfo & arrangeUnprototypedObjCMessageSend(QualType returnType, const CallArgList &args)
Definition: CGCall.cpp:515
llvm::SmallVector
Definition: LLVM.h:38
clang::CodeGen::CodeGenTypes::RefreshTypeCacheForClass
void RefreshTypeCacheForClass(const CXXRecordDecl *RD)
Remove stale types from the type cache when an inheritance model gets assigned to a class.
Definition: CodeGenTypes.cpp:299
clang::CodeGen::CodeGenTypes::arrangeBlockFunctionCall
const CGFunctionInfo & arrangeBlockFunctionCall(const CallArgList &args, const FunctionType *type)
A block function is essentially a free function with an extra implicit argument.
Definition: CGCall.cpp:634
clang::MultiVersionKind::Target
@ Target
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:731
clang::CodeGen::CodeGenTypes::getCodeGenOpts
const CodeGenOptions & getCodeGenOpts() const
Definition: CodeGenTypes.cpp:45
clang::TargetInfo
Exposes information about the current target.
Definition: TargetInfo.h:190
clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration
const CGFunctionInfo & arrangeBuiltinFunctionDeclaration(QualType resultType, const FunctionArgList &args)
A builtin function is a freestanding function using the default C conventions.
Definition: CGCall.cpp:666
clang::CodeGen::CodeGenTypes::isFuncParamTypeConvertible
bool isFuncParamTypeConvertible(QualType Ty)
isFuncParamTypeConvertible - Return true if the specified type in a function parameter or result posi...
Definition: CodeGenTypes.cpp:215
clang::CodeGen::CodeGenTypes::getLLVMContext
llvm::LLVMContext & getLLVMContext()
Definition: CodeGenTypes.h:116
llvm::SmallPtrSet
Definition: ASTContext.h:82
clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature
const CGFunctionInfo & arrangeObjCMessageSendSignature(const ObjCMethodDecl *MD, QualType receiverType)
Arrange the argument and result information for the function type through which to perform a send to ...
Definition: CGCall.cpp:484
clang::FunctionType
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3618
clang::CodeGen::CodeGenTypes::arrangeBlockFunctionDeclaration
const CGFunctionInfo & arrangeBlockFunctionDeclaration(const FunctionProtoType *type, const FunctionArgList &args)
Block invocation functions are C functions with an implicit parameter.
Definition: CGCall.cpp:641
clang::CodeGen::CodeGenTypes::ConvertType
llvm::Type * ConvertType(QualType T)
ConvertType - Convert type T into a llvm::Type.
Definition: CodeGenTypes.cpp:401
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1556
ABI.h
clang::GlobalDecl
GlobalDecl - represents a global declaration.
Definition: GlobalDecl.h:56
clang::CodeGen::CodeGenTypes::ConvertTypeForMem
llvm::Type * ConvertTypeForMem(QualType T, bool ForBitField=false)
ConvertTypeForMem - Convert type T into a llvm::Type.
Definition: CodeGenTypes.cpp:91
CGCall.h
clang::CodeGen::CodeGenTypes::arrangeObjCMethodDeclaration
const CGFunctionInfo & arrangeObjCMethodDeclaration(const ObjCMethodDecl *MD)
Objective-C methods are C functions with some implicit parameters.
Definition: CGCall.cpp:471
clang::CXXCtorType
CXXCtorType
C++ constructor types.
Definition: ABI.h:24
clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo
const CGFunctionInfo & arrangeLLVMFunctionInfo(CanQualType returnType, bool instanceMethod, bool chainCall, ArrayRef< CanQualType > argTypes, FunctionType::ExtInfo info, ArrayRef< FunctionProtoType::ExtParameterInfo > paramInfos, RequiredArgs args)
"Arrange" the LLVM information for a call or type with the given signature.
Definition: CGCall.cpp:750
clang::CodeGen::CodeGenTypes::isRecordLayoutComplete
bool isRecordLayoutComplete(const Type *Ty) const
isRecordLayoutComplete - Return true if the specified type is already completely laid out.
Definition: CodeGenTypes.cpp:122
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:208
CGFunctionInfo.h
clang::CanQualType
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
Definition: CanonicalType.h:212
clang::CodeGen::CGRecordLayout
CGRecordLayout - This class handles struct and union layout info while lowering AST types to LLVM typ...
Definition: CGRecordLayout.h:121
clang::CodeGen::CodeGenTypes::GetFunctionTypeForVTable
llvm::Type * GetFunctionTypeForVTable(GlobalDecl GD)
GetFunctionTypeForVTable - Get the LLVM function type for use in a vtable, given a CXXMethodDecl.
Definition: CGCall.cpp:1747
clang::CodeGen::CodeGenTypes::~CodeGenTypes
~CodeGenTypes()
Definition: CodeGenTypes.cpp:39
clang::CallingConv
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition: Specifiers.h:263
clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration
const CGFunctionInfo & arrangeCXXMethodDeclaration(const CXXMethodDecl *MD)
C++ methods have some special rules and also have implicit parameters.
Definition: CGCall.cpp:292
clang::TagDecl
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3355
clang::CodeGen::CodeGenTypes::ClangCallConvToLLVMCallConv
unsigned ClangCallConvToLLVMCallConv(CallingConv CC)
Convert clang calling convention to LLVM callilng convention.
Definition: CGCall.cpp:48
clang::CodeGen::CodeGenTypes::inheritingCtorHasParams
bool inheritingCtorHasParams(const InheritedConstructor &Inherited, CXXCtorType Type)
Determine if a C++ inheriting constructor should have parameters matching those of its inherited cons...
Definition: CGCall.cpp:309
clang::CanQual< Type >
clang::CodeGen::CodeGenTypes::UpdateCompletedType
void UpdateCompletedType(const TagDecl *TD)
UpdateCompletedType - When we find the full definition for a TagDecl, replace the 'opaque' type we pr...
Definition: CodeGenTypes.cpp:263
clang::CodeGenOptions
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
Definition: CodeGenOptions.h:49
clang::CodeGen::CodeGenTypes::isPointerZeroInitializable
bool isPointerZeroInitializable(QualType T)
Check if the pointer type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
Definition: CodeGenTypes.cpp:925
clang::CodeGen::CodeGenTypes::isFuncTypeConvertible
bool isFuncTypeConvertible(const FunctionType *FT)
isFuncTypeConvertible - Utility to check whether a function type can be converted to an LLVM type (i....
Definition: CodeGenTypes.cpp:249
clang::CodeGen::CodeGenTypes::getCGRecordLayout
const CGRecordLayout & getCGRecordLayout(const RecordDecl *)
getCGRecordLayout - Return record layout info for the given record decl.
Definition: CodeGenTypes.cpp:908
clang::CodeGen::CodeGenTypes::GetFunctionType
llvm::FunctionType * GetFunctionType(const CGFunctionInfo &Info)
GetFunctionType - Get the LLVM function type for.
Definition: CGCall.cpp:1613
clang::CodeGen::CodeGenTypes::arrangeCXXMethodCall
const CGFunctionInfo & arrangeCXXMethodCall(const CallArgList &args, const FunctionProtoType *type, RequiredArgs required, unsigned numPrefixArgs)
Arrange a call to a C++ method, passing the given arguments.
Definition: CGCall.cpp:688
clang::CXXRecordDecl
Represents a C++ struct/union/class.
Definition: DeclCXX.h:254
clang::CodeGen::CodeGenTypes::arrangeCXXMethodType
const CGFunctionInfo & arrangeCXXMethodType(const CXXRecordDecl *RD, const FunctionProtoType *FTP, const CXXMethodDecl *MD)
Arrange the argument and result information for a call to an unknown C++ non-static member function o...
Definition: CGCall.cpp:264
clang::CodeGen::CodeGenTypes::DeriveThisType
CanQualType DeriveThisType(const CXXRecordDecl *RD, const CXXMethodDecl *MD)
Derives the 'this' type for codegen purposes, i.e.
Definition: CGCall.cpp:80
clang::CodeGen::CodeGenTypes::arrangeUnprototypedMustTailThunk
const CGFunctionInfo & arrangeUnprototypedMustTailThunk(const CXXMethodDecl *MD)
Arrange a thunk that takes 'this' as the first parameter followed by varargs.
Definition: CGCall.cpp:543
clang::CodeGen::RequiredArgs
A class for recording the number of arguments that a function signature requires.
Definition: CGFunctionInfo.h:480
clang::FunctionProtoType
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3956
clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration
const CGFunctionInfo & arrangeCXXStructorDeclaration(GlobalDecl GD)
Definition: CGCall.cpp:319
clang::CodeGen::CodeGenModule
This class organizes the cross-function state that is used while generating LLVM code.
Definition: CodeGenModule.h:275
clang::CodeGen::CodeGenTypes::CodeGenTypes
CodeGenTypes(CodeGenModule &cgm)
Definition: CodeGenTypes.cpp:32
llvm::ArrayRef
Definition: LLVM.h:34
clang::CodeGen::FunctionArgList
FunctionArgList - Type for representing both the decl and type of parameters to a function.
Definition: CGCall.h:356
clang::CodeGen::CodeGenTypes
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
Definition: CodeGenTypes.h:54
clang::FunctionType::ExtInfo
A class which abstracts out some details necessary for making a call.
Definition: Type.h:3729
clang::CodeGen::CGFunctionInfo
CGFunctionInfo - Class to encapsulate the information about a function definition.
Definition: CGFunctionInfo.h:546
clang::ObjCMethodDecl
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:139
clang::CodeGen::CodeGenTypes::arrangeMSCtorClosure
const CGFunctionInfo & arrangeMSCtorClosure(const CXXConstructorDecl *CD, CXXCtorType CT)
Definition: CGCall.cpp:553
clang::CodeGen::CodeGenTypes::getCXXABI
CGCXXABI & getCXXABI() const
Definition: CodeGenTypes.h:115
clang::CodeGen::CodeGenTypes::isRecordBeingLaidOut
bool isRecordBeingLaidOut(const Type *Ty) const
Definition: CodeGenTypes.h:305
clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration
const CGFunctionInfo & arrangeGlobalDeclaration(GlobalDecl GD)
Definition: CGCall.cpp:526
clang
Definition: CalledOnceCheck.h:17
clang::CodeGen::CodeGenTypes::arrangeFreeFunctionCall
const CGFunctionInfo & arrangeFreeFunctionCall(const CallArgList &Args, const FunctionType *Ty, bool ChainCall)
Figure out the rules for calling a function with the given formal type using the given arguments.
Definition: CGCall.cpp:624
clang::CodeGen::CodeGenTypes::addRecordTypeName
void addRecordTypeName(const RecordDecl *RD, llvm::StructType *Ty, StringRef suffix)
addRecordTypeName - Compute a name from the given record decl with an optional suffix and name the gi...
Definition: CodeGenTypes.cpp:49
clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration
const CGFunctionInfo & arrangeFunctionDeclaration(const FunctionDecl *FD)
Free functions are functions that are compatible with an ordinary C function pointer type.
Definition: CGCall.cpp:447
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType
llvm::StructType * ConvertRecordDeclType(const RecordDecl *TD)
ConvertRecordDeclType - Lay out a tagged decl type like struct or union.
Definition: CodeGenTypes.cpp:844
clang::CodeGen::CodeGenTypes::getDataLayout
const llvm::DataLayout & getDataLayout() const
Definition: CodeGenTypes.h:109
clang::CodeGen::CodeGenTypes::arrangeFreeFunctionType
const CGFunctionInfo & arrangeFreeFunctionType(CanQual< FunctionProtoType > Ty)
Arrange the argument and result information for a value of the given freestanding function type.
Definition: CGCall.cpp:200
clang::CodeGen::CodeGenTypes::arrangeCall
const CGFunctionInfo & arrangeCall(const CGFunctionInfo &declFI, const CallArgList &args)
Given a function info for a declaration, return the function info for a call with the given arguments...
Definition: CGCall.cpp:715
clang::CodeGen::CGCXXABI
Implements C++ ABI-specific code generation functions.
Definition: CGCXXABI.h:43
clang::CodeGen::CodeGenTypes::isZeroInitializable
bool isZeroInitializable(QualType T)
IsZeroInitializable - Return whether a type can be zero-initialized (in the C++ sense) with an LLVM z...
Definition: CodeGenTypes.cpp:930
clang::InheritedConstructor
Description of a constructor that was inherited from a base class.
Definition: DeclCXX.h:2408
clang::CodeGen::CodeGenTypes::ComputeRecordLayout
std::unique_ptr< CGRecordLayout > ComputeRecordLayout(const RecordDecl *D, llvm::StructType *Ty)
Compute a new LLVM record layout object for the given record.
Definition: CGRecordLayoutBuilder.cpp:878
llvm::SmallVectorImpl
Definition: Randstruct.h:18
clang::CodeGen::CallArgList
CallArgList - Type for representing both the value and type of arguments in a call.
Definition: CGCall.h:262
clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall
const CGFunctionInfo & arrangeCXXConstructorCall(const CallArgList &Args, const CXXConstructorDecl *D, CXXCtorType CtorKind, unsigned ExtraPrefixArgs, unsigned ExtraSuffixArgs, bool PassProtoArgs=true)
Arrange a call to a C++ method, passing the given arguments.
Definition: CGCall.cpp:403
clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionCall
const CGFunctionInfo & arrangeBuiltinFunctionCall(QualType resultType, const CallArgList &args)
Definition: CGCall.cpp:653
clang::FunctionDecl
Represents a function declaration or definition.
Definition: Decl.h:1872
clang::RecordDecl
Represents a struct/union/class.
Definition: Decl.h:3908
clang::CodeGen::CodeGenTypes::getExpandedTypes
void getExpandedTypes(QualType Ty, SmallVectorImpl< llvm::Type * >::iterator &TI)
getExpandedTypes - Expand the type
Definition: CGCall.cpp:994
clang::CodeGen::CodeGenTypes::arrangeNullaryFunction
const CGFunctionInfo & arrangeNullaryFunction()
A nullary function is a freestanding function of type 'void ()'.
Definition: CGCall.cpp:708
clang::CodeGen::ABIInfo
ABIInfo - Target specific hooks for defining how a type should be passed or returned from functions.
Definition: ABIInfo.h:50
clang::CXXMethodDecl
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:1981
Type
MatchType Type
Definition: ASTMatchFinder.cpp:71