diff options
| author | Dan Gohman <gohman@apple.com> | 2008-07-17 21:12:16 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-07-17 21:12:16 +0000 |
| commit | 7168de78723f1f02579d4d4bdee21d297c07918d (patch) | |
| tree | feedbea8d25373b6d144fc0e8c21413bbf3a6dde | |
| parent | 1f32c759dc3f0674032843ba66f82dffc99ab102 (diff) | |
| download | bcm5719-llvm-7168de78723f1f02579d4d4bdee21d297c07918d.tar.gz bcm5719-llvm-7168de78723f1f02579d4d4bdee21d297c07918d.zip | |
When printing MemOperand nodes, only use print() for
PseudoSourceValue values, which never have names. Use getName()
for all other values, because we want to print just a short summary
of the value, not the entire instruction.
llvm-svn: 53738
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp index cdfdf6f9a22..a9b07afc90f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp @@ -19,6 +19,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/GraphWriter.h" @@ -155,13 +156,19 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node, else Op += "<null>"; } else if (const MemOperandSDNode *M = dyn_cast<MemOperandSDNode>(Node)) { - if (M->MO.getValue()) { + const Value *V = M->MO.getValue(); + Op += '<'; + if (!V) { + Op += "(unknown)"; + } else if (const PseudoSourceValue *PSV = dyn_cast<PseudoSourceValue>(V)) { + // PseudoSourceValues don't have names, so use their print method. std::ostringstream SS; M->MO.getValue()->print(SS); - Op += "<" + SS.str() + "+" + itostr(M->MO.getOffset()) + ">"; + Op += SS.str(); } else { - Op += "<(unknown)+" + itostr(M->MO.getOffset()) + ">"; + Op += V->getName(); } + Op += '+' + itostr(M->MO.getOffset()) + '>'; } else if (const ARG_FLAGSSDNode *N = dyn_cast<ARG_FLAGSSDNode>(Node)) { Op = Op + " AF=" + N->getArgFlags().getArgFlagsString(); } else if (const VTSDNode *N = dyn_cast<VTSDNode>(Node)) { |

