14 #ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENTYPES_H 15 #define LLVM_CLANG_LIB_CODEGEN_CODEGENTYPES_H 21 #include "llvm/ADT/DenseMap.h" 22 #include "llvm/IR/Module.h" 34 template <
typename>
class CanQual;
35 class CXXConstructorDecl;
36 class CXXDestructorDecl;
40 class FunctionProtoType;
41 class ObjCInterfaceDecl;
67 case StructorType::Complete:
69 case StructorType::Base:
71 case StructorType::Deleting:
72 llvm_unreachable(
"cannot have a deleting ctor");
74 llvm_unreachable(
"not a StructorType");
80 return StructorType::Complete;
82 return StructorType::Base;
84 llvm_unreachable(
"not expecting a COMDAT");
87 llvm_unreachable(
"not expecting a closure");
89 llvm_unreachable(
"not a CXXCtorType");
94 case StructorType::Complete:
96 case StructorType::Base:
98 case StructorType::Deleting:
101 llvm_unreachable(
"not a StructorType");
107 return StructorType::Deleting;
109 return StructorType::Complete;
111 return StructorType::Base;
113 llvm_unreachable(
"not expecting a COMDAT");
115 llvm_unreachable(
"not a CXXDtorType");
124 llvm::Module &TheModule;
136 llvm::DenseMap<const ObjCInterfaceType*, llvm::Type *> InterfaceTypes;
139 llvm::DenseMap<const Type*, CGRecordLayout *> CGRecordLayouts;
142 llvm::DenseMap<const Type*, llvm::StructType *> RecordDeclTypes;
145 llvm::FoldingSet<CGFunctionInfo> FunctionInfos;
151 llvm::SmallPtrSet<const Type*, 4> RecordsBeingLaidOut;
153 llvm::SmallPtrSet<const CGFunctionInfo*, 4> FunctionsBeingProcessed;
163 llvm::DenseMap<const Type *, llvm::Type *> TypeCache;
165 llvm::SmallSet<const Type *, 8> RecordsWithOpaqueMemberPointers;
172 return TheModule.getDataLayout();
182 unsigned ClangCallConvToLLVMCallConv(
CallingConv CC);
185 llvm::Type *ConvertType(
QualType T);
192 llvm::Type *ConvertFunctionType(
QualType FT,
199 llvm::Type *ConvertTypeForMem(
QualType T);
204 llvm::FunctionType *GetFunctionType(
GlobalDecl GD);
210 bool isFuncParamTypeConvertible(
QualType Ty);
220 llvm::Type *GetFunctionTypeForVTable(
GlobalDecl GD);
226 void UpdateCompletedType(
const TagDecl *TD);
278 arrangeBuiltinFunctionDeclaration(
QualType resultType,
281 arrangeBuiltinFunctionDeclaration(CanQualType resultType,
308 unsigned ExtraPrefixArgs,
309 unsigned ExtraSuffixArgs,
310 bool PassProtoArgs =
true);
315 unsigned numPrefixArgs);
340 llvm::StructType *Ty);
344 void addRecordTypeName(
const RecordDecl *RD, llvm::StructType *Ty,
350 llvm::StructType *ConvertRecordDeclType(
const RecordDecl *TD);
359 bool isZeroInitializable(
QualType T);
363 bool isPointerZeroInitializable(
QualType T);
367 bool isZeroInitializable(
const RecordDecl *RD);
369 bool isRecordLayoutComplete(
const Type *Ty)
const;
371 return RecordsBeingLaidOut.empty();
374 return RecordsBeingLaidOut.count(Ty);
bool noRecordsBeingLaidOut() const
CGCXXABI & getCXXABI() const
Represents a function declaration or definition.
A (possibly-)qualified type.
CGRecordLayout - This class handles struct and union layout info while lowering AST types to LLVM typ...
The COMDAT used for ctors.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
const ABIInfo & getABIInfo() const
FunctionType - C99 6.7.5.3 - Function Declarators.
bool isRecordBeingLaidOut(const Type *Ty) const
const llvm::DataLayout & getDataLayout() const
The base class of the type hierarchy.
Represents a C++ constructor within a class.
Default closure variant of a ctor.
ObjCMethodDecl - Represents an instance or class method declaration.
const CGFunctionInfo & arrangeCXXMethodType(CodeGenModule &CGM, const CXXRecordDecl *RD, const FunctionProtoType *FTP, const CXXMethodDecl *MD)
Represents a struct/union/class.
Description of a constructor that was inherited from a base class.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
StructorType getFromDtorType(CXXDtorType T)
const CGFunctionInfo & arrangeFreeFunctionType(CodeGenModule &CGM, CanQual< FunctionProtoType > Ty, const FunctionDecl *FD)
Enums/classes describing ABI related information about constructors, destructors and thunks...
const CGFunctionInfo & arrangeObjCMessageSendSignature(CodeGenModule &CGM, const ObjCMethodDecl *MD, QualType receiverType)
Represents a prototype with parameter type info, e.g.
Exposes information about the current target.
CXXDtorType
C++ destructor types.
A class for recording the number of arguments that a function signature requires. ...
The COMDAT used for dtors.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
GlobalDecl - represents a global declaration.
Represents the declaration of a struct/union/class/enum.
Represents a static or instance method of a struct/union/class.
const CGFunctionInfo & arrangeFreeFunctionCall(CodeGenModule &CGM, CanQualType returnType, ArrayRef< CanQualType > argTypes, FunctionType::ExtInfo info, RequiredArgs args)
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
llvm::LLVMContext & getLLVMContext()
CXXCtorType
C++ constructor types.
FunctionArgList - Type for representing both the decl and type of parameters to a function...
const TargetInfo & getTarget() const
CGFunctionInfo - Class to encapsulate the information about a function definition.
This class organizes the cross-function state that is used while generating LLVM code.
Dataflow Directional Tag Classes.
CXXDtorType toCXXDtorType(StructorType T)
static const CGFunctionInfo & arrangeLLVMFunctionInfo(CodeGenTypes &CGT, bool instanceMethod, SmallVectorImpl< CanQualType > &prefix, CanQual< FunctionProtoType > FTP, const FunctionDecl *FD)
Arrange the LLVM function layout for a value of the given function type, on top of any implicit param...
StructorType getFromCtorType(CXXCtorType T)
Implements C++ ABI-specific code generation functions.
This class organizes the cross-module state that is used while lowering AST types to LLVM types...
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
ASTContext & getContext() const
Represents a C++ struct/union/class.
Copying closure variant of a ctor.
ABIInfo - Target specific hooks for defining how a type should be passed or returned from functions...
CXXCtorType toCXXCtorType(StructorType T)
CallArgList - Type for representing both the value and type of arguments in a call.
A class which abstracts out some details necessary for making a call.