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