Introduce a string_ostream string builder facilty
[oota-llvm.git] / lib / CodeGen / MachineBlockFrequencyInfo.cpp
index 9151d99089d6b35064f36ecc3a24381e571645f9..35e4a56cec40201ee7da2a27355dbc8ae48a595c 100644 (file)
@@ -89,10 +89,9 @@ struct DOTGraphTraits<MachineBlockFrequencyInfo*> :
 
   std::string getNodeLabel(const MachineBasicBlock *Node,
                            const MachineBlockFrequencyInfo *Graph) {
-    std::string Result;
-    raw_string_ostream OS(Result);
+    string_ostream OS;
 
-    OS << Node->getName().str() << ":";
+    OS << Node->getName() << ":";
     switch (ViewMachineBlockFreqPropagationDAG) {
     case GVDT_Fraction:
       Graph->printBlockFreq(OS, Node);
@@ -105,7 +104,7 @@ struct DOTGraphTraits<MachineBlockFrequencyInfo*> :
                        "never reach this point.");
     }
 
-    return Result;
+    return OS.str();
   }
 };