Skip to content

Commit d07231d

Browse files
author
Alex B
committed
[llvm-gsymutil] Ensure gSYM creation determinism with merged functions
1 parent 7d8b4eb commit d07231d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/DebugInfo/GSYM/GsymCreator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@ llvm::Error GsymCreator::finalize(OutputAggregator &Out) {
275275
// object.
276276
if (!IsSegment) {
277277
if (NumBefore > 1) {
278-
// Sort function infos so we can emit sorted functions.
279-
llvm::sort(Funcs);
278+
// Sort function infos so we can emit sorted functions. Use stable sort to
279+
// ensure determinism.
280+
llvm::stable_sort(Funcs);
280281
std::vector<FunctionInfo> FinalizedFuncs;
281282
FinalizedFuncs.reserve(Funcs.size());
282283
FinalizedFuncs.emplace_back(std::move(Funcs.front()));

0 commit comments

Comments
 (0)