Fix remaining StringRef abuse.
authorTim Northover <Tim.Northover@arm.com>
Tue, 5 Feb 2013 15:01:51 +0000 (15:01 +0000)
committerTim Northover <Tim.Northover@arm.com>
Tue, 5 Feb 2013 15:01:51 +0000 (15:01 +0000)
This should fix the valgrind buildbot failure.

llvm-svn: 174375

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

index e15d135..69e4fc2 100644 (file)
@@ -1442,8 +1442,8 @@ AArch64AsmParser::IdentifyRegister(unsigned &RegNum, SMLoc &RegEndLoc,
     // gives us a permanent string to use in the token (a pointer into LowerReg
     // would go out of scope when we return).
     LayoutLoc = SMLoc::getFromPointer(S.getPointer() + DotPos + 1);
-    Layout = LowerReg.substr(DotPos, StringRef::npos);
-    Layout = StringSwitch<const char *>(Layout)
+    std::string LayoutText = LowerReg.substr(DotPos, StringRef::npos);
+    Layout = StringSwitch<const char *>(LayoutText)
       .Case(".d", ".d").Case(".1d", ".1d").Case(".2d", ".2d")
       .Case(".s", ".s").Case(".2s", ".2s").Case(".4s", ".4s")
       .Case(".h", ".h").Case(".4h", ".4h").Case(".8h", ".8h")