diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-01 03:19:09 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-01 03:19:09 +0000 |
commit | 79b3cddfa2eeb9ed7f93daf8e4f3c3d87779c3ab (patch) | |
tree | 95033d2d0d1a29fc33dbb68f80c7173337266e8e /utils/TableGen/AsmMatcherEmitter.cpp | |
parent | f78081145695baa5d0b004e674c4561245b13b52 (diff) | |
download | external_llvm-79b3cddfa2eeb9ed7f93daf8e4f3c3d87779c3ab.tar.gz external_llvm-79b3cddfa2eeb9ed7f93daf8e4f3c3d87779c3ab.tar.bz2 external_llvm-79b3cddfa2eeb9ed7f93daf8e4f3c3d87779c3ab.zip |
avoid needless throw/catch/rethrow, stringref'ize some simple stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/AsmMatcherEmitter.cpp')
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index 37a8c8f79b..3f4594c4e3 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -945,7 +945,7 @@ void AsmMatcherInfo::BuildInfo() { Instructions.push_back(II.take()); } - + // Build info for the register classes. BuildRegisterClasses(SingletonRegisters); @@ -998,12 +998,9 @@ void AsmMatcherInfo::BuildInfo() { // Map this token to an operand. FIXME: Move elsewhere. unsigned Idx; - try { - Idx = II->Instr->getOperandNamed(OperandName); - } catch(...) { + if (!II->Instr->hasOperandNamed(OperandName, Idx)) throw std::string("error: unable to find operand: '" + OperandName.str() + "'"); - } // FIXME: This is annoying, the named operand may be tied (e.g., // XCHG8rm). What we want is the untied operand, which we now have to |