Don't flush the raw_ostream between each MachineFunction. These flush
authorDan Gohman <gohman@apple.com>
Wed, 5 Aug 2009 00:49:25 +0000 (00:49 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 5 Aug 2009 00:49:25 +0000 (00:49 +0000)
calls were originally put in place because errs() at one time was
not unbuffered, and these print routines are commonly used with errs()
for debugging. However, errs() is now properly unbuffered, so the
flush calls are no longer needed. This significantly reduces the
number of write(2) calls for regular asm printing when there are many
small functions.

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

lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
lib/Target/MSP430/MSP430AsmPrinter.cpp
lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp

index d1bf70071877b43a7e5e12e89049351f6150d306..ab49d166ff0593cdde7c683675193d26b6dfd1cb 100644 (file)
@@ -330,8 +330,6 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   // Emit post-function debug information.
   DW->EndFunction(&MF);
 
-  O.flush();
-
   return false;
 }
 
index e357761705ac4b59dba0666a94cbb1b631ff0f64..2da7cdd61ca22aff471bdf2b535ad3937fa9e4e1 100644 (file)
@@ -134,8 +134,6 @@ bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   if (TAI->hasDotTypeDotSizeDirective())
     O << "\t.size\t" << CurrentFnName << ", .-" << CurrentFnName << '\n';
 
-  O.flush();
-
   // We didn't modify anything
   return false;
 }
index 12a6da72818d5473ff000ec7f799b5a8ec9df715..3f1ac2cdc9861fbc9b73c68bd018941822c3e63b 100644 (file)
@@ -646,8 +646,6 @@ bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   // Emit post-function debug information.
   DW->EndFunction(&MF);
 
-  O.flush();
-
   // We didn't modify anything.
   return false;
 }
index ef64eb87cae5a2c7eefbd5e3b202e10c8857a42c..b82396895f933b717f2d29ece1aa907184f0b677 100644 (file)
@@ -144,8 +144,6 @@ bool SystemZAsmPrinter::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 aea38cad030a68bb16478d0a56efd7d38bdf52f5..2f56c2a9559dc4599ce84ba06a39aa54bc10ad5c 100644 (file)
@@ -284,8 +284,6 @@ 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 64037aec10a4255572669e157282edf1a2a15d61..c9a761d395c874aca4902ec179d623d89b2ecf7d 100644 (file)
@@ -183,8 +183,6 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
 
   O << CurrentFnName << "\tendp\n";
 
-  O.flush();
-
   // We didn't modify anything.
   return false;
 }