return CurDAG->getTargetConstant(Imm, MVT::i32);
}
- std::string Indent;
+#ifndef NDEBUG
+ unsigned Indent;
+#endif
};
}
// Codegen the basic block.
#ifndef NDEBUG
DEBUG(std::cerr << "===== Instruction selection begins:\n");
- Indent = "";
+ Indent = 0;
#endif
DAG.setRoot(SelectRoot(DAG.getRoot()));
#ifndef NDEBUG
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.
}
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;
}
}
#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;
}
}
#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;
}
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;
}
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
}