summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-08-23 22:53:13 +0000
committerChris Lattner <sabre@nondot.org>2008-08-23 22:53:13 +0000
commit838aff36dde592a725ebf4a4c94d9d7b0fecbf7c (patch)
tree6a9642c6c8d76978d9630870204c694613343c1f /llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
parent82ff92309185d3f33d4531e2c7b67ff2a5c81403 (diff)
downloadbcm5719-llvm-838aff36dde592a725ebf4a4c94d9d7b0fecbf7c.tar.gz
bcm5719-llvm-838aff36dde592a725ebf4a4c94d9d7b0fecbf7c.zip
get MachineConstantPool off std::ostream, onto raw_ostream. It would be
really nice if someone converted MachineFunction::print to raw_ostream. llvm-svn: 55268
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index ea86c0d591c..34a31015132 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
@@ -23,10 +23,10 @@
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/GraphWriter.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Config/config.h"
#include <fstream>
-#include <sstream>
using namespace llvm;
namespace llvm {
@@ -138,18 +138,24 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
Op += " " + itostr(JTDN->getIndex());
} else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Node)){
if (CP->isMachineConstantPoolEntry()) {
- std::ostringstream SS;
- CP->getMachineCPVal()->print(SS);
- Op += "<" + SS.str() + ">";
+ Op += '<';
+ {
+ raw_string_ostream OSS(Op);
+ OSS << *CP->getMachineCPVal();
+ }
+ Op += '>';
} else {
if (ConstantFP *CFP = dyn_cast<ConstantFP>(CP->getConstVal()))
Op += "<" + ftostr(CFP->getValueAPF()) + ">";
else if (ConstantInt *CI = dyn_cast<ConstantInt>(CP->getConstVal()))
Op += "<" + utostr(CI->getZExtValue()) + ">";
else {
- std::ostringstream SS;
- WriteAsOperand(SS, CP->getConstVal(), false);
- Op += "<" + SS.str() + ">";
+ Op += '<';
+ {
+ raw_string_ostream OSS(Op);
+ WriteAsOperand(OSS, CP->getConstVal(), false);
+ }
+ Op += '>';
}
}
} else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(Node)) {
@@ -188,9 +194,10 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
Op += "(unknown)";
} else if (isa<PseudoSourceValue>(V)) {
// PseudoSourceValues don't have names, so use their print method.
- std::ostringstream SS;
- M->MO.getValue()->print(SS);
- Op += SS.str();
+ {
+ raw_string_ostream OSS(Op);
+ OSS << *M->MO.getValue();
+ }
} else {
Op += V->getName();
}
OpenPOWER on IntegriCloud