Add an "alignment" field to the MachineFunction object. It makes more sense to
[oota-llvm.git] / lib / Target / PIC16 / PIC16TargetMachine.cpp
index 9c52ee54f20635811f8cdb451cfd37e68e6cb059..43047327663ebbb8d1bd52e350a1c57897a97fc4 100644 (file)
@@ -37,6 +37,9 @@ X("pic16", "PIC16 14-bit [experimental].");
 static RegisterTarget<CooperTargetMachine> 
 Y("cooper", "PIC16 Cooper [experimental].");
 
+// Force static initialization.
+extern "C" void LLVMInitializePIC16Target() { }
+
 // PIC16TargetMachine - Traditional PIC16 Machine.
 PIC16TargetMachine::PIC16TargetMachine(const Module &M, const std::string &FS,
                                        bool Cooper)
@@ -70,4 +73,10 @@ addAssemblyEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
   return false;
 }
 
+bool PIC16TargetMachine::addPostRegAlloc(PassManagerBase &PM, 
+                                         CodeGenOpt::Level OptLevel) {
+  PM.add(createPIC16MemSelOptimizerPass());
+  return true;  // -print-machineinstr should print after this.
+}
+