FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) //TODO: check these
{}
-/// addPassesToEmitAssembly - Add passes to the specified pass manager
-/// to implement a static compiler for this target.
+/// addPassesToEmitFile - Add passes to the specified pass manager to implement
+/// a static compiler for this target.
///
-bool AlphaTargetMachine::addPassesToEmitAssembly(PassManager &PM,
- std::ostream &Out) {
+bool AlphaTargetMachine::addPassesToEmitFile(PassManager &PM,
+ std::ostream &Out,
+ CodeGenFileType FileType) {
+ if (FileType != TargetMachine::AssemblyFile) return true;
if (EnableAlphaLSR) {
PM.add(createLoopStrengthReducePass());
return &InstrInfo.getRegisterInfo();
}
- virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
+ virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+ CodeGenFileType FileType);
static unsigned getModuleMatchQuality(const Module &M);
};
// External Interface declaration
//===----------------------------------------------------------------------===//
-bool CTargetMachine::addPassesToEmitAssembly(PassManager &PM, std::ostream &o) {
+bool CTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o,
+ CodeGenFileType FileType) {
+ if (FileType != TargetMachine::AssemblyFile) return true;
+
PM.add(createLowerGCPass());
PM.add(createLowerAllocationsPass(true));
PM.add(createLowerInvokePass());
PM.add(new CWriter(o, getIntrinsicLowering()));
return false;
}
-
-// vim: sw=2
TargetMachine("CBackend", IL, M) {}
// This is the only thing that actually does anything here.
- virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
+ virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+ CodeGenFileType FileType);
// This class always works, but shouldn't be the default in most cases.
static unsigned getModuleMatchQuality(const Module &M) { return 1; }
// External Interface declaration
//===----------------------------------------------------------------------===//
-bool CTargetMachine::addPassesToEmitAssembly(PassManager &PM, std::ostream &o) {
+bool CTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o,
+ CodeGenFileType FileType) {
+ if (FileType != TargetMachine::AssemblyFile) return true;
+
PM.add(createLowerGCPass());
PM.add(createLowerAllocationsPass(true));
PM.add(createLowerInvokePass());
PM.add(new CWriter(o, getIntrinsicLowering()));
return false;
}
-
-// vim: sw=2
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0) { // FIXME? check this stuff
}
-// addPassesToEmitAssembly - We currently use all of the same passes as the JIT
+// addPassesToEmitFile - We currently use all of the same passes as the JIT
// does to emit statically compiled machine code.
-bool IA64TargetMachine::addPassesToEmitAssembly(PassManager &PM,
- std::ostream &Out) {
+bool IA64TargetMachine::addPassesToEmitFile(PassManager &PM,
+ std::ostream &Out,
+ CodeGenFileType FileType) {
+ if (FileType != TargetMachine::AssemblyFile) return true;
+
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());
return &InstrInfo.getRegisterInfo();
}
- virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
+ virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+ CodeGenFileType FileType);
static unsigned getModuleMatchQuality(const Module &M);
static unsigned compileTimeMatchQuality(void);
#endif
}
-/// addPassesToEmitAssembly - Add passes to the specified pass manager
-/// to implement a static compiler for this target.
+/// addPassesToEmitFile - Add passes to the specified pass manager to implement
+/// a static compiler for this target.
///
-bool PowerPCTargetMachine::addPassesToEmitAssembly(PassManager &PM,
- std::ostream &Out) {
+bool PowerPCTargetMachine::addPassesToEmitFile(PassManager &PM,
+ std::ostream &Out,
+ CodeGenFileType FileType) {
+ if (FileType != TargetMachine::AssemblyFile) return true;
+
bool LP64 = (0 != dynamic_cast<PPC64TargetMachine *>(this));
if (EnablePPCLSR) {
public:
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
- virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
+ virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+ CodeGenFileType FileType);
};
} // end namespace llvm
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, -4), JITInfo(*this) {
}
-/// addPassesToEmitAssembly - Add passes to the specified pass manager
+/// addPassesToEmitFile - Add passes to the specified pass manager
/// to implement a static compiler for this target.
///
-bool SkeletonTargetMachine::addPassesToEmitAssembly(PassManager &PM,
- std::ostream &Out) {
+bool SkeletonTargetMachine::addPassesToEmitFile(PassManager &PM,
+ std::ostream &Out,
+ CodeGenFileType FileType) {
+ if (FileType != TargetMachine::AssemblyFile) return true;
// <insert instruction selector passes here>
PM.add(createRegisterAllocator());
PM.add(createPrologEpilogCodeInserter());
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);
- virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
+ virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+ CodeGenFileType FileType);
};
} // end namespace llvm
return getJITMatchQuality()/2;
}
-/// addPassesToEmitAssembly - Add passes to the specified pass manager
+/// addPassesToEmitFile - Add passes to the specified pass manager
/// to implement a static compiler for this target.
///
-bool SparcV8TargetMachine::addPassesToEmitAssembly(PassManager &PM,
- std::ostream &Out) {
+bool SparcV8TargetMachine::addPassesToEmitFile(PassManager &PM,
+ std::ostream &Out,
+ CodeGenFileType FileType) {
+ if (FileType != TargetMachine::AssemblyFile) return true;
+
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);
- virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
+ virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+ CodeGenFileType FileType);
};
} // end namespace llvm
return getJITMatchQuality()/2;
}
-/// addPassesToEmitAssembly - Add passes to the specified pass manager
+/// addPassesToEmitFile - Add passes to the specified pass manager
/// to implement a static compiler for this target.
///
-bool SparcV8TargetMachine::addPassesToEmitAssembly(PassManager &PM,
- std::ostream &Out) {
+bool SparcV8TargetMachine::addPassesToEmitFile(PassManager &PM,
+ std::ostream &Out,
+ CodeGenFileType FileType) {
+ if (FileType != TargetMachine::AssemblyFile) return true;
+
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);
- virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
+ virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+ CodeGenFileType FileType);
};
} // end namespace llvm
jitInfo(*this) {
}
-/// addPassesToEmitAssembly - This method controls the entire code generation
+/// addPassesToEmitFile - This method controls the entire code generation
/// process for the ultra sparc.
///
bool
-SparcV9TargetMachine::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out)
-{
+SparcV9TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+ CodeGenFileType FileType) {
+ if (FileType != TargetMachine::AssemblyFile) return true;
+
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());
return &instrInfo.getRegisterInfo();
}
- virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
+ virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+ CodeGenFileType FileType);
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);
}
-// addPassesToEmitAssembly - We currently use all of the same passes as the JIT
+// addPassesToEmitFile - We currently use all of the same passes as the JIT
// does to emit statically compiled machine code.
-bool X86TargetMachine::addPassesToEmitAssembly(PassManager &PM,
- std::ostream &Out) {
+bool X86TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+ CodeGenFileType FileType) {
+ if (FileType != TargetMachine::AssemblyFile) return true;
+
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);
- virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
+ virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+ CodeGenFileType FileType);
static unsigned getModuleMatchQuality(const Module &M);
static unsigned getJITMatchQuality();