Skip to content

Commit 24630a8

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 ab692ed commit 24630a8

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
@@ -362,7 +362,10 @@ struct ClassInfo {
362362
// name of a class shouldn't be significant. However, some of the backends
363363
// accidentally rely on this behaviour, so it will have to stay like this
364364
// until they are fixed.
365-
return ValueName < RHS.ValueName;
365+
if (ValueName != RHS.ValueName)
366+
return ValueName < RHS.ValueName;
367+
// All else being equal, we should sort by name, for source and binary reproducibility
368+
return Name < RHS.Name;
366369
}
367370
};
368371

0 commit comments

Comments
 (0)