diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-12-13 20:40:39 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-12-13 20:40:39 +0000 |
commit | 3382b3d8014580d448579116843bfd6c26d9e286 (patch) | |
tree | c374cf6b870e821c35796f48525f345d50902b78 /lib/CodeGen/CGVTables.h | |
parent | 531f88b4809c3d4154ee7d1f664805fe15709701 (diff) |
CodeGen: New vtable group representation: struct of vtable arrays.
In a future change, this representation will allow us to use the new inrange
annotation on getelementptr to allow the optimizer to split vtable groups.
Differential Revision: https://reviews.llvm.org/D22296
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVTables.h')
-rw-r--r-- | lib/CodeGen/CGVTables.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/CodeGen/CGVTables.h b/lib/CodeGen/CGVTables.h index 1d06832c46..b92212c368 100644 --- a/lib/CodeGen/CGVTables.h +++ b/lib/CodeGen/CGVTables.h @@ -28,6 +28,7 @@ namespace clang { namespace CodeGen { class CodeGenModule; class ConstantArrayBuilder; + class ConstantStructBuilder; class CodeGenVTables { CodeGenModule &CGM; @@ -35,7 +36,7 @@ class CodeGenVTables { VTableContextBase *VTContext; /// VTableAddressPointsMapTy - Address points for a single vtable. - typedef llvm::DenseMap<BaseSubobject, uint64_t> VTableAddressPointsMapTy; + typedef VTableLayout::AddressPointsMapTy VTableAddressPointsMapTy; typedef std::pair<const CXXRecordDecl *, BaseSubobject> BaseSubobjectPairTy; typedef llvm::DenseMap<BaseSubobjectPairTy, uint64_t> SubVTTIndiciesMapTy; @@ -71,7 +72,7 @@ class CodeGenVTables { public: /// Add vtable components for the given vtable layout to the given /// global initializer. - void createVTableInitializer(ConstantArrayBuilder &builder, + void createVTableInitializer(ConstantStructBuilder &builder, const VTableLayout &layout, llvm::Constant *rtti); @@ -121,6 +122,11 @@ public: void GenerateClassData(const CXXRecordDecl *RD); bool isVTableExternal(const CXXRecordDecl *RD); + + /// Returns the type of a vtable with the given layout. Normally a struct of + /// arrays of pointers, with one struct element for each vtable in the vtable + /// group. + llvm::Type *getVTableType(const VTableLayout &layout); }; } // end namespace CodeGen |