]> granicus.if.org Git - llvm/commitdiff
[Mips] Prefer Twine::utohexstr over utohexstr, saves a string copy.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 23 May 2015 16:53:07 +0000 (16:53 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 23 May 2015 16:53:07 +0000 (16:53 +0000)
NFC.

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

lib/Target/Mips/MipsAsmPrinter.cpp

index ae33867f4d34fefaf55645ff09f66808b46a450f..a3995b8ceb99d314400cf3a3bc01c4ef2f11df23 100644 (file)
@@ -22,7 +22,6 @@
 #include "MipsTargetMachine.h"
 #include "MipsTargetStreamer.h"
 #include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/CodeGen/MachineConstantPool.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
@@ -448,12 +447,12 @@ bool MipsAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
     case 'X': // hex const int
       if ((MO.getType()) != MachineOperand::MO_Immediate)
         return true;
-      O << "0x" << StringRef(utohexstr(MO.getImm())).lower();
+      O << "0x" << Twine::utohexstr(MO.getImm());
       return false;
     case 'x': // hex const int (low 16 bits)
       if ((MO.getType()) != MachineOperand::MO_Immediate)
         return true;
-      O << "0x" << StringRef(utohexstr(MO.getImm() & 0xffff)).lower();
+      O << "0x" << Twine::utohexstr(MO.getImm() & 0xffff);
       return false;
     case 'd': // decimal const int
       if ((MO.getType()) != MachineOperand::MO_Immediate)