summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-03-10 19:15:26 +0000
committerAnders Carlsson <andersca@mac.com>2010-03-10 19:15:26 +0000
commit703a08605f7f1972d8742c91dba4dbf8c2fb23f9 (patch)
tree595c578a44beb02fe1720bdef328dfb41f97809b /clang/lib/CodeGen/CGVtable.cpp
parent1794ec4a30a3e2bef6c4a8cf2e921da5828d5514 (diff)
downloadbcm5719-llvm-703a08605f7f1972d8742c91dba4dbf8c2fb23f9.tar.gz
bcm5719-llvm-703a08605f7f1972d8742c91dba4dbf8c2fb23f9.zip
Ignore non-interesting bases when emitting construction vtables.
llvm-svn: 98177
Diffstat (limited to 'clang/lib/CodeGen/CGVtable.cpp')
-rw-r--r--clang/lib/CodeGen/CGVtable.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp
index 4500ec033cd..caf1e1f93e4 100644
--- a/clang/lib/CodeGen/CGVtable.cpp
+++ b/clang/lib/CodeGen/CGVtable.cpp
@@ -1800,6 +1800,17 @@ void VtableBuilder::LayoutSecondaryVtables(BaseSubobject Base,
if (!BaseDecl->isDynamicClass())
continue;
+ if (isBuildingConstructorVtable()) {
+ // Itanium C++ ABI 2.6.4:
+ // Some of the base class subobjects may not need construction virtual
+ // tables, which will therefore not be present in the construction
+ // virtual table group, even though the subobject virtual tables are
+ // present in the main virtual table group for the complete object.
+ if (!BaseDecl->getNumVBases()) {
+ continue;
+ }
+ }
+
// Get the base offset of this base.
uint64_t RelativeBaseOffset = Layout.getBaseClassOffset(BaseDecl);
uint64_t BaseOffset = Base.getBaseOffset() + RelativeBaseOffset;
OpenPOWER on IntegriCloud