diff options
Diffstat (limited to 'contrib/llvm-project/clang/lib/CodeGen/CodeGenTypes.h')
-rw-r--r-- | contrib/llvm-project/clang/lib/CodeGen/CodeGenTypes.h | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/contrib/llvm-project/clang/lib/CodeGen/CodeGenTypes.h b/contrib/llvm-project/clang/lib/CodeGen/CodeGenTypes.h index f8f7542e4c83..01c0c673795c 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CodeGenTypes.h +++ b/contrib/llvm-project/clang/lib/CodeGen/CodeGenTypes.h @@ -31,14 +31,9 @@ namespace clang { class ASTContext; template <typename> class CanQual; class CXXConstructorDecl; -class CXXDestructorDecl; class CXXMethodDecl; class CodeGenOptions; -class FieldDecl; class FunctionProtoType; -class ObjCInterfaceDecl; -class ObjCIvarDecl; -class PointerType; class QualType; class RecordDecl; class TagDecl; @@ -81,13 +76,7 @@ class CodeGenTypes { llvm::DenseMap<const Type*, llvm::StructType *> RecordDeclTypes; /// Hold memoized CGFunctionInfo results. - llvm::FoldingSet<CGFunctionInfo> FunctionInfos; - - /// This set keeps track of records that we're currently converting - /// to an IR type. For example, when converting: - /// struct A { struct B { int x; } } when processing 'x', the 'A' and 'B' - /// types will be in this set. - llvm::SmallPtrSet<const Type*, 4> RecordsBeingLaidOut; + llvm::FoldingSet<CGFunctionInfo> FunctionInfos{FunctionInfosLog2InitSize}; llvm::SmallPtrSet<const CGFunctionInfo*, 4> FunctionsBeingProcessed; @@ -95,14 +84,16 @@ class CodeGenTypes { /// a recursive struct conversion, set this to true. bool SkippedLayout; - SmallVector<const RecordDecl *, 8> DeferredRecords; + /// True if any instance of long double types are used. + bool LongDoubleReferenced; /// This map keeps cache of llvm::Types and maps clang::Type to /// corresponding llvm::Type. llvm::DenseMap<const Type *, llvm::Type *> TypeCache; - llvm::SmallSet<const Type *, 8> RecordsWithOpaqueMemberPointers; + llvm::DenseMap<const Type *, llvm::Type *> RecordsWithOpaqueMemberPointers; + static constexpr unsigned FunctionInfosLog2InitSize = 9; /// Helper for ConvertType. llvm::Type *ConvertFunctionTypeInternal(QualType FT); @@ -113,6 +104,7 @@ public: const llvm::DataLayout &getDataLayout() const { return TheModule.getDataLayout(); } + CodeGenModule &getCGM() const { return CGM; } ASTContext &getContext() const { return Context; } const ABIInfo &getABIInfo() const { return TheABIInfo; } const TargetInfo &getTarget() const { return Target; } @@ -263,13 +255,11 @@ public: /// this. /// /// \param argTypes - must all actually be canonical as params - const CGFunctionInfo &arrangeLLVMFunctionInfo(CanQualType returnType, - bool instanceMethod, - bool chainCall, - ArrayRef<CanQualType> argTypes, - FunctionType::ExtInfo info, - ArrayRef<FunctionProtoType::ExtParameterInfo> paramInfos, - RequiredArgs args); + const CGFunctionInfo &arrangeLLVMFunctionInfo( + CanQualType returnType, FnInfoOpts opts, ArrayRef<CanQualType> argTypes, + FunctionType::ExtInfo info, + ArrayRef<FunctionProtoType::ExtParameterInfo> paramInfos, + RequiredArgs args); /// Compute a new LLVM record layout object for the given record. std::unique_ptr<CGRecordLayout> ComputeRecordLayout(const RecordDecl *D, @@ -302,14 +292,9 @@ public: // These are internal details of CGT that shouldn't be used externally. /// zero-initialized (in the C++ sense) with an LLVM zeroinitializer. bool isZeroInitializable(const RecordDecl *RD); + bool isLongDoubleReferenced() const { return LongDoubleReferenced; } bool isRecordLayoutComplete(const Type *Ty) const; - bool noRecordsBeingLaidOut() const { - return RecordsBeingLaidOut.empty(); - } - bool isRecordBeingLaidOut(const Type *Ty) const { - return RecordsBeingLaidOut.count(Ty); - } - + unsigned getTargetAddressSpace(QualType T) const; }; } // end namespace CodeGen |