summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/MicrosoftCXXABI.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-06-05 15:58:29 +0000
committerReid Kleckner <reid@kleckner.net>2013-06-05 15:58:29 +0000
commitae748148c1d0f72514c3874a4eb411d2d5476444 (patch)
treed85a65e4751dc6874c5b3308017d07e361e3ccac /clang/lib/CodeGen/MicrosoftCXXABI.cpp
parentcabc8822f2a9ea0cc44bbe4f04a04012b86ce605 (diff)
downloadbcm5719-llvm-ae748148c1d0f72514c3874a4eb411d2d5476444.tar.gz
bcm5719-llvm-ae748148c1d0f72514c3874a4eb411d2d5476444.zip
[ms-cxxabi] Fix vbptr offsets in memptrs when the vbptr is in an nvbase
Also addresses a review comment from John from on r180985 by removing the "== -1" check, since it's now reusing the correct code which has the comment. llvm-svn: 183318
Diffstat (limited to 'clang/lib/CodeGen/MicrosoftCXXABI.cpp')
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index 7a8a0a6eea6..1bb2c55f559 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -661,12 +661,8 @@ MicrosoftCXXABI::EmitFullMemberPointer(llvm::Constant *FirstField,
CGM.IntTy, NonVirtualBaseAdjustment.getQuantity()));
if (hasVBPtrOffsetField(Inheritance)) {
- // FIXME: We actually need to search non-virtual bases for vbptrs.
- int64_t VBPtrOffset =
- getContext().getASTRecordLayout(RD).getVBPtrOffset().getQuantity();
- if (VBPtrOffset == -1)
- VBPtrOffset = 0;
- fields.push_back(llvm::ConstantInt::get(CGM.IntTy, VBPtrOffset));
+ fields.push_back(llvm::ConstantInt::get(
+ CGM.IntTy, GetVBPtrOffsetFromBases(RD).getQuantity()));
}
// The rest of the fields are adjusted by conversions to a more derived class.
OpenPOWER on IntegriCloud