Fix abuse of StringRef on ARM64SysReg::MRSMapper::toString(Val, Valid).
authorNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 10 Apr 2014 03:05:59 +0000 (03:05 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 10 Apr 2014 03:05:59 +0000 (03:05 +0000)
FIXME: Could we use SmallString here?

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

lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp

index 8c0e6fa917910e35df9727df0add63e0a526eef8..cd410ab4597e00dec400cea506c392d65e26fc5b 100644 (file)
@@ -1480,10 +1480,10 @@ void ARM64InstPrinter::printMRSSystemRegister(const MCInst *MI, unsigned OpNo,
 
   bool Valid;
   auto Mapper = ARM64SysReg::MRSMapper();
-  StringRef Name = Mapper.toString(Val, Valid);
+  std::string Name = Mapper.toString(Val, Valid);
 
   if (Valid)
-    O << StringRef(Name.str()).upper();
+    O << StringRef(Name).upper();
 }
 
 void ARM64InstPrinter::printMSRSystemRegister(const MCInst *MI, unsigned OpNo,
@@ -1492,10 +1492,10 @@ void ARM64InstPrinter::printMSRSystemRegister(const MCInst *MI, unsigned OpNo,
 
   bool Valid;
   auto Mapper = ARM64SysReg::MSRMapper();
-  StringRef Name = Mapper.toString(Val, Valid);
+  std::string Name = Mapper.toString(Val, Valid);
 
   if (Valid)
-    O << StringRef(Name.str()).upper();
+    O << StringRef(Name).upper();
 }
 
 void ARM64InstPrinter::printSystemCPSRField(const MCInst *MI, unsigned OpNo,