Adds Microsoft compatiable C++ record layout code to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192494 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/MicrosoftVBTables.cpp b/lib/CodeGen/MicrosoftVBTables.cpp
index f901eb5..b4b98d3 100644
--- a/lib/CodeGen/MicrosoftVBTables.cpp
+++ b/lib/CodeGen/MicrosoftVBTables.cpp
@@ -54,10 +54,6 @@
}
}
-bool VBTableBuilder::hasVBPtr(const CXXRecordDecl *RD) {
- const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD);
- return Layout.getVBPtrOffset().getQuantity() != -1;
-}
void VBTableBuilder::findUnambiguousPaths(const CXXRecordDecl *ReusingBase,
BaseSubobject CurSubobject,
@@ -65,10 +61,11 @@
size_t PathsStart = Paths.size();
bool ReuseVBPtrFromBase = true;
const CXXRecordDecl *CurBase = CurSubobject.getBase();
+ const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(CurBase);
// If this base has a vbptr, then we've found a path. These are not full
// paths, so we don't use CXXBasePath.
- if (hasVBPtr(CurBase)) {
+ if (Layout.hasOwnVBPtr()) {
ReuseVBPtrFromBase = false;
VBTablePath *Info = new VBTablePath(
VBTableInfo(ReusingBase, CurSubobject, /*GV=*/0));
@@ -76,7 +73,6 @@
}
// Recurse onto any bases which themselves have virtual bases.
- const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(CurBase);
for (CXXRecordDecl::base_class_const_iterator I = CurBase->bases_begin(),
E = CurBase->bases_end(); I != E; ++I) {
const CXXRecordDecl *Base = I->getType()->getAsCXXRecordDecl();