Flush the raw_ostream after emitting the assembly for a function.
[oota-llvm.git] / lib / Target / X86 / X86TargetMachine.cpp
index ef4f897f5d12f101f07c0afa12899a79340aa3fd..2b67971d48001aaea2b06c1c20ea8517238616d0 100644 (file)
@@ -183,6 +183,11 @@ X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS,
 bool X86TargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
   // Install an instruction selector.
   PM.add(createX86ISelDag(*this, Fast));
+
+  // If we're using Fast-ISel, clean up the mess.
+  if (EnableFastISel)
+    PM.add(createDeadMachineInstructionElimPass());
+
   return false;
 }