clang  14.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 CXXDestructorDecl;
35 class CXXMethodDecl;
36 class CodeGenOptions;
37 class FieldDecl;
38 class FunctionProtoType;
39 class ObjCInterfaceDecl;
40 class ObjCIvarDecl;
41 class PointerType;
42 class QualType;
43 class RecordDecl;
44 class TagDecl;
45 class TargetInfo;
46 class Type;
47 typedef CanQual<Type> CanQualType;
48 class GlobalDecl;
49 
50 namespace CodeGen {
51 class ABIInfo;
52 class CGCXXABI;
53 class CGRecordLayout;
54 class CodeGenModule;
55 class RequiredArgs;
56 
57 /// This class organizes the cross-module state that is used while lowering
58 /// AST types to LLVM types.
59 class CodeGenTypes {
60  CodeGenModule &CGM;
61  // Some of this stuff should probably be left on the CGM.
62  ASTContext &Context;
63  llvm::Module &TheModule;
64  const TargetInfo &Target;
65  CGCXXABI &TheCXXABI;
66 
67  // This should not be moved earlier, since its initialization depends on some
68  // of the previous reference members being already initialized
69  const ABIInfo &TheABIInfo;
70 
71  /// The opaque type map for Objective-C interfaces. All direct
72  /// manipulation is done by the runtime interfaces, which are
73  /// responsible for coercing to the appropriate type; these opaque
74  /// types are never refined.
75  llvm::DenseMap<const ObjCInterfaceType*, llvm::Type *> InterfaceTypes;
76 
77  /// Maps clang struct type with corresponding record layout info.
78  llvm::DenseMap<const Type*, std::unique_ptr<CGRecordLayout>> CGRecordLayouts;
79 
80  /// Contains the LLVM IR type for any converted RecordDecl.
81  llvm::DenseMap<const Type*, llvm::StructType *> RecordDeclTypes;
82 
83  /// Hold memoized CGFunctionInfo results.
84  llvm::FoldingSet<CGFunctionInfo> FunctionInfos;
85 
86  /// This set keeps track of records that we're currently converting
87  /// to an IR type. For example, when converting:
88  /// struct A { struct B { int x; } } when processing 'x', the 'A' and 'B'
89  /// types will be in this set.
90  llvm::SmallPtrSet<const Type*, 4> RecordsBeingLaidOut;
91 
92  llvm::SmallPtrSet<const CGFunctionInfo*, 4> FunctionsBeingProcessed;
93 
94  /// True if we didn't layout a function due to a being inside
95  /// a recursive struct conversion, set this to true.
96  bool SkippedLayout;
97 
98  SmallVector<const RecordDecl *, 8> DeferredRecords;
99 
100  /// This map keeps cache of llvm::Types and maps clang::Type to
101  /// corresponding llvm::Type.
102  llvm::DenseMap<const Type *, llvm::Type *> TypeCache;
103 
104  llvm::SmallSet<const Type *, 8> RecordsWithOpaqueMemberPointers;
105 
106  /// Helper for ConvertType.
107  llvm::Type *ConvertFunctionTypeInternal(QualType FT);
108 
109 public:
111  ~CodeGenTypes();
112 
113  const llvm::DataLayout &getDataLayout() const {
114  return TheModule.getDataLayout();
115  }
116  ASTContext &getContext() const { return Context; }
117  const ABIInfo &getABIInfo() const { return TheABIInfo; }
118  const TargetInfo &getTarget() const { return Target; }
119  CGCXXABI &getCXXABI() const { return TheCXXABI; }
120  llvm::LLVMContext &getLLVMContext() { return TheModule.getContext(); }
121  const CodeGenOptions &getCodeGenOpts() const;
122 
123  /// Convert clang calling convention to LLVM callilng convention.
125 
126  /// Derives the 'this' type for codegen purposes, i.e. ignoring method CVR
127  /// qualification.
129 
130  /// ConvertType - Convert type T into a llvm::Type.
131  llvm::Type *ConvertType(QualType T);
132 
133  /// ConvertTypeForMem - Convert type T into a llvm::Type. This differs from
134  /// ConvertType in that it is used to convert to the memory representation for
135  /// a type. For example, the scalar representation for _Bool is i1, but the
136  /// memory representation is usually i8 or i32, depending on the target.
137  llvm::Type *ConvertTypeForMem(QualType T, bool ForBitField = false);
138 
139  /// GetFunctionType - Get the LLVM function type for \arg Info.
140  llvm::FunctionType *GetFunctionType(const CGFunctionInfo &Info);
141 
142  llvm::FunctionType *GetFunctionType(GlobalDecl GD);
143 
144  /// isFuncTypeConvertible - Utility to check whether a function type can
145  /// be converted to an LLVM type (i.e. doesn't depend on an incomplete tag
146  /// type).
147  bool isFuncTypeConvertible(const FunctionType *FT);
149 
150  /// Determine if a C++ inheriting constructor should have parameters matching
151  /// those of its inherited constructor.
152  bool inheritingCtorHasParams(const InheritedConstructor &Inherited,
153  CXXCtorType Type);
154 
155  /// GetFunctionTypeForVTable - Get the LLVM function type for use in a vtable,
156  /// given a CXXMethodDecl. If the method to has an incomplete return type,
157  /// and/or incomplete argument types, this will return the opaque type.
158  llvm::Type *GetFunctionTypeForVTable(GlobalDecl GD);
159 
161 
162  /// UpdateCompletedType - When we find the full definition for a TagDecl,
163  /// replace the 'opaque' type we previously made for it if applicable.
164  void UpdateCompletedType(const TagDecl *TD);
165 
166  /// Remove stale types from the type cache when an inheritance model
167  /// gets assigned to a class.
168  void RefreshTypeCacheForClass(const CXXRecordDecl *RD);
169 
170  // The arrangement methods are split into three families:
171  // - those meant to drive the signature and prologue/epilogue
172  // of a function declaration or definition,
173  // - those meant for the computation of the LLVM type for an abstract
174  // appearance of a function, and
175  // - those meant for performing the IR-generation of a call.
176  // They differ mainly in how they deal with optional (i.e. variadic)
177  // arguments, as well as unprototyped functions.
178  //
179  // Key points:
180  // - The CGFunctionInfo for emitting a specific call site must include
181  // entries for the optional arguments.
182  // - The function type used at the call site must reflect the formal
183  // signature of the declaration being called, or else the call will
184  // go awry.
185  // - For the most part, unprototyped functions are called by casting to
186  // a formal signature inferred from the specific argument types used
187  // at the call-site. However, some targets (e.g. x86-64) screw with
188  // this for compatibility reasons.
189 
191 
192  /// Given a function info for a declaration, return the function info
193  /// for a call with the given arguments.
194  ///
195  /// Often this will be able to simply return the declaration info.
196  const CGFunctionInfo &arrangeCall(const CGFunctionInfo &declFI,
197  const CallArgList &args);
198 
199  /// Free functions are functions that are compatible with an ordinary
200  /// C function pointer type.
203  const FunctionType *Ty,
204  bool ChainCall);
207 
208  /// A nullary function is a freestanding function of type 'void ()'.
209  /// This method works for both calls and declarations.
211 
212  /// A builtin function is a freestanding function using the default
213  /// C conventions.
214  const CGFunctionInfo &
216  const FunctionArgList &args);
217  const CGFunctionInfo &
219  ArrayRef<CanQualType> argTypes);
221  const CallArgList &args);
222 
223  /// Objective-C methods are C functions with some implicit parameters.
226  QualType receiverType);
228  QualType returnType,
229  const CallArgList &args);
230 
231  /// Block invocation functions are C functions with an implicit parameter.
233  const FunctionProtoType *type,
234  const FunctionArgList &args);
236  const FunctionType *type);
237 
238  /// C++ methods have some special rules and also have implicit parameters.
242  const CXXConstructorDecl *D,
243  CXXCtorType CtorKind,
244  unsigned ExtraPrefixArgs,
245  unsigned ExtraSuffixArgs,
246  bool PassProtoArgs = true);
247 
249  const FunctionProtoType *type,
250  RequiredArgs required,
251  unsigned numPrefixArgs);
252  const CGFunctionInfo &
255  CXXCtorType CT);
257  const FunctionProtoType *FTP,
258  const CXXMethodDecl *MD);
259 
260  /// "Arrange" the LLVM information for a call or type with the given
261  /// signature. This is largely an internal method; other clients
262  /// should use one of the above routines, which ultimately defer to
263  /// this.
264  ///
265  /// \param argTypes - must all actually be canonical as params
267  bool instanceMethod,
268  bool chainCall,
269  ArrayRef<CanQualType> argTypes,
272  RequiredArgs args);
273 
274  /// Compute a new LLVM record layout object for the given record.
275  std::unique_ptr<CGRecordLayout> ComputeRecordLayout(const RecordDecl *D,
276  llvm::StructType *Ty);
277 
278  /// addRecordTypeName - Compute a name from the given record decl with an
279  /// optional suffix and name the given LLVM type using it.
280  void addRecordTypeName(const RecordDecl *RD, llvm::StructType *Ty,
281  StringRef suffix);
282 
283 
284 public: // These are internal details of CGT that shouldn't be used externally.
285  /// ConvertRecordDeclType - Lay out a tagged decl type like struct or union.
286  llvm::StructType *ConvertRecordDeclType(const RecordDecl *TD);
287 
288  /// getExpandedTypes - Expand the type \arg Ty into the LLVM
289  /// argument types it would be passed as. See ABIArgInfo::Expand.
290  void getExpandedTypes(QualType Ty,
292 
293  /// IsZeroInitializable - Return whether a type can be
294  /// zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
296 
297  /// Check if the pointer type can be zero-initialized (in the C++ sense)
298  /// with an LLVM zeroinitializer.
300 
301  /// IsZeroInitializable - Return whether a record type can be
302  /// zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
303  bool isZeroInitializable(const RecordDecl *RD);
304 
305  bool isRecordLayoutComplete(const Type *Ty) const;
306  bool noRecordsBeingLaidOut() const {
307  return RecordsBeingLaidOut.empty();
308  }
309  bool isRecordBeingLaidOut(const Type *Ty) const {
310  return RecordsBeingLaidOut.count(Ty);
311  }
312 
313 };
314 
315 } // end namespace CodeGen
316 } // end namespace clang
317 
318 #endif
clang::CodeGen::CodeGenTypes::getContext
ASTContext & getContext() const
Definition: CodeGenTypes.h:116
clang::CodeGen::CodeGenTypes::getTarget
const TargetInfo & getTarget() const
Definition: CodeGenTypes.h:118
llvm
Definition: Dominators.h:30
clang::CXXConstructorDecl
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2401
clang::CodeGen::CodeGenTypes::noRecordsBeingLaidOut
bool noRecordsBeingLaidOut() const
Definition: CodeGenTypes.h:306
type
clang::CodeGen::CodeGenTypes::getABIInfo
const ABIInfo & getABIInfo() const
Definition: CodeGenTypes.h:117
clang::CodeGen::CodeGenTypes::arrangeUnprototypedObjCMessageSend
const CGFunctionInfo & arrangeUnprototypedObjCMessageSend(QualType returnType, const CallArgList &args)
Definition: CGCall.cpp:506
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:290
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:625
clang::MultiVersionKind::Target
@ Target
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:673
clang::CodeGen::CodeGenTypes::getCodeGenOpts
const CodeGenOptions & getCodeGenOpts() const
Definition: CodeGenTypes.cpp:44
clang::TargetInfo
Exposes information about the current target.
Definition: TargetInfo.h:189
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:657
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:206
clang::CodeGen::CodeGenTypes::getLLVMContext
llvm::LLVMContext & getLLVMContext()
Definition: CodeGenTypes.h:120
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:475
clang::FunctionType
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3546
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:632
clang::CodeGen::CodeGenTypes::ConvertType
llvm::Type * ConvertType(QualType T)
ConvertType - Convert type T into a llvm::Type.
Definition: CodeGenTypes.cpp:395
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1490
ABI.h
clang::GlobalDecl
GlobalDecl - represents a global declaration.
Definition: GlobalDecl.h:55
clang::CodeGen::CodeGenTypes::ConvertTypeForMem
llvm::Type * ConvertTypeForMem(QualType T, bool ForBitField=false)
ConvertTypeForMem - Convert type T into a llvm::Type.
Definition: CodeGenTypes.cpp:90
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:462
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:741
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:113
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:212
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:1729
clang::CodeGen::CodeGenTypes::~CodeGenTypes
~CodeGenTypes()
Definition: CodeGenTypes.cpp:38
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:283
clang::TagDecl
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3328
clang::CodeGen::CodeGenTypes::ClangCallConvToLLVMCallConv
unsigned ClangCallConvToLLVMCallConv(CallingConv CC)
Convert clang calling convention to LLVM callilng convention.
Definition: CGCall.cpp:47
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:300
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:254
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:892
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:240
clang::CodeGen::CodeGenTypes::getCGRecordLayout
const CGRecordLayout & getCGRecordLayout(const RecordDecl *)
getCGRecordLayout - Return record layout info for the given record decl.
Definition: CodeGenTypes.cpp:875
clang::CodeGen::CodeGenTypes::GetFunctionType
llvm::FunctionType * GetFunctionType(const CGFunctionInfo &Info)
GetFunctionType - Get the LLVM function type for.
Definition: CGCall.cpp:1595
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:679
clang::CXXRecordDecl
Represents a C++ struct/union/class.
Definition: DeclCXX.h:255
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:255
clang::CodeGen::CodeGenTypes::DeriveThisType
CanQualType DeriveThisType(const CXXRecordDecl *RD, const CXXMethodDecl *MD)
Derives the 'this' type for codegen purposes, i.e.
Definition: CGCall.cpp:77
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:534
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:3885
clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration
const CGFunctionInfo & arrangeCXXStructorDeclaration(GlobalDecl GD)
Definition: CGCall.cpp:310
clang::CodeGen::CodeGenModule
This class organizes the cross-function state that is used while generating LLVM code.
Definition: CodeGenModule.h:284
clang::CodeGen::CodeGenTypes::CodeGenTypes
CodeGenTypes(CodeGenModule &cgm)
Definition: CodeGenTypes.cpp:31
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:358
clang::CodeGen::CodeGenTypes
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
Definition: CodeGenTypes.h:59
clang::FunctionType::ExtInfo
A class which abstracts out some details necessary for making a call.
Definition: Type.h:3657
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:544
clang::CodeGen::CodeGenTypes::getCXXABI
CGCXXABI & getCXXABI() const
Definition: CodeGenTypes.h:119
clang::CodeGen::CodeGenTypes::isRecordBeingLaidOut
bool isRecordBeingLaidOut(const Type *Ty) const
Definition: CodeGenTypes.h:309
clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration
const CGFunctionInfo & arrangeGlobalDeclaration(GlobalDecl GD)
Definition: CGCall.cpp:517
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:615
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:48
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:438
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType
llvm::StructType * ConvertRecordDeclType(const RecordDecl *TD)
ConvertRecordDeclType - Lay out a tagged decl type like struct or union.
Definition: CodeGenTypes.cpp:811
clang::CodeGen::CodeGenTypes::getDataLayout
const llvm::DataLayout & getDataLayout() const
Definition: CodeGenTypes.h:113
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:197
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:706
clang::CodeGen::CGCXXABI
Implements C++ ABI-specific code generation functions.
Definition: CGCXXABI.h:44
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:897
clang::InheritedConstructor
Description of a constructor that was inherited from a base class.
Definition: DeclCXX.h:2375
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: LLVM.h:39
clang::CodeGen::CallArgList
CallArgList - Type for representing both the value and type of arguments in a call.
Definition: CGCall.h:264
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:394
clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionCall
const CGFunctionInfo & arrangeBuiltinFunctionCall(QualType resultType, const CallArgList &args)
Definition: CGCall.cpp:644
clang::FunctionDecl
Represents a function declaration or definition.
Definition: Decl.h:1856
clang::RecordDecl
Represents a struct/union/class.
Definition: Decl.h:3859
clang::CodeGen::CodeGenTypes::getExpandedTypes
void getExpandedTypes(QualType Ty, SmallVectorImpl< llvm::Type * >::iterator &TI)
getExpandedTypes - Expand the type
Definition: CGCall.cpp:985
clang::CodeGen::CodeGenTypes::arrangeNullaryFunction
const CGFunctionInfo & arrangeNullaryFunction()
A nullary function is a freestanding function of type 'void ()'.
Definition: CGCall.cpp:699
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:1948
Type
MatchType Type
Definition: ASTMatchFinder.cpp:70