aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-11-07 19:49:17 +0000
committerDan Gohman <gohman@apple.com>2008-11-07 19:49:17 +0000
commite5f4de42b5d26f60cec6fab0482eaf579246b218 (patch)
treea0ca46346f74d34686ec6d1223b0a86b992726da
parentbc3c4296c03c6b9aee3cce68ae33279f5ad5ca2b (diff)
downloadexternal_llvm-e5f4de42b5d26f60cec6fab0482eaf579246b218.zip
external_llvm-e5f4de42b5d26f60cec6fab0482eaf579246b218.tar.gz
external_llvm-e5f4de42b5d26f60cec6fab0482eaf579246b218.tar.bz2
Flush the raw_ostream after emitting the assembly for a function.
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
-rw-r--r--lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp2
-rw-r--r--lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp2
-rw-r--r--lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp2
-rw-r--r--lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp2
4 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index 3eec562..36cd98e 100644
--- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -263,6 +263,8 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// FIXME: Dwarf support.
//DW.EndFunction();
+ O.flush();
+
return false;
}
diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
index d164066..6c17dbe 100644
--- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
@@ -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;
}
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
index 5710add..556757a 100644
--- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
@@ -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;
}
diff --git a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
index ae86979..4868906 100644
--- a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
@@ -179,6 +179,8 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
O << CurrentFnName << "\tendp\n";
+ O.flush();
+
// We didn't modify anything.
return false;
}