summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGVtable.cpp')
-rw-r--r--clang/lib/CodeGen/CGVtable.cpp3
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(),
OpenPOWER on IntegriCloud