Skip to content

Commit

Permalink
[ORC] Preserve order of constructors with same priority
Browse files Browse the repository at this point in the history
Constructors with the same priority should keep their relative order
that was specified. This is important for clang-repl with many const
variables after commit 05137ecfca ("[clang-repl] Emit const variables
only once").

---

Fixes #15511
  • Loading branch information
hahnjo committed Jun 14, 2024
1 parent e87c429 commit a60f353
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion interpreter/llvm-project/llvm-project.tag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ROOT-llvm16-20240604-01
ROOT-llvm16-20240614-01
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ GlobalCtorDtorScraper::operator()(ThreadSafeModule TSM,

for (auto E : COrDtors)
InitsOrDeInits.push_back(std::make_pair(E.Func, E.Priority));
llvm::sort(InitsOrDeInits, llvm::less_second());
llvm::stable_sort(InitsOrDeInits, llvm::less_second());

auto *InitOrDeInitFuncEntryBlock =
BasicBlock::Create(Ctx, "entry", InitOrDeInitFunc);
Expand Down

0 comments on commit a60f353

Please sign in to comment.