mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 08:46:23 +00:00
Nicer code. :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26111 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f597dc78f8
commit
23addc061c
@ -145,7 +145,9 @@ namespace {
|
||||
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.
|
||||
#ifndef NDEBUG
|
||||
DEBUG(std::cerr << "===== Instruction selection begins:\n");
|
||||
Indent = "";
|
||||
Indent = 0;
|
||||
#endif
|
||||
DAG.setRoot(SelectRoot(DAG.getRoot()));
|
||||
#ifndef NDEBUG
|
||||
@ -462,22 +464,21 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) {
|
||||
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 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) {
|
||||
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 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand 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
|
||||
return;
|
||||
}
|
||||
@ -681,11 +682,11 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand 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
|
||||
return;
|
||||
}
|
||||
@ -720,11 +721,11 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) {
|
||||
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 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) {
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user