Skip to content

Commit 25e9e94

Browse files
kanavinkraj
authored andcommitted
AsmMatcherEmitter: sort ClassInfo lists by name as well
Otherwise, there are instances which are identical in every other field and therefore sort non-reproducibly (which breaks binary and source reproducibiliy). Upstream-Status: Submitted [https://reviews.llvm.org/D97477] Signed-off-by: Alexander Kanavin <[email protected]>
1 parent 80f7d92 commit 25e9e94

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/utils/TableGen/AsmMatcherEmitter.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,10 @@ struct ClassInfo {
384384
// name of a class shouldn't be significant. However, some of the backends
385385
// accidentally rely on this behaviour, so it will have to stay like this
386386
// until they are fixed.
387-
return ValueName < RHS.ValueName;
387+
if (ValueName != RHS.ValueName)
388+
return ValueName < RHS.ValueName;
389+
// All else being equal, we should sort by name, for source and binary reproducibility
390+
return Name < RHS.Name;
388391
}
389392
};
390393

0 commit comments

Comments
 (0)