mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
AsmMatcherEmitter: Use stable_sort when reordering instructions, so that order
is still deterministic even amongst ambiguous instructions (eventually ambiguous match orders will be a hard error, but we aren't there yet). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95157 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6cafdcc9af
commit
e1f6de3fbd
@ -1413,9 +1413,11 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
|
|||||||
AsmMatcherInfo Info(AsmParser);
|
AsmMatcherInfo Info(AsmParser);
|
||||||
Info.BuildInfo(Target);
|
Info.BuildInfo(Target);
|
||||||
|
|
||||||
// Sort the instruction table using the partial order on classes.
|
// Sort the instruction table using the partial order on classes. We use
|
||||||
std::sort(Info.Instructions.begin(), Info.Instructions.end(),
|
// stable_sort to ensure that ambiguous instructions are still
|
||||||
less_ptr<InstructionInfo>());
|
// deterministically ordered.
|
||||||
|
std::stable_sort(Info.Instructions.begin(), Info.Instructions.end(),
|
||||||
|
less_ptr<InstructionInfo>());
|
||||||
|
|
||||||
DEBUG_WITH_TYPE("instruction_info", {
|
DEBUG_WITH_TYPE("instruction_info", {
|
||||||
for (std::vector<InstructionInfo*>::iterator
|
for (std::vector<InstructionInfo*>::iterator
|
||||||
|
Loading…
Reference in New Issue
Block a user