MatchRegisterName() returns 0 if it can't match the register.
authorBill Wendling <isanbard@gmail.com>
Sat, 6 Nov 2010 10:45:34 +0000 (10:45 +0000)
committerBill Wendling <isanbard@gmail.com>
Sat, 6 Nov 2010 10:45:34 +0000 (10:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118339 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp

index 3cb93a317a75d6297626ce11f9958196496af253..b41b71d4b0a842d9299b24207aa5af7973771fe0 100644 (file)
@@ -387,8 +387,8 @@ int ARMAsmParser::TryParseRegister() {
 
   // FIXME: Validate register for the current architecture; we have to do
   // validation later, so maybe there is no need for this here.
-  int RegNum = MatchRegisterName(Tok.getString());
-  if (RegNum == -1)
+  unsigned RegNum = MatchRegisterName(Tok.getString());
+  if (RegNum == 0)
     return -1;
   Parser.Lex(); // Eat identifier token.
   return RegNum;