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 | 848d86e5c4e2d2e26778e98af10cb8f48823adac (patch) | |
| tree | 563dc17d5e2be5b8ef090b2806a1df7bb1623544 /clang/lib | |
| parent | 948d3f4ec6fa9cfc0e6d828ec1ff7b89d0f54c07 (diff) | |
| download | bcm5719-llvm-848d86e5c4e2d2e26778e98af10cb8f48823adac.tar.gz bcm5719-llvm-848d86e5c4e2d2e26778e98af10cb8f48823adac.zip | |
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
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/CodeGen/CGVtable.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp index 804c6843618..1c94a4e73e9 100644 --- a/clang/lib/CodeGen/CGVtable.cpp +++ b/clang/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(), |

