#define LLVM_TARGET_TARGETMACHINEIMPLS_H
namespace llvm {
#define LLVM_TARGET_TARGETMACHINEIMPLS_H
namespace llvm {
+ /// Command line options shared between TargetMachine implementations -
+ /// these should go in their own header eventually.
+ ///
+ extern bool PrintMachineCode;
class TargetMachine;
class Module;
class TargetMachine;
class Module;
PM.add(createInstructionSchedulingWithSSAPass(*this));
PM.add(getRegisterAllocator(*this));
PM.add(createInstructionSchedulingWithSSAPass(*this));
PM.add(getRegisterAllocator(*this));
+
+ if (PrintMachineCode)
+ PM.add(createMachineFunctionPrinterPass(&std::cerr));
+
PM.add(createPrologEpilogInsertionPass());
if (!DisablePeephole)
PM.add(createPrologEpilogInsertionPass());
if (!DisablePeephole)
#include "llvm/Target/TargetMachine.h"
#include "llvm/Type.h"
#include "llvm/IntrinsicLowering.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Type.h"
#include "llvm/IntrinsicLowering.h"
+#include "Support/CommandLine.h"
+//---------------------------------------------------------------------------
+// Command-line options that tend to be useful on more than one back-end.
+//
+
+namespace llvm {
+ bool PrintMachineCode;
+};
+namespace {
+ cl::opt<bool, true> PrintCode("print-machineinstrs",
+ cl::desc("Print generated machine code"),
+ cl::location(PrintMachineCode), cl::init(false));
+};
+
//---------------------------------------------------------------------------
// TargetMachine Class
//
//---------------------------------------------------------------------------
// TargetMachine Class
//
using namespace llvm;
namespace {
using namespace llvm;
namespace {
- cl::opt<bool> PrintCode("print-machineinstrs",
- cl::desc("Print generated machine code"));
cl::opt<bool> NoPatternISel("disable-pattern-isel", cl::init(true),
cl::desc("Use the 'simple' X86 instruction selector"));
cl::opt<bool> NoSSAPeephole("disable-ssa-peephole", cl::init(true),
cl::opt<bool> NoPatternISel("disable-pattern-isel", cl::init(true),
cl::desc("Use the 'simple' X86 instruction selector"));
cl::opt<bool> NoSSAPeephole("disable-ssa-peephole", cl::init(true),
PM.add(createX86SSAPeepholeOptimizerPass());
// Print the instruction selected machine code...
PM.add(createX86SSAPeepholeOptimizerPass());
// Print the instruction selected machine code...
PM.add(createMachineFunctionPrinterPass(&std::cerr));
// Perform register allocation to convert to a concrete x86 representation
PM.add(createRegisterAllocator());
PM.add(createMachineFunctionPrinterPass(&std::cerr));
// Perform register allocation to convert to a concrete x86 representation
PM.add(createRegisterAllocator());
PM.add(createMachineFunctionPrinterPass(&std::cerr));
PM.add(createX86FloatingPointStackifierPass());
PM.add(createMachineFunctionPrinterPass(&std::cerr));
PM.add(createX86FloatingPointStackifierPass());
PM.add(createMachineFunctionPrinterPass(&std::cerr));
// Insert prolog/epilog code. Eliminate abstract frame index references...
PM.add(createMachineFunctionPrinterPass(&std::cerr));
// Insert prolog/epilog code. Eliminate abstract frame index references...
PM.add(createX86PeepholeOptimizerPass());
PM.add(createX86PeepholeOptimizerPass());
- if (PrintCode) // Print the register-allocated code
+ if (PrintMachineCode) // Print the register-allocated code
PM.add(createX86CodePrinterPass(std::cerr, *this));
if (!DisableOutput)
PM.add(createX86CodePrinterPass(std::cerr, *this));
if (!DisableOutput)
// FIXME: Add SSA based peephole optimizer here.
// Print the instruction selected machine code...
// FIXME: Add SSA based peephole optimizer here.
// Print the instruction selected machine code...
PM.add(createMachineFunctionPrinterPass(&std::cerr));
// Perform register allocation to convert to a concrete x86 representation
PM.add(createRegisterAllocator());
PM.add(createMachineFunctionPrinterPass(&std::cerr));
// Perform register allocation to convert to a concrete x86 representation
PM.add(createRegisterAllocator());
PM.add(createMachineFunctionPrinterPass(&std::cerr));
PM.add(createX86FloatingPointStackifierPass());
PM.add(createMachineFunctionPrinterPass(&std::cerr));
PM.add(createX86FloatingPointStackifierPass());
PM.add(createMachineFunctionPrinterPass(&std::cerr));
// Insert prolog/epilog code. Eliminate abstract frame index references...
PM.add(createMachineFunctionPrinterPass(&std::cerr));
// Insert prolog/epilog code. Eliminate abstract frame index references...
PM.add(createX86PeepholeOptimizerPass());
PM.add(createX86PeepholeOptimizerPass());
- if (PrintCode) // Print the register-allocated code
+ if (PrintMachineCode) // Print the register-allocated code
PM.add(createX86CodePrinterPass(std::cerr, TM));
}
PM.add(createX86CodePrinterPass(std::cerr, TM));
}