diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2010-02-02 23:46:36 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2010-02-02 23:46:36 +0000 |
| commit | 3b8a4663b935ed01f352ac5e217c428312295ef4 (patch) | |
| tree | aa7a7090101906c9c197af6f95fe56a79773e315 /llvm/utils/TableGen | |
| parent | c49f8c745625fe2d41c0d69f95979a0a294cafe4 (diff) | |
| download | bcm5719-llvm-3b8a4663b935ed01f352ac5e217c428312295ef4.tar.gz bcm5719-llvm-3b8a4663b935ed01f352ac5e217c428312295ef4.zip | |
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).
llvm-svn: 95157
Diffstat (limited to 'llvm/utils/TableGen')
| -rw-r--r-- | llvm/utils/TableGen/AsmMatcherEmitter.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp index dca7929e545..c80285fa377 100644 --- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp +++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp @@ -1413,9 +1413,11 @@ void AsmMatcherEmitter::run(raw_ostream &OS) { AsmMatcherInfo Info(AsmParser); Info.BuildInfo(Target); - // Sort the instruction table using the partial order on classes. - std::sort(Info.Instructions.begin(), Info.Instructions.end(), - less_ptr<InstructionInfo>()); + // Sort the instruction table using the partial order on classes. We use + // stable_sort to ensure that ambiguous instructions are still + // deterministically ordered. + std::stable_sort(Info.Instructions.begin(), Info.Instructions.end(), + less_ptr<InstructionInfo>()); DEBUG_WITH_TYPE("instruction_info", { for (std::vector<InstructionInfo*>::iterator |

