#include "llvm/Support/Mangler.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetOptions.h"
using namespace llvm;
/// getSectionForFunction - Return the section that we should emit the
using namespace llvm;
/// getSectionForFunction - Return the section that we should emit the
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Target/TargetOptions.h"
using namespace llvm;
namespace {
using namespace llvm;
namespace {
default:
assert(0 && "psuedo instructions should be removed before code emission");
case TargetInstrInfo::INLINEASM:
default:
assert(0 && "psuedo instructions should be removed before code emission");
case TargetInstrInfo::INLINEASM:
- std::cerr << "JIT does not support inline asm!\n";
- abort();
+ assert(0 && "JIT does not support inline asm!\n");
case X86::IMPLICIT_USE:
case X86::IMPLICIT_DEF:
case X86::IMPLICIT_DEF_GR8:
case X86::IMPLICIT_USE:
case X86::IMPLICIT_DEF:
case X86::IMPLICIT_DEF_GR8:
// Codegen the basic block.
#ifndef NDEBUG
// 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
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();
#endif
DAG.RemoveDeadNodes();
unsigned Opcode = Node->getOpcode();
#ifndef NDEBUG
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(Node->dump(CurDAG));
- DEBUG(std::cerr << "\n");
Indent += 2;
#endif
if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER) {
#ifndef NDEBUG
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(Node->dump(CurDAG));
- DEBUG(std::cerr << "\n");
Indent -= 2;
#endif
return NULL; // Already selected.
Indent -= 2;
#endif
return NULL; // Already selected.
ReplaceUses(N1.getValue(1), Result.getValue(1));
#ifndef NDEBUG
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(Result.Val->dump(CurDAG));
- DEBUG(std::cerr << "\n");
Indent -= 2;
#endif
return NULL;
Indent -= 2;
#endif
return NULL;
ReplaceUses(N1.getValue(1), Result.getValue(1));
#ifndef NDEBUG
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(Result.Val->dump(CurDAG));
- DEBUG(std::cerr << "\n");
SDNode *ResNode = CurDAG->getTargetNode(Opc2, NVT, Tmp);
#ifndef NDEBUG
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(ResNode->dump(CurDAG));
- DEBUG(std::cerr << "\n");
Indent -= 2;
#endif
return ResNode;
Indent -= 2;
#endif
return ResNode;
SDNode *ResNode = SelectCode(N);
#ifndef NDEBUG
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));
if (ResNode == NULL || ResNode == N.Val)
DEBUG(N.Val->dump(CurDAG));
else
DEBUG(ResNode->dump(CurDAG));
- DEBUG(std::cerr << "\n");
#include "llvm/CodeGen/MachineCodeEmitter.h"
#include "llvm/Config/alloca.h"
#include <cstdlib>
#include "llvm/CodeGen/MachineCodeEmitter.h"
#include "llvm/Config/alloca.h"
#include <cstdlib>
using namespace llvm;
#ifdef _MSC_VER
using namespace llvm;
#ifdef _MSC_VER
#else // Not an i386 host
void X86CompilationCallback() {
#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");
RetAddr -= 4; // Backtrack to the reference itself...
#if 0
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.
#endif
// Sanity check to make sure this really is a call instruction.
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetMachineRegistry.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetMachineRegistry.h"
#include "llvm/Transforms/Scalar.h"
using namespace llvm;
/// X86TargetMachineModule - Note that this is used on hosts that cannot link
using namespace llvm;
/// X86TargetMachineModule - Note that this is used on hosts that cannot link