Pass the formatted_raw_ostream to createPrintModulePass and

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.

llvm-svn: 82857
This commit is contained in:
Dan Gohman 2009-09-26 15:06:14 +00:00
parent bb6ac47ea1
commit 0b3cfab288
1 changed files with 2 additions and 2 deletions

View 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;