[llvm-commits] [llvm] r131837 - /llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp

Chris Lattner sabre at nondot.org
Sat May 21 21:53:24 PDT 2011


Author: lattner
Date: Sat May 21 23:53:24 2011
New Revision: 131837

URL: http://llvm.org/viewvc/llvm-project?rev=131837&view=rev
Log:
switch to using a smallvector to avoid allocations for most normal size instructions.

Modified:
    llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp

Modified: llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp?rev=131837&r1=131836&r2=131837&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp (original)
+++ llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp Sat May 21 23:53:24 2011
@@ -147,8 +147,8 @@
   if (!DisAsm->getInstruction(Inst, Size, MemoryObject, PC, /*REMOVE*/ nulls()))
     return 0;
 
-  std::string InsnStr;
-  raw_string_ostream OS(InsnStr);
+  SmallVector<char, 64> InsnStr;
+  raw_svector_ostream OS(InsnStr);
   IP->printInst(&Inst, OS);
   OS.flush();
 





More information about the llvm-commits mailing list