diff options
author | Chris Lattner <sabre@nondot.org> | 2008-02-05 08:06:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-02-05 08:06:13 +0000 |
commit | d86e6bc7ab4388a578daf46e7c76be9122a25072 (patch) | |
tree | 00e1cb94e691418b35d2fe71f1ed5283671af17f /CodeGen/CodeGenTypes.h | |
parent | 9153f73d1035ddcaac5a253ac2a0570e04e22b1f (diff) |
rewrite some of the type refinement code to eliminate dangling pointers
simplify the code and generally make it more robust.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46745 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenTypes.h')
-rw-r--r-- | CodeGen/CodeGenTypes.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/CodeGen/CodeGenTypes.h b/CodeGen/CodeGenTypes.h index 0da71ca029..b60b9bab3a 100644 --- a/CodeGen/CodeGenTypes.h +++ b/CodeGen/CodeGenTypes.h @@ -75,7 +75,7 @@ class CodeGenTypes { llvm::Module& TheModule; const llvm::TargetData& TheTargetData; - llvm::DenseMap<const TagDecl*, llvm::Type*> TagDeclTypes; + llvm::DenseMap<const TagDecl*, llvm::PATypeHolder> TagDeclTypes; /// CGRecordLayouts - This maps llvm struct type with corresponding /// record layout info. @@ -100,11 +100,6 @@ public: private: llvm::DenseMap<const FieldDecl *, BitFieldInfo> BitFields; - /// RecordTypesToResolve - This keeps track of record types that are not - /// yet incomplete. One llvm::OpaqueType is associated with each incomplete - /// record. - llvm::DenseMap<const RecordDecl *, llvm::Type *> RecordTypesToResolve; - /// TypeHolderMap - This map keeps cache of llvm::Types (through PATypeHolder) /// and maps llvm::Types to corresponding clang::Type. llvm::PATypeHolder is /// used instead of llvm::Type because it allows us to bypass potential @@ -142,6 +137,12 @@ public: /// that corresponds to the field FD. unsigned getLLVMFieldNo(const FieldDecl *FD); + + /// ForceTypeCompilation - When we find the definition for a type, we require + /// it to be recompiled, to update the lazy understanding of what it is in our + /// maps. + void ForceTypeCompilation(QualType T); + public: // These are internal details of CGT that shouldn't be used externally. void DecodeArgumentTypes(const FunctionTypeProto &FTP, std::vector<const llvm::Type*> &ArgTys); |