[llvm-commits] [llvm-gcc-4.2] r57947 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Daniel Dunbar
daniel at zuster.org
Tue Oct 21 20:26:55 PDT 2008
Author: ddunbar
Date: Tue Oct 21 22:26:55 2008
New Revision: 57947
URL: http://llvm.org/viewvc/llvm-project?rev=57947&view=rev
Log:
Update to use raw_ostream for PrintModulePass.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=57947&r1=57946&r2=57947&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue Oct 21 22:26:55 2008
@@ -469,7 +469,7 @@
} else if (emit_llvm) {
// Emit an LLVM .ll file to the output. This is used when passed
// -emit-llvm -S to the GCC driver.
- PerModulePasses->add(createPrintModulePass(AsmOutFile));
+ PerModulePasses->add(createPrintModulePass(AsmOutRawStream));
HasPerModulePasses = true;
} else {
FunctionPassManager *PM;
@@ -653,11 +653,16 @@
FILE *asm_intermediate_out_file = fopen(asm_intermediate_out_filename, "w+b");
AsmIntermediateOutStream = new oFILEstream(asm_intermediate_out_file);
AsmIntermediateOutFile = new OStream(*AsmIntermediateOutStream);
+ raw_ostream *AsmIntermediateRawOutStream =
+ new raw_os_ostream(*AsmIntermediateOutStream);
if (emit_llvm_bc)
IntermediatePM->add(CreateBitcodeWriterPass(*AsmIntermediateOutStream));
if (emit_llvm)
- IntermediatePM->add(createPrintModulePass(AsmIntermediateOutFile));
+ IntermediatePM->add(createPrintModulePass(AsmIntermediateRawOutStream));
IntermediatePM->run(*TheModule);
+ AsmIntermediateRawOutStream->flush();
+ delete AsmIntermediateRawOutStream;
+ AsmIntermediateRawOutStream = 0;
AsmIntermediateOutStream->flush();
fflush(asm_intermediate_out_file);
delete AsmIntermediateOutStream;
More information about the llvm-commits
mailing list