ShortAl, ByteAl) { }
public:
virtual ~TargetMachine() {}
-
+
//
// Interfaces to the major aspects of target machine information:
// -- Instruction opcode and operand information
/// addPassesToEmitAssembly - Add passes to the specified pass manager to get
/// assembly langage code emited. Typically this will involve several steps
- /// of code generation.
+ /// of code generation. This method should return true if code generation is
+ /// not supported.
///
- virtual void addPassesToEmitAssembly(PassManager &PM, std::ostream &Out) = 0;
+ virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out) {
+ return true;
+ }
/// addPassesToJITCompile - Add passes to the specified pass manager to
/// implement a fast dynamic compiler for this target. Return true if this is
virtual const MachineCacheInfo &getCacheInfo() const { return cacheInfo; }
virtual const MachineOptInfo &getOptInfo() const { return optInfo; }
- virtual void addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
+ virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
// getPrologEpilogCodeInserter - Inserts prolog/epilog code.
virtual Pass* getPrologEpilogInsertionPass();
// addPassesToEmitAssembly - This method controls the entire code generation
// process for the ultra sparc.
//
-void UltraSparc::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out)
+bool UltraSparc::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out)
{
// Construct and initialize the MachineFunction object for this fn.
PM.add(createMachineCodeConstructionPass(*this));
// Emit bytecode to the assembly file into its special section next
PM.add(getEmitBytecodeToAsmPass(Out));
PM.add(getFunctionInfo(Out));
+ return false;
}
}
}
- Target.addPassesToEmitAssembly(Passes, *Out);
-
- // Run our queue of passes all at once now, efficiently.
- Passes.run(*M.get());
+ // Ask the target to add backend passes as neccesary
+ if (Target.addPassesToEmitAssembly(Passes, *Out)) {
+ cerr << argv[0] << ": target '" << Target.TargetName
+ << " does not support static compilation!\n";
+ } else {
+ // Run our queue of passes all at once now, efficiently.
+ Passes.run(*M.get());
+ }
// Delete the ostream if it's not a stdout stream
if (Out != &std::cout) delete Out;