[cfe-commits] r60989 - in /cfe/trunk/lib/CodeGen: CGDecl.cpp CGExprScalar.cpp

Douglas Gregor dgregor at apple.com
Mon Dec 15 09:29:05 PST 2008


On Dec 15, 2008, at 9:19 AM, Daniel Dunbar wrote:

> On Mon, Dec 15, 2008 at 8:47 AM, Douglas Gregor <dgregor at apple.com>  
> wrote:
>>
>> On Dec 13, 2008, at 6:07 PM, Eli Friedman wrote:
>>> Mmmm... it would definitely make things easier if the AST tracked
>>> which scopes any given jump exits, like maybe a map from  jump
>>> statements to the outermost scope which they jump out of.  I guess  
>>> we
>>> really need something like this even for Sema: we still haven't
>>> implemented diagnostics for jumping into the scope of a VLA.
>>
>>
>> We'll need similar information to determine whether we're jumping  
>> past
>> declarations with initialization in C++.
>
> Yup. We need similar information for checking for jumps into special
> Objective-C blocks (exceptions, @synchronized). We also could benefit
> greatly from having such information just to finish Obj-C exception
> support, because when we encounter a break or continue or goto we need
> to determine which scopes to exit, and we currently have no easy way
> to do this.
>
> If Sema is going to need this information already then we should
> definitely find a way to save it, I think. Its probably useful at this
> point to think about whether the AST should have any information about
> the scopes in it; I believe this is something Ted could make use of in
> the static analyzer, and this would be a natural place for storing
> some of this additional information.

Scope information would also be a great place to hang information  
about which destructors get called when we exit a block. Actually, I  
can't think of any clean way to express that information without  
representing the scopes in the AST.

	- Doug



More information about the cfe-commits mailing list