summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-02-09 19:09:28 +0000
committerDevang Patel <dpatel@apple.com>2010-02-09 19:09:28 +0000
commit0ae70d16b81cd6f4b115aead130b4ac8db9b9e16 (patch)
tree20c46c1509eb93747f8c10761d3038a5e021c9ab /clang/lib/CodeGen/CGDebugInfo.cpp
parentddfe8092e9a12d1106bdbfd9045e2c9efae8fa32 (diff)
downloadbcm5719-llvm-0ae70d16b81cd6f4b115aead130b4ac8db9b9e16.tar.gz
bcm5719-llvm-0ae70d16b81cd6f4b115aead130b4ac8db9b9e16.zip
Fix virtual bases' debug info.
llvm-svn: 95678
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 8b3e195fa52..6f84add0372 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -641,7 +641,7 @@ CollectCXXMemberFunctions(const CXXRecordDecl *RD, llvm::DICompileUnit Unit,
E = RD->method_end(); I != E; ++I) {
const CXXMethodDecl *Method = *I;
- if (Method->isImplicit())
+ if (Method->isImplicit() && !Method->isUsed())
continue;
EltTys.push_back(CreateCXXMemberFunction(Method, Unit, RecordTy));
@@ -666,7 +666,9 @@ CollectCXXBases(const CXXRecordDecl *RD, llvm::DICompileUnit Unit,
cast<CXXRecordDecl>(BI->getType()->getAs<RecordType>()->getDecl());
if (BI->isVirtual()) {
- BaseOffset = RL.getVBaseClassOffset(Base);
+ // virtual base offset index is -ve. The code generator emits dwarf
+ // expression where it expects +ve number.
+ BaseOffset = 0 - CGM.getVtableInfo().getVirtualBaseOffsetIndex(RD, Base);
BFlags = llvm::DIType::FlagVirtual;
} else
BaseOffset = RL.getBaseClassOffset(Base);
OpenPOWER on IntegriCloud