diff options
author | Mike Stump <mrs@apple.com> | 2009-11-12 20:47:57 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-11-12 20:47:57 +0000 |
commit | 2cefe383658bbd052f4dcf07ac3adbee33a2f51b (patch) | |
tree | 8da0dd7534150f882d2751ab1f4e081f38e22698 /clang/lib/CodeGen/CodeGenModule.h | |
parent | 68e4945c03eeeb04773587f3b265b0888bb22549 (diff) | |
download | bcm5719-llvm-2cefe383658bbd052f4dcf07ac3adbee33a2f51b.tar.gz bcm5719-llvm-2cefe383658bbd052f4dcf07ac3adbee33a2f51b.zip |
Fix the offset calculations for non-virtual bases with overrides.
Refine the VTT entries for virtual bases to refer to the complete
object's vtable instead of constructor vtables.
Refine the AddressPoint calculations for VTT entries for virtual bases.
llvm-svn: 87021
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 749c8f5403f..6fe6cf55847 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -250,9 +250,13 @@ public: llvm::Constant *GetAddrOfFunction(GlobalDecl GD, const llvm::Type *Ty = 0); - /// GenerateVtable - Generate the vtable for the given type. - llvm::Constant *GenerateVtable(const CXXRecordDecl *RD, - const CXXRecordDecl *Class=0, + /// GenerateVtable - Generate the vtable for the given type. LayoutClass is + /// the class to use for the virtual base layout information. For + /// non-construction vtables, this is always the same as RD. Offset is the + /// offset in bits for the RD object in the LayoutClass, if we're generating a + /// construction vtable, otherwise 0. + llvm::Constant *GenerateVtable(const CXXRecordDecl *LayoutClass, + const CXXRecordDecl *RD, uint64_t Offset=0); /// GenerateVTT - Generate the VTT for the given type. @@ -269,6 +273,10 @@ public: int64_t nv_t, int64_t v_t, int64_t nv_r, int64_t v_r); + typedef std::pair<const CXXRecordDecl *, uint64_t> CtorVtable_t; + llvm::DenseMap<const CXXRecordDecl *, llvm::DenseMap<CtorVtable_t, + int64_t>*> AddressPoints; + /// GetCXXBaseClassOffset - Returns the offset from a derived class to its /// base class. Returns null if the offset is 0. llvm::Constant *GetCXXBaseClassOffset(const CXXRecordDecl *ClassDecl, |