// Codegen the basic block.
#ifndef NDEBUG
- DEBUG(std::cerr << "===== Instruction selection begins:\n");
+ DOUT << "===== Instruction selection begins:\n";
Indent = 0;
#endif
DAG.setRoot(SelectRoot(DAG.getRoot()));
#ifndef NDEBUG
- DEBUG(std::cerr << "===== Instruction selection ends:\n");
+ DOUT << "===== Instruction selection ends:\n";
#endif
DAG.RemoveDeadNodes();
unsigned Opcode = Node->getOpcode();
#ifndef NDEBUG
- DEBUG(std::cerr << std::string(Indent, ' '));
- DEBUG(std::cerr << "Selecting: ");
+ DOUT << std::string(Indent, ' ') << "Selecting: ";
DEBUG(Node->dump(CurDAG));
- DEBUG(std::cerr << "\n");
+ DOUT << "\n";
Indent += 2;
#endif
if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER) {
#ifndef NDEBUG
- DEBUG(std::cerr << std::string(Indent-2, ' '));
- DEBUG(std::cerr << "== ");
+ DOUT << std::string(Indent-2, ' ') << "== ";
DEBUG(Node->dump(CurDAG));
- DEBUG(std::cerr << "\n");
+ DOUT << "\n";
Indent -= 2;
#endif
return NULL; // Already selected.
ReplaceUses(N1.getValue(1), Result.getValue(1));
#ifndef NDEBUG
- DEBUG(std::cerr << std::string(Indent-2, ' '));
- DEBUG(std::cerr << "=> ");
+ DOUT << std::string(Indent-2, ' ') << "=> ";
DEBUG(Result.Val->dump(CurDAG));
- DEBUG(std::cerr << "\n");
+ DOUT << "\n";
Indent -= 2;
#endif
return NULL;
ReplaceUses(N1.getValue(1), Result.getValue(1));
#ifndef NDEBUG
- DEBUG(std::cerr << std::string(Indent-2, ' '));
- DEBUG(std::cerr << "=> ");
+ DOUT << std::string(Indent-2, ' ') << "=> ";
DEBUG(Result.Val->dump(CurDAG));
- DEBUG(std::cerr << "\n");
+ DOUT << "\n";
Indent -= 2;
#endif
SDNode *ResNode = CurDAG->getTargetNode(Opc2, NVT, Tmp);
#ifndef NDEBUG
- DEBUG(std::cerr << std::string(Indent-2, ' '));
- DEBUG(std::cerr << "=> ");
+ DOUT << std::string(Indent-2, ' ') << "=> ";
DEBUG(ResNode->dump(CurDAG));
- DEBUG(std::cerr << "\n");
+ DOUT << "\n";
Indent -= 2;
#endif
return ResNode;
SDNode *ResNode = SelectCode(N);
#ifndef NDEBUG
- DEBUG(std::cerr << std::string(Indent-2, ' '));
- DEBUG(std::cerr << "=> ");
+ DOUT << std::string(Indent-2, ' ') << "=> ";
if (ResNode == NULL || ResNode == N.Val)
DEBUG(N.Val->dump(CurDAG));
else
DEBUG(ResNode->dump(CurDAG));
- DEBUG(std::cerr << "\n");
+ DOUT << "\n";
Indent -= 2;
#endif
#include "llvm/CodeGen/MachineCodeEmitter.h"
#include "llvm/Config/alloca.h"
#include <cstdlib>
-#include <iostream>
using namespace llvm;
#ifdef _MSC_VER
#else // Not an i386 host
void X86CompilationCallback() {
- std::cerr << "Cannot call X86CompilationCallback() on a non-x86 arch!\n";
+ assert(0 && "Cannot call X86CompilationCallback() on a non-x86 arch!\n");
abort();
}
#endif
RetAddr -= 4; // Backtrack to the reference itself...
#if 0
- DEBUG(std::cerr << "In callback! Addr=" << (void*)RetAddr
- << " ESP=" << (void*)StackPtr
- << ": Resolving call to function: "
- << TheVM->getFunctionReferencedName((void*)RetAddr) << "\n");
+ DOUT << "In callback! Addr=" << (void*)RetAddr
+ << " ESP=" << (void*)StackPtr
+ << ": Resolving call to function: "
+ << TheVM->getFunctionReferencedName((void*)RetAddr) << "\n";
#endif
// Sanity check to make sure this really is a call instruction.