[LLVMdev] Advice on CFG pre-analysis

Chris Lattner sabre at nondot.org
Tue May 27 20:41:58 PDT 2008


On May 27, 2008, at 1:57 PM, 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.

I'm not sure what your point is here Mike.  That is clearly an  
important thing to avoid warning for.  You can argue about whether the  
optimizer or front-end should be generating the warning, but any  
compiler that emits a false positive for that would be pretty useless  
in practice.

-Chris



More information about the llvm-dev mailing list