[cfe-commits] r77473 - /cfe/trunk/lib/Frontend/Backend.cpp

Chris Lattner clattner at apple.com
Wed Jul 29 13:21:16 PDT 2009


On Jul 29, 2009, at 10:10 AM, Daniel Dunbar wrote:

> Author: ddunbar
> Date: Wed Jul 29 12:10:26 2009
> New Revision: 77473
>
> URL: http://llvm.org/viewvc/llvm-project?rev=77473&view=rev
> Log:
> Don't use a formatted ostream when writing .bc files. I don't really  
> understand
> this interface design, Chris please check.

Yes, this looks fine.  The basic problem is that the API to the code  
generator is wrong.  "addPassesToEmitFile" should not take a formatted  
ostream: that is exposing an implementation detail to the clients.   
This patch is a fine in the meantime.

-Chris

>
> Modified:
>    cfe/trunk/lib/Frontend/Backend.cpp
>
> Modified: cfe/trunk/lib/Frontend/Backend.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Backend.cpp?rev=77473&r1=77472&r2=77473&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- cfe/trunk/lib/Frontend/Backend.cpp (original)
> +++ cfe/trunk/lib/Frontend/Backend.cpp Wed Jul 29 12:10:26 2009
> @@ -198,7 +198,7 @@
>     return true;
>
>   if (Action == Backend_EmitBC) {
> -    getPerModulePasses()- 
> >add(createBitcodeWriterPass(FormattedOutStream));
> +    getPerModulePasses()- 
> >add(createBitcodeWriterPass(*AsmOutStream));
>   } else if (Action == Backend_EmitLL) {
>     getPerModulePasses()- 
> >add(createPrintModulePass(&FormattedOutStream));
>   } else {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list