[llvm-commits] [llvm] r59279 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
Dan Gohman
gohman at apple.com
Thu Nov 13 16:28:56 PST 2008
Author: djg
Date: Thu Nov 13 18:28:56 2008
New Revision: 59279
URL: http://llvm.org/viewvc/llvm-project?rev=59279&view=rev
Log:
Debug printing for SUnits that carry MachineInstrs.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=59279&r1=59278&r2=59279&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Thu Nov 13 18:28:56 2008
@@ -446,17 +446,24 @@
const ScheduleDAG *G) {
std::string Op;
- if (!SU->getNode())
- Op = "<CROSS RC COPY>";
- else {
- SmallVector<SDNode *, 4> FlaggedNodes;
- for (SDNode *N = SU->getNode(); N; N = N->getFlaggedNode())
- FlaggedNodes.push_back(N);
- while (!FlaggedNodes.empty()) {
- Op += DOTGraphTraits<SelectionDAG*>::getNodeLabel(FlaggedNodes.back(),
- G->DAG) + "\n";
- FlaggedNodes.pop_back();
+ if (G->DAG) {
+ if (!SU->getNode())
+ Op = "<CROSS RC COPY>";
+ else {
+ SmallVector<SDNode *, 4> FlaggedNodes;
+ for (SDNode *N = SU->getNode(); N; N = N->getFlaggedNode())
+ FlaggedNodes.push_back(N);
+ while (!FlaggedNodes.empty()) {
+ Op += DOTGraphTraits<SelectionDAG*>::getNodeLabel(FlaggedNodes.back(),
+ G->DAG) + "\n";
+ FlaggedNodes.pop_back();
+ }
}
+ } else {
+ std::string s;
+ raw_string_ostream oss(s);
+ SU->MI->print(oss);
+ Op += oss.str();
}
return Op;
More information about the llvm-commits
mailing list