diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-08-09 08:23:23 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-09 08:23:23 +0000 |
| commit | d9631912cf6cb944560f4ac37434e9c42da8ee82 (patch) | |
| tree | b403304a9cccbf09b5f1d52fc2bade52cbb7d44c | |
| parent | e0891c2109e04a16ddfc4b0fa7db8455843a3b2e (diff) | |
| download | bcm5719-llvm-d9631912cf6cb944560f4ac37434e9c42da8ee82.tar.gz bcm5719-llvm-d9631912cf6cb944560f4ac37434e9c42da8ee82.zip | |
llvm-mc/AsmParser: Fix thinko in ClassInfo::operator<.
llvm-svn: 78533
| -rw-r--r-- | llvm/utils/TableGen/AsmMatcherEmitter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp index a13bc4e0b95..ef9ab205533 100644 --- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp +++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp @@ -396,10 +396,15 @@ struct InstructionInfo { if (Operands.size() != RHS.Operands.size()) return Operands.size() < RHS.Operands.size(); - for (unsigned i = 0, e = Operands.size(); i != e; ++i) + // Compare lexicographically by operand. The matcher validates that other + // orderings wouldn't be ambiguous using \see CouldMatchAmiguouslyWith(). + for (unsigned i = 0, e = Operands.size(); i != e; ++i) { if (*Operands[i].Class < *RHS.Operands[i].Class) return true; - + if (*RHS.Operands[i].Class < *Operands[i].Class) + return false; + } + return false; } |

