Nicer code. :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26111 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2006-02-10 22:46:26 +00:00
parent f597dc78f8
commit 23addc061c

View File

@ -145,7 +145,9 @@ namespace {
return CurDAG->getTargetConstant(Imm, MVT::i32); return CurDAG->getTargetConstant(Imm, MVT::i32);
} }
std::string Indent; #ifndef NDEBUG
unsigned Indent;
#endif
}; };
} }
@ -158,7 +160,7 @@ void X86DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
// Codegen the basic block. // Codegen the basic block.
#ifndef NDEBUG #ifndef NDEBUG
DEBUG(std::cerr << "===== Instruction selection begins:\n"); DEBUG(std::cerr << "===== Instruction selection begins:\n");
Indent = ""; Indent = 0;
#endif #endif
DAG.setRoot(SelectRoot(DAG.getRoot())); DAG.setRoot(SelectRoot(DAG.getRoot()));
#ifndef NDEBUG #ifndef NDEBUG
@ -462,22 +464,21 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) {
unsigned Opcode = Node->getOpcode(); unsigned Opcode = Node->getOpcode();
#ifndef NDEBUG #ifndef NDEBUG
std::string IndentSave = Indent; DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << Indent);
DEBUG(std::cerr << "Selecting: "); DEBUG(std::cerr << "Selecting: ");
DEBUG(Node->dump(CurDAG)); DEBUG(Node->dump(CurDAG));
DEBUG(std::cerr << "\n"); DEBUG(std::cerr << "\n");
Indent += " "; Indent += 2;
#endif #endif
if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER) { if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER) {
Result = N; Result = N;
#ifndef NDEBUG #ifndef NDEBUG
DEBUG(std::cerr << Indent); DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "== "); DEBUG(std::cerr << "== ");
DEBUG(Node->dump(CurDAG)); DEBUG(Node->dump(CurDAG));
DEBUG(std::cerr << "\n"); DEBUG(std::cerr << "\n");
Indent = IndentSave; Indent -= 2;
#endif #endif
return; // Already selected. return; // Already selected.
} }
@ -486,11 +487,11 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) {
if (CGMI != CodeGenMap.end()) { if (CGMI != CodeGenMap.end()) {
Result = CGMI->second; Result = CGMI->second;
#ifndef NDEBUG #ifndef NDEBUG
DEBUG(std::cerr << Indent); DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "== "); DEBUG(std::cerr << "== ");
DEBUG(Result.Val->dump(CurDAG)); DEBUG(Result.Val->dump(CurDAG));
DEBUG(std::cerr << "\n"); DEBUG(std::cerr << "\n");
Indent = IndentSave; Indent -= 2;
#endif #endif
return; return;
} }
@ -573,11 +574,11 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) {
} }
#ifndef NDEBUG #ifndef NDEBUG
DEBUG(std::cerr << Indent); DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "== "); DEBUG(std::cerr << "== ");
DEBUG(Result.Val->dump(CurDAG)); DEBUG(Result.Val->dump(CurDAG));
DEBUG(std::cerr << "\n"); DEBUG(std::cerr << "\n");
Indent = IndentSave; Indent -= 2;
#endif #endif
return; return;
} }
@ -681,11 +682,11 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) {
} }
#ifndef NDEBUG #ifndef NDEBUG
DEBUG(std::cerr << Indent); DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "== "); DEBUG(std::cerr << "== ");
DEBUG(Result.Val->dump(CurDAG)); DEBUG(Result.Val->dump(CurDAG));
DEBUG(std::cerr << "\n"); DEBUG(std::cerr << "\n");
Indent = IndentSave; Indent -= 2;
#endif #endif
return; return;
} }
@ -720,11 +721,11 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) {
SDOperand(CurDAG->getTargetNode(Opc, VT, Result), 0); SDOperand(CurDAG->getTargetNode(Opc, VT, Result), 0);
#ifndef NDEBUG #ifndef NDEBUG
DEBUG(std::cerr << Indent); DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "== "); DEBUG(std::cerr << "== ");
DEBUG(Result.Val->dump(CurDAG)); DEBUG(Result.Val->dump(CurDAG));
DEBUG(std::cerr << "\n"); DEBUG(std::cerr << "\n");
Indent = IndentSave; Indent -= 2;
#endif #endif
return; return;
} }
@ -732,11 +733,11 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) {
SelectCode(Result, N); SelectCode(Result, N);
#ifndef NDEBUG #ifndef NDEBUG
DEBUG(std::cerr << Indent); DEBUG(std::cerr << std::string(Indent, ' '));
DEBUG(std::cerr << "=> "); DEBUG(std::cerr << "=> ");
DEBUG(Result.Val->dump(CurDAG)); DEBUG(Result.Val->dump(CurDAG));
DEBUG(std::cerr << "\n"); DEBUG(std::cerr << "\n");
Indent = IndentSave; Indent -= 2;
#endif #endif
} }