Make sure to sort the vtable thunks by their vtable index :) With this we now pass the test from http://www.codesourcery.com/public/cxx-abi/abi-examples.html#vtable-ctor successfully.

llvm-svn: 99792
This commit is contained in:
Anders Carlsson
2010-03-29 01:28:05 +00:00
parent 948d3f4ec6
commit 848d86e5c4

View File

@@ -4212,6 +4212,9 @@ CodeGenVTables::GenerateConstructionVTable(const CXXRecordDecl *RD,
VTableThunks.append(Builder.vtable_thunks_begin(),
Builder.vtable_thunks_end());
// Sort them.
std::sort(VTableThunks.begin(), VTableThunks.end());
// Create and set the initializer.
llvm::Constant *Init =
CreateVTableInitializer(Base.getBase(),