]> granicus.if.org Git - clang/commitdiff
Pass the formatted_raw_ostream to createPrintModulePass and
authorDan Gohman <gohman@apple.com>
Sat, 26 Sep 2009 15:06:14 +0000 (15:06 +0000)
committerDan Gohman <gohman@apple.com>
Sat, 26 Sep 2009 15:06:14 +0000 (15:06 +0000)
createBitcodeWriterPass instead of the underlying raw_ostream. This
avoids trouble with formatted_raw_ostream's behavior of setting the
underlying stream to be unbuffered, which resulted in
clang -emit-llvm -S using unbuffered output.

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

lib/Frontend/Backend.cpp

index d7097b7f06a0b16c6c1d9b0250d75f5b05ffde79..13aecf171718e29d9dcba0eb45d5d6472df848ae 100644 (file)
@@ -198,9 +198,9 @@ bool BackendConsumer::AddEmitPasses(std::string &Error) {
     return true;
 
   if (Action == Backend_EmitBC) {
-    getPerModulePasses()->add(createBitcodeWriterPass(*AsmOutStream));
+    getPerModulePasses()->add(createBitcodeWriterPass(FormattedOutStream));
   } else if (Action == Backend_EmitLL) {
-    getPerModulePasses()->add(createPrintModulePass(AsmOutStream));
+    getPerModulePasses()->add(createPrintModulePass(&FormattedOutStream));
   } else {
     bool Fast = CompileOpts.OptimizationLevel == 0;