14 #ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENTYPES_H
15 #define LLVM_CLANG_LIB_CODEGEN_CODEGENTYPES_H
20 #include "llvm/ADT/DenseMap.h"
21 #include "llvm/IR/Module.h"
36 template <
typename>
class CanQual;
37 class CXXConstructorDecl;
38 class CXXDestructorDecl;
42 class FunctionProtoType;
43 class ObjCInterfaceDecl;
72 llvm_unreachable(
"cannot have a deleting ctor");
74 llvm_unreachable(
"not a StructorType");
84 llvm_unreachable(
"not expecting a COMDAT");
87 llvm_unreachable(
"not expecting a closure");
89 llvm_unreachable(
"not a CXXCtorType");
101 llvm_unreachable(
"not a StructorType");
113 llvm_unreachable(
"not expecting a COMDAT");
115 llvm_unreachable(
"not a CXXDtorType");
124 llvm::Module &TheModule;
125 const llvm::DataLayout &TheDataLayout;
137 llvm::DenseMap<const ObjCInterfaceType*, llvm::Type *> InterfaceTypes;
140 llvm::DenseMap<const Type*, CGRecordLayout *> CGRecordLayouts;
143 llvm::DenseMap<const Type*, llvm::StructType *> RecordDeclTypes;
146 llvm::FoldingSet<CGFunctionInfo> FunctionInfos;
152 llvm::SmallPtrSet<const Type*, 4> RecordsBeingLaidOut;
154 llvm::SmallPtrSet<const CGFunctionInfo*, 4> FunctionsBeingProcessed;
165 llvm::DenseMap<const Type *, llvm::Type *> TypeCache;
288 llvm::StructType *Ty);
315 return RecordsBeingLaidOut.empty();
318 return RecordsBeingLaidOut.count(Ty);
void getExpandedTypes(QualType Ty, SmallVectorImpl< llvm::Type * >::iterator &TI)
void UpdateCompletedType(const TagDecl *TD)
The COMDAT used for ctors.
void addRecordTypeName(const RecordDecl *RD, llvm::StructType *Ty, StringRef suffix)
CGCXXABI & getCXXABI() const
ASTContext & getContext() const
bool isFuncTypeConvertible(const FunctionType *FT)
const CGFunctionInfo & arrangeFreeFunctionDeclaration(QualType ResTy, const FunctionArgList &Args, const FunctionType::ExtInfo &Info, bool isVariadic)
Represents a C++ constructor within a class.
Default closure variant of a ctor.
const CGFunctionInfo & arrangeCXXStructorDeclaration(const CXXMethodDecl *MD, StructorType Type)
llvm::Type * ConvertTypeForMem(QualType T)
const CGFunctionInfo & arrangeFreeFunctionType(CanQual< FunctionProtoType > Ty)
llvm::Type * ConvertType(QualType T)
ConvertType - Convert type T into a llvm::Type.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
StructorType getFromDtorType(CXXDtorType T)
const CGFunctionInfo & arrangeLLVMFunctionInfo(CanQualType returnType, bool instanceMethod, bool chainCall, ArrayRef< CanQualType > argTypes, FunctionType::ExtInfo info, RequiredArgs args)
const CGFunctionInfo & arrangeObjCMessageSendSignature(const ObjCMethodDecl *MD, QualType receiverType)
const CGFunctionInfo & arrangeCXXMethodDeclaration(const CXXMethodDecl *MD)
const CGFunctionInfo & arrangeGlobalDeclaration(GlobalDecl GD)
Exposes information about the current target.
CXXDtorType
C++ destructor types.
CodeGenTypes(CodeGenModule &cgm)
const CGFunctionInfo & arrangeNullaryFunction()
The COMDAT used for dtors.
const llvm::DataLayout & getDataLayout() const
TagDecl - Represents the declaration of a struct/union/class/enum.
const CGFunctionInfo & arrangeObjCMethodDeclaration(const ObjCMethodDecl *MD)
Represents a static or instance method of a struct/union/class.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
llvm::LLVMContext & getLLVMContext()
const CGFunctionInfo & arrangeCXXMethodCall(const CallArgList &args, const FunctionProtoType *type, RequiredArgs required)
Arrange a call to a C++ method, passing the given arguments.
CXXCtorType
C++ constructor types.
const CGFunctionInfo & arrangeCXXMethodType(const CXXRecordDecl *RD, const FunctionProtoType *FTP)
const CGFunctionInfo & arrangeBlockFunctionCall(const CallArgList &args, const FunctionType *type)
bool isRecordBeingLaidOut(const Type *Ty) const
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
CXXDtorType toCXXDtorType(StructorType T)
const CGFunctionInfo & arrangeFunctionDeclaration(const FunctionDecl *FD)
llvm::StructType * ConvertRecordDeclType(const RecordDecl *TD)
ConvertRecordDeclType - Lay out a tagged decl type like struct or union.
StructorType getFromCtorType(CXXCtorType T)
Implements C++ ABI-specific code generation functions.
const CGFunctionInfo & arrangeMSMemberPointerThunk(const CXXMethodDecl *MD)
bool isRecordLayoutComplete(const Type *Ty) const
llvm::Type * GetFunctionTypeForVTable(GlobalDecl GD)
Represents a C++ struct/union/class.
bool isFuncParamTypeConvertible(QualType Ty)
const TargetInfo & getTarget() const
Copying closure variant of a ctor.
const CGFunctionInfo & arrangeMSCtorClosure(const CXXConstructorDecl *CD, CXXCtorType CT)
const ABIInfo & getABIInfo() const
const CGFunctionInfo & arrangeFreeFunctionCall(const CallArgList &Args, const FunctionType *Ty, bool ChainCall)
CXXCtorType toCXXCtorType(StructorType T)
CGRecordLayout * ComputeRecordLayout(const RecordDecl *D, llvm::StructType *Ty)
Compute a new LLVM record layout object for the given record.
const CGRecordLayout & getCGRecordLayout(const RecordDecl *)
getCGRecordLayout - Return record layout info for the given record decl.
bool noRecordsBeingLaidOut() const
bool isZeroInitializable(QualType T)
const CGFunctionInfo & arrangeCXXConstructorCall(const CallArgList &Args, const CXXConstructorDecl *D, CXXCtorType CtorKind, unsigned ExtraArgs)
Arrange a call to a C++ method, passing the given arguments.
llvm::FunctionType * GetFunctionType(const CGFunctionInfo &Info)
GetFunctionType - Get the LLVM function type for.