Flush the raw_ostream after emitting the assembly for a function.
authorDan Gohman <gohman@apple.com>
Fri, 7 Nov 2008 19:49:17 +0000 (19:49 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 7 Nov 2008 19:49:17 +0000 (19:49 +0000)
This is a temporary fix for the -print-emitted-asm option, where
errs() is used as the stream, in the case where other code is
using stderr without using errs()' buffer. Hopefully soon we'll
fix errs() to be non-buffered instead. Patch by Preston Gurd.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58859 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp

index 3eec56227831cb617c147cb33732eb7f3c1b0330..36cd98eb927472af7e6b376b5ad20ab64a498608 100644 (file)
@@ -263,6 +263,8 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   // FIXME: Dwarf support.
   //DW.EndFunction();
 
+  O.flush();
+
   return false;
 }
 
index d164066a9aa15e1398dd7a9bb148dddc3767e520..6c17dbece07e673ea419c8e0209c3c01486dbcb9 100644 (file)
@@ -619,6 +619,8 @@ bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   // Emit post-function debug information.
   DW.EndFunction(&MF);
 
+  O.flush();
+
   // We didn't modify anything.
   return false;
 }
index 5710add416ca17b6d1b805f3648a69a5b24e9f08..556757aaabf3b31c0a434827b1f0a32fb0c9fdbc 100644 (file)
@@ -265,6 +265,8 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   // Print out jump tables referenced by the function.
   EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
 
+  O.flush();
+
   // We didn't modify anything.
   return false;
 }
index ae869799a97d980523088179b9a422f41050ba94..4868906a041644d211515d43de358842f58a9aa6 100644 (file)
@@ -179,6 +179,8 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
 
   O << CurrentFnName << "\tendp\n";
 
+  O.flush();
+
   // We didn't modify anything.
   return false;
 }