Debug printing for SUnits that carry MachineInstrs.

llvm-svn: 59279
This commit is contained in:
Dan Gohman 2008-11-14 00:28:56 +00:00
parent f92f2d0c97
commit ad452993b0

View File

@ -446,17 +446,24 @@ std::string DOTGraphTraits<ScheduleDAG*>::getNodeLabel(const SUnit *SU,
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;