#endif
}
-AlphaTargetMachine::AlphaTargetMachine(const Module &M, IntrinsicLowering *IL,
- const std::string &FS)
- : TargetMachine("alpha", IL, true),
+AlphaTargetMachine::AlphaTargetMachine(const Module &M, const std::string &FS)
+ : TargetMachine("alpha", true),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
JITInfo(*this),
Subtarget(M, FS)
namespace llvm {
class GlobalValue;
-class IntrinsicLowering;
class AlphaTargetMachine : public TargetMachine {
AlphaInstrInfo InstrInfo;
AlphaSubtarget Subtarget;
public:
- AlphaTargetMachine(const Module &M, IntrinsicLowering *IL,
- const std::string &FS);
+ AlphaTargetMachine(const Module &M, const std::string &FS);
virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
/// module to a C translation unit.
class CWriter : public FunctionPass, public InstVisitor<CWriter> {
std::ostream &Out;
- IntrinsicLowering &IL;
+ DefaultIntrinsicLowering IL;
Mangler *Mang;
LoopInfo *LI;
const Module *TheModule;
std::map<const ConstantFP *, unsigned> FPConstantMap;
public:
- CWriter(std::ostream &o, IntrinsicLowering &il) : Out(o), IL(il) {}
+ CWriter(std::ostream &o) : Out(o) {}
virtual const char *getPassName() const { return "C backend"; }
PM.add(createLowerInvokePass());
PM.add(createCFGSimplificationPass()); // clean up after lower invoke.
PM.add(new CBackendNameAllUsedStructsAndMergeFunctions());
- PM.add(new CWriter(o, getIntrinsicLowering()));
+ PM.add(new CWriter(o));
return false;
}
#include "llvm/Target/TargetMachine.h"
namespace llvm {
-class IntrinsicLowering;
struct CTargetMachine : public TargetMachine {
- CTargetMachine(const Module &M, IntrinsicLowering *IL,
- const std::string &FS) :
- TargetMachine("CBackend", IL, M) {}
+ CTargetMachine(const Module &M, const std::string &FS)
+ : TargetMachine("CBackend", M) {}
// This is the only thing that actually does anything here.
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
/// module to a C translation unit.
class CWriter : public FunctionPass, public InstVisitor<CWriter> {
std::ostream &Out;
- IntrinsicLowering &IL;
+ DefaultIntrinsicLowering IL;
Mangler *Mang;
LoopInfo *LI;
const Module *TheModule;
std::map<const ConstantFP *, unsigned> FPConstantMap;
public:
- CWriter(std::ostream &o, IntrinsicLowering &il) : Out(o), IL(il) {}
+ CWriter(std::ostream &o) : Out(o) {}
virtual const char *getPassName() const { return "C backend"; }
PM.add(createLowerInvokePass());
PM.add(createCFGSimplificationPass()); // clean up after lower invoke.
PM.add(new CBackendNameAllUsedStructsAndMergeFunctions());
- PM.add(new CWriter(o, getIntrinsicLowering()));
+ PM.add(new CWriter(o));
return false;
}
#include "IA64.h"
#include "llvm/Module.h"
#include "llvm/PassManager.h"
-#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetOptions.h"
/// IA64TargetMachine ctor - Create an LP64 architecture model
///
-IA64TargetMachine::IA64TargetMachine(const Module &M, IntrinsicLowering *IL,
- const std::string &FS)
- : TargetMachine("IA64", IL, true),
+IA64TargetMachine::IA64TargetMachine(const Module &M, const std::string &FS)
+ : TargetMachine("IA64", true),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
TLInfo(*this) { // FIXME? check this stuff
}
#include "IA64ISelLowering.h"
namespace llvm {
-class IntrinsicLowering;
class IA64TargetMachine : public TargetMachine {
IA64InstrInfo InstrInfo;
//IA64JITInfo JITInfo;
IA64TargetLowering TLInfo;
public:
- IA64TargetMachine(const Module &M, IntrinsicLowering *IL,
- const std::string &FS);
+ IA64TargetMachine(const Module &M, const std::string &FS);
virtual const IA64InstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Analysis/Verifier.h"
-#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetOptions.h"
return getJITMatchQuality()/2;
}
-PPCTargetMachine::PPCTargetMachine(const Module &M, IntrinsicLowering *IL,
- const std::string &FS)
-: TargetMachine("PowerPC", IL, false, 4, 4, 4, 4, 4, 4, 2, 1, 1),
+PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS)
+: TargetMachine("PowerPC", false, 4, 4, 4, 4, 4, 4, 2, 1, 1),
Subtarget(M, FS), FrameInfo(*this, false), JITInfo(*this),
TLInfo(*this), InstrItins(Subtarget.getInstrItineraryData()) {
if (TargetDefault == PPCTarget) {
namespace llvm {
class PassManager;
-class IntrinsicLowering;
class GlobalValue;
-class IntrinsicLowering;
class PPCTargetMachine : public TargetMachine {
PPCInstrInfo InstrInfo;
PPCTargetLowering TLInfo;
InstrItineraryData InstrItins;
public:
- PPCTargetMachine(const Module &M, IntrinsicLowering *IL,
- const std::string &FS);
+ PPCTargetMachine(const Module &M, const std::string &FS);
virtual const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
/// SparcTargetMachine ctor - Create an ILP32 architecture model
///
-SparcTargetMachine::SparcTargetMachine(const Module &M, IntrinsicLowering *IL,
- const std::string &FS)
- : TargetMachine("Sparc", IL, false, 4, 4),
+SparcTargetMachine::SparcTargetMachine(const Module &M, const std::string &FS)
+ : TargetMachine("Sparc", false, 4, 4),
Subtarget(M, FS), InstrInfo(Subtarget),
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
}
namespace llvm {
-class IntrinsicLowering;
class Module;
class SparcTargetMachine : public TargetMachine {
SparcInstrInfo InstrInfo;
TargetFrameInfo FrameInfo;
public:
- SparcTargetMachine(const Module &M, IntrinsicLowering *IL,
- const std::string &FS);
+ SparcTargetMachine(const Module &M, const std::string &FS);
virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
//==------------------------------------------------------------------------==//
bool V9ISel::runOnFunction(Function &F) {
+ DefaultIntrinsicLowering IL;
// First pass - Walk the function, lowering any calls to intrinsic functions
// which the instruction selector cannot handle.
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
default:
// All other intrinsic calls we must lower.
Instruction *Before = CI->getPrev();
- Target.getIntrinsicLowering().LowerIntrinsicCall(CI);
+ IL.LowerIntrinsicCall(CI);
if (Before) { // Move iterator to instruction after call
I = Before; ++I;
} else {
#include "llvm/PassManager.h"
#include "llvm/Assembly/PrintModulePass.h"
#include "llvm/CodeGen/InstrScheduling.h"
-#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetOptions.h"
}
-SparcV9TargetMachine::SparcV9TargetMachine(const Module &M,
- IntrinsicLowering *il,
+SparcV9TargetMachine::SparcV9TargetMachine(const Module &M,
const std::string &FS)
- : TargetMachine("UltraSparcV9-Native", il, false),
+ : TargetMachine("UltraSparcV9-Native", false),
schedInfo(*this),
regInfo(*this),
frameInfo(*this),
SparcV9FrameInfo frameInfo;
SparcV9JITInfo jitInfo;
public:
- SparcV9TargetMachine(const Module &M, IntrinsicLowering *IL,
- const std::string &FS);
+ SparcV9TargetMachine(const Module &M, const std::string &FS);
virtual const TargetInstrInfo *getInstrInfo() const { return &instrInfo; }
virtual const TargetSchedInfo *getSchedInfo() const { return &schedInfo; }
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Type.h"
-#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
//---------------------------------------------------------------------------
// TargetMachine Class
//
-TargetMachine::TargetMachine(const std::string &name, IntrinsicLowering *il,
- bool LittleEndian,
+TargetMachine::TargetMachine(const std::string &name, bool LittleEndian,
unsigned char PtrSize, unsigned char PtrAl,
unsigned char DoubleAl, unsigned char FloatAl,
unsigned char LongAl, unsigned char IntAl,
: Name(name), DataLayout(name, LittleEndian,
PtrSize, PtrAl, DoubleAl, FloatAl, LongAl,
IntAl, ShortAl, ByteAl, BoolAl) {
- IL = il ? il : new DefaultIntrinsicLowering();
}
-TargetMachine::TargetMachine(const std::string &name, IntrinsicLowering *il,
- const TargetData &TD)
+TargetMachine::TargetMachine(const std::string &name, const TargetData &TD)
: Name(name), DataLayout(TD) {
- IL = il ? il : new DefaultIntrinsicLowering();
}
-TargetMachine::TargetMachine(const std::string &name, IntrinsicLowering *il,
- const Module &M)
+TargetMachine::TargetMachine(const std::string &name, const Module &M)
: Name(name), DataLayout(name, &M) {
- IL = il ? il : new DefaultIntrinsicLowering();
}
TargetMachine::~TargetMachine() {
- delete IL;
}
/// getRelocationModel - Returns the code generation relocation model. The
#include "X86.h"
#include "llvm/Module.h"
#include "llvm/PassManager.h"
-#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetOptions.h"
/// X86TargetMachine ctor - Create an ILP32 architecture model
///
-X86TargetMachine::X86TargetMachine(const Module &M,
- IntrinsicLowering *IL,
- const std::string &FS)
- : TargetMachine("X86", IL, true, 4, 4, 4, 4, 4),
+X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS)
+ : TargetMachine("X86", true, 4, 4, 4, 4, 4),
Subtarget(M, FS),
FrameInfo(TargetFrameInfo::StackGrowsDown,
Subtarget.getStackAlignment(), -4),
#include "X86ISelLowering.h"
namespace llvm {
-class IntrinsicLowering;
class X86TargetMachine : public TargetMachine {
X86InstrInfo InstrInfo;
X86JITInfo JITInfo;
X86TargetLowering TLInfo;
public:
- X86TargetMachine(const Module &M, IntrinsicLowering *IL,
- const std::string &FS);
+ X86TargetMachine(const Module &M, const std::string &FS);
virtual const X86InstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }