[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
Evan Cheng
evan.cheng at apple.com
Fri Feb 10 14:46:38 PST 2006
Changes in directory llvm/lib/Target/X86:
X86ISelDAGToDAG.cpp updated: 1.47 -> 1.48
---
Log message:
Nicer code. :-)
---
Diffs of the changes: (+18 -17)
X86ISelDAGToDAG.cpp | 35 ++++++++++++++++++-----------------
1 files changed, 18 insertions(+), 17 deletions(-)
Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.47 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.48
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.47 Fri Feb 10 16:24:32 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Fri Feb 10 16:46:26 2006
@@ -145,7 +145,9 @@
return CurDAG->getTargetConstant(Imm, MVT::i32);
}
- std::string Indent;
+#ifndef NDEBUG
+ unsigned Indent;
+#endif
};
}
@@ -158,7 +160,7 @@
// Codegen the basic block.
#ifndef NDEBUG
DEBUG(std::cerr << "===== Instruction selection begins:\n");
- Indent = "";
+ Indent = 0;
#endif
DAG.setRoot(SelectRoot(DAG.getRoot()));
#ifndef NDEBUG
@@ -462,22 +464,21 @@
unsigned Opcode = Node->getOpcode();
#ifndef NDEBUG
- std::string IndentSave = Indent;
- DEBUG(std::cerr << Indent);
+ DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "Selecting: ");
DEBUG(Node->dump(CurDAG));
DEBUG(std::cerr << "\n");
- Indent += " ";
+ Indent += 2;
#endif
if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER) {
Result = N;
#ifndef NDEBUG
- DEBUG(std::cerr << Indent);
+ DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "== ");
DEBUG(Node->dump(CurDAG));
DEBUG(std::cerr << "\n");
- Indent = IndentSave;
+ Indent -= 2;
#endif
return; // Already selected.
}
@@ -486,11 +487,11 @@
if (CGMI != CodeGenMap.end()) {
Result = CGMI->second;
#ifndef NDEBUG
- DEBUG(std::cerr << Indent);
+ DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "== ");
DEBUG(Result.Val->dump(CurDAG));
DEBUG(std::cerr << "\n");
- Indent = IndentSave;
+ Indent -= 2;
#endif
return;
}
@@ -573,11 +574,11 @@
}
#ifndef NDEBUG
- DEBUG(std::cerr << Indent);
+ DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "== ");
DEBUG(Result.Val->dump(CurDAG));
DEBUG(std::cerr << "\n");
- Indent = IndentSave;
+ Indent -= 2;
#endif
return;
}
@@ -681,11 +682,11 @@
}
#ifndef NDEBUG
- DEBUG(std::cerr << Indent);
+ DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "== ");
DEBUG(Result.Val->dump(CurDAG));
DEBUG(std::cerr << "\n");
- Indent = IndentSave;
+ Indent -= 2;
#endif
return;
}
@@ -720,11 +721,11 @@
SDOperand(CurDAG->getTargetNode(Opc, VT, Result), 0);
#ifndef NDEBUG
- DEBUG(std::cerr << Indent);
+ DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "== ");
DEBUG(Result.Val->dump(CurDAG));
DEBUG(std::cerr << "\n");
- Indent = IndentSave;
+ Indent -= 2;
#endif
return;
}
@@ -732,11 +733,11 @@
SelectCode(Result, N);
#ifndef NDEBUG
- DEBUG(std::cerr << Indent);
+ DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "=> ");
DEBUG(Result.Val->dump(CurDAG));
DEBUG(std::cerr << "\n");
- Indent = IndentSave;
+ Indent -= 2;
#endif
}
More information about the llvm-commits
mailing list