Figured out why the test was failing, this will hopefully fix it.

llvm-svn: 97336
This commit is contained in:
Anders Carlsson 2010-02-27 19:00:53 +00:00
parent 2b381bbb5c
commit 4d0729a7cc
2 changed files with 9 additions and 4 deletions

View File

@ -1296,6 +1296,8 @@ OverridesMethodInBases(const CXXMethodDecl *MD,
}
void VtableBuilder::ComputeThisAdjustments() {
std::map<uint64_t, ThisAdjustment> SortedThisAdjustments;
// Now go through the method info map and see if any of the methods need
// 'this' pointer adjustments.
for (MethodInfoMapTy::const_iterator I = MethodInfoMap.begin(),
@ -1338,17 +1340,21 @@ void VtableBuilder::ComputeThisAdjustments() {
ThisAdjustmentOffset);
// Add it.
ThisAdjustments.push_back(std::make_pair(VtableIndex, ThisAdjustment));
SortedThisAdjustments.insert(std::make_pair(VtableIndex, ThisAdjustment));
if (isa<CXXDestructorDecl>(MD)) {
// Add an adjustment for the deleting destructor as well.
ThisAdjustments.push_back(std::make_pair(VtableIndex + 1,
ThisAdjustment));
SortedThisAdjustments.insert(std::make_pair(VtableIndex + 1,
ThisAdjustment));
}
}
/// Clear the method info map.
MethodInfoMap.clear();
// Add the sorted elements.
ThisAdjustments.append(SortedThisAdjustments.begin(),
SortedThisAdjustments.end());
}
VtableBuilder::ReturnAdjustment

View File

@ -1,5 +1,4 @@
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm-only -fdump-vtable-layouts 2>&1 | FileCheck %s
// XFAIL: *
/// Examples from the Itanium C++ ABI specification.
/// http://www.codesourcery.com/public/cxx-abi/