[LLVMdev] Advice on CFG pre-analysis

Neil Booth neil at daikokuya.co.uk
Tue May 27 16:05:11 PDT 2008


Mike Stump wrote:-

> On May 23, 2008, at 11:53 PM, Talin wrote:
> > In the language I am working on, there are cases where the call flow
> > graph can affect the type of a variable.
> 
> :-)
> 
> This reminds me of people that want to use CFG and the optimizer to  
> make:
> 
> int i; int() { if (i) return 1; else return 0; }
> 
> not warn/error that flow falls off the end.  Extend that out and you  
> have to do arbitrarily hard things and the document the limit of what  
> was done, which is messy and wrong, as the next person will come along  
> and say, but I want this one obvious little case to work as well.

You can get 98% of all cases people care about with no analysis
and just a couple of boolean variables in the front end, including
the case above.

Neil.



More information about the llvm-dev mailing list