[llvm-commits] [llvm] r76220 - /llvm/trunk/tools/opt/opt.cpp

Bob Wilson bob.wilson at apple.com
Fri Jul 17 13:10:36 PDT 2009


Owen, please take a look at this.  There may be other cases where  
doInitialization is never called.

Devang, is this the right thing to do from the perspective of the  
PassManager?  I.E., should it be the obligation of someone calling  
FunctionPassManager::run to first call doInitialization?  I'm guessing  
that is not how it is supposed to be.  Otherwise, we should document  
that requirement.

On Jul 17, 2009, at 12:05 PM, Bob Wilson wrote:

> Author: bwilson
> Date: Fri Jul 17 14:05:13 2009
> New Revision: 76220
>
> URL: http://llvm.org/viewvc/llvm-project?rev=76220&view=rev
> Log:
> Fix a crash in SROA.  The FunctionPass::doInitialization method was  
> never
> being called so that Context was never initialized.  I'm not sure if  
> this
> is the right fix but at least it keeps opt from crashing.
>
> Modified:
>    llvm/trunk/tools/opt/opt.cpp
>
> Modified: llvm/trunk/tools/opt/opt.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=76220&r1=76219&r2=76220&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/tools/opt/opt.cpp (original)
> +++ llvm/trunk/tools/opt/opt.cpp Fri Jul 17 14:05:13 2009
> @@ -504,6 +504,7 @@
>     }
>
>     if (OptLevelO1 || OptLevelO2 || OptLevelO3) {
> +      FPasses->doInitialization();
>       for (Module::iterator I = M.get()->begin(), E = M.get()->end();
>            I != E; ++I)
>         FPasses->run(*I);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list