diff options
author | Anders Carlsson <andersca@mac.com> | 2010-03-29 01:28:05 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-03-29 01:28:05 +0000 |
commit | aed924e9f210169c9a5b0ca30099fd2f479f2637 (patch) | |
tree | dd68f5589c4740c38384fc790b94fe140c170a2d /lib/CodeGen/CGVtable.cpp | |
parent | 14da9de3ad9a451ed58f0196eea945c8393d5762 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99792 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 804c684361..1c94a4e73e 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -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(), |