diff options
author | Anders Carlsson <andersca@mac.com> | 2010-03-25 00:35:49 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-03-25 00:35:49 +0000 |
commit | ff143f8f78f6f2417d4b46d41c83f287485f0aec (patch) | |
tree | 7c3b5df643570034e50f6187618b0b3e1907b563 /lib/CodeGen/CGVtable.h | |
parent | f0e0b17d0504d25b4673de015cf7401e2296323c (diff) |
Shuffle some code around; this will make it easier to use the new layout code for address points.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.h')
-rw-r--r-- | lib/CodeGen/CGVtable.h | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/lib/CodeGen/CGVtable.h b/lib/CodeGen/CGVtable.h index 6670b4ed72..28e2bcb084 100644 --- a/lib/CodeGen/CGVtable.h +++ b/lib/CodeGen/CGVtable.h @@ -223,8 +223,6 @@ public: typedef llvm::DenseMap<CtorVtable_t, int64_t> AddrSubMap_t; typedef llvm::DenseMap<const CXXRecordDecl *, AddrSubMap_t *> AddrMap_t; - typedef llvm::DenseMap<BaseSubobject, uint64_t> AddressPointsMapTy; - const CodeGenVTables::AddrSubMap_t& getAddressPoints(const CXXRecordDecl *RD); llvm::DenseMap<const CXXRecordDecl *, AddrMap_t*> AddressPoints; @@ -269,6 +267,9 @@ private: /// integers are the vtable components. VTableLayoutMapTy VTableLayoutMap; + typedef llvm::DenseMap<std::pair<const CXXRecordDecl *, + BaseSubobject>, uint64_t> AddressPointsMapTy; + uint64_t getNumVTableComponents(const CXXRecordDecl *RD) const { assert(VTableLayoutMap.count(RD) && "No vtable layout for this class!"); @@ -288,7 +289,7 @@ private: GenerateVtable(llvm::GlobalVariable::LinkageTypes Linkage, bool GenerateDefinition, const CXXRecordDecl *LayoutClass, const CXXRecordDecl *RD, uint64_t Offset, bool IsVirtual, - AddressPointsMapTy& AddressPoints); + llvm::DenseMap<BaseSubobject, uint64_t> &AddressPoints); llvm::GlobalVariable *GenerateVTT(llvm::GlobalVariable::LinkageTypes Linkage, bool GenerateDefinition, @@ -334,20 +335,12 @@ public: /// GetAddrOfVTable - Get the address of the vtable for the given record decl. llvm::Constant *GetAddrOfVTable(const CXXRecordDecl *RD); - /// CtorVtableInfo - Information about a constructor vtable. - struct CtorVtableInfo { - /// Vtable - The vtable itself. - llvm::GlobalVariable *Vtable; - - /// AddressPoints - The address points in this constructor vtable. - AddressPointsMapTy AddressPoints; - - CtorVtableInfo() : Vtable(0) { } - }; - - CtorVtableInfo getCtorVtable(const CXXRecordDecl *RD, - const BaseSubobject &Base, - bool BaseIsVirtual); + /// GenerateConstructionVTable - Generate a construction vtable for the given + /// base subobject. + llvm::GlobalVariable * + GenerateConstructionVTable(const CXXRecordDecl *RD, const BaseSubobject &Base, + bool BaseIsVirtual, + AddressPointsMapTy& AddressPoints); llvm::GlobalVariable *getVTT(const CXXRecordDecl *RD); |