switch to using a smallvector to avoid allocations for most normal size instructions.
authorChris Lattner <sabre@nondot.org>
Sun, 22 May 2011 04:53:24 +0000 (04:53 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 22 May 2011 04:53:24 +0000 (04:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131837 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCDisassembler/Disassembler.cpp

index 29fc192359b6add7ec9dc727636367caef35464b..6e636f07f1d11124538c3798ac2dbf21c0980445 100644 (file)
@@ -147,8 +147,8 @@ size_t LLVMDisasmInstruction(LLVMDisasmContextRef DCR, uint8_t *Bytes,
   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();