[llvm-commits] [llvm] r118338 - /llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Bill Wendling
isanbard at gmail.com
Sat Nov 6 03:40:24 PDT 2010
Author: void
Date: Sat Nov 6 05:40:24 2010
New Revision: 118338
URL: http://llvm.org/viewvc/llvm-project?rev=118338&view=rev
Log:
Use TryParseRegister() instead of MatchRegisterName(). The former returns -1
while the latter doesn't.
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=118338&r1=118337&r2=118338&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Sat Nov 6 05:40:24 2010
@@ -434,13 +434,12 @@
Error(RegLoc, "register expected");
return 0;
}
- int RegNum = MatchRegisterName(RegTok.getString());
+ int RegNum = TryParseRegister();
if (RegNum == -1) {
Error(RegLoc, "register expected");
return 0;
}
- Parser.Lex(); // Eat identifier token.
unsigned RegList = 1 << RegNum;
int HighRegNum = RegNum;
@@ -454,7 +453,7 @@
Error(RegLoc, "register expected");
return 0;
}
- int RegNum = MatchRegisterName(RegTok.getString());
+ int RegNum = TryParseRegister();
if (RegNum == -1) {
Error(RegLoc, "register expected");
return 0;
@@ -466,8 +465,6 @@
Warning(RegLoc, "register not in ascending order in register list");
RegList |= 1 << RegNum;
HighRegNum = RegNum;
-
- Parser.Lex(); // Eat identifier token.
}
const AsmToken &RCurlyTok = Parser.getTok();
if (RCurlyTok.isNot(AsmToken::RCurly)) {
More information about the llvm-commits
mailing list