Skip to content

Commit e0fa571

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 1760958 commit e0fa571

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

0 commit comments

Comments
 (0)