[mips] Use early exit in MipsAsmParser::matchCPURegisterName(). NFC.
authorToma Tabacu <toma.tabacu@imgtec.com>
Mon, 15 Sep 2014 15:33:01 +0000 (15:33 +0000)
committerToma Tabacu <toma.tabacu@imgtec.com>
Mon, 15 Sep 2014 15:33:01 +0000 (15:33 +0000)
Patch by Vasileios Kalintiris.

Differential Revision: http://reviews.llvm.org/D5270

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217774 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/AsmParser/MipsAsmParser.cpp

index 5500a434c36361b21f1a25c76fb3f3c9bbba2f90..35005d2b0ff39b3b68538306f56b7f007f685d8f 100644 (file)
@@ -1657,23 +1657,24 @@ int MipsAsmParser::matchCPURegisterName(StringRef Name) {
            .Case("t9", 25)
            .Default(-1);
 
-  if (isABI_N32() || isABI_N64()) {
-    // Although SGI documentation just cuts out t0-t3 for n32/n64,
-    // GNU pushes the values of t0-t3 to override the o32/o64 values for t4-t7
-    // We are supporting both cases, so for t0-t3 we'll just push them to t4-t7.
-    if (8 <= CC && CC <= 11)
-      CC += 4;
-
-    if (CC == -1)
-      CC = StringSwitch<unsigned>(Name)
-               .Case("a4", 8)
-               .Case("a5", 9)
-               .Case("a6", 10)
-               .Case("a7", 11)
-               .Case("kt0", 26)
-               .Case("kt1", 27)
-               .Default(-1);
-  }
+  if (!(isABI_N32() || isABI_N64()))
+    return CC;
+
+  // Although SGI documentation just cuts out t0-t3 for n32/n64,
+  // GNU pushes the values of t0-t3 to override the o32/o64 values for t4-t7
+  // We are supporting both cases, so for t0-t3 we'll just push them to t4-t7.
+  if (8 <= CC && CC <= 11)
+    CC += 4;
+
+  if (CC == -1)
+    CC = StringSwitch<unsigned>(Name)
+             .Case("a4", 8)
+             .Case("a5", 9)
+             .Case("a6", 10)
+             .Case("a7", 11)
+             .Case("kt0", 26)
+             .Case("kt1", 27)
+             .Default(-1);
 
   return CC;
 }