aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-02-13 22:23:31 +0000
committerAnders Carlsson <andersca@mac.com>2010-02-13 22:23:31 +0000
commit74c364e4cccb914da2a581e365b056155e1ae932 (patch)
treeea247e01b2f47a74811a90f972d09c595b294e56 /lib/CodeGen/CGVtable.cpp
parent76f1aa7658c34532785e6f44c99af65f3e4bd194 (diff)
Assert if we encounter this adjustments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96125 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r--lib/CodeGen/CGVtable.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index 4b2a703493..eb8b30d4a3 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -219,6 +219,7 @@ private:
/// and we want to override B::f with C::f, we also need to override A::f with
/// C::f.
void PropagateOverrider(const CXXMethodDecl *OldMD,
+ BaseSubobject NewBase,
const CXXMethodDecl *NewMD,
SubobjectOffsetsMapTy &Offsets);
@@ -290,7 +291,7 @@ void FinalOverriders::AddOverriders(BaseSubobject Base,
continue;
// First, propagate the overrider.
- PropagateOverrider(MD, MD, Offsets);
+ PropagateOverrider(MD, Base, MD, Offsets);
// Add the overrider as the final overrider of itself.
OverriderInfo& Overrider = OverridersMap[std::make_pair(Base, MD)];
@@ -409,6 +410,7 @@ ComputeReturnTypeBaseOffset(ASTContext &Context,
}
void FinalOverriders::PropagateOverrider(const CXXMethodDecl *OldMD,
+ BaseSubobject NewBase,
const CXXMethodDecl *NewMD,
SubobjectOffsetsMapTy &Offsets) {
for (CXXMethodDecl::method_iterator I = OldMD->begin_overridden_methods(),
@@ -446,13 +448,18 @@ void FinalOverriders::PropagateOverrider(const CXXMethodDecl *OldMD,
// Store the return adjustment base offset.
ReturnAdjustments[SubobjectAndMethod] = ReturnBaseOffset;
}
+
+ // Check if we need a 'this' adjustment base offset as well.
+ if (Offset != NewBase.getBaseOffset()) {
+ assert(false && "FIXME: Handle 'this' adjustments!");
+ }
}
// Set the new overrider.
Overrider.Method = NewMD;
// And propagate it further.
- PropagateOverrider(OverriddenMD, NewMD, Offsets);
+ PropagateOverrider(OverriddenMD, NewBase, NewMD, Offsets);
}
}
}