r183597 - Debug info: An if condition now creates a lexical scope of its own.

Eric Christopher echristo at gmail.com
Wed Jul 10 13:19:50 PDT 2013

>>> Specifically, rescoping labels isn't necessary for an arbitrary bundle of
>>> cleanups (like a full expression) because you can't typically jump into
>>> such things, and permitting that would involve more than just rescoping
>>> some labels.
>> I think this makes sense, but an example would probably illuminate.
> You can't jump into an expression because there's stuff gettin' evaluated there.

Right. Cool.

>>> You really don't need a full LexicalScope here; all of the child
>>> expressions and statements are already being appropriately scoped.
>>> You should just make your own RAII class.
>> Oddly enough I did. It was called "LexicalScope" for things that
>> needed a debug lexical scope along with the assorted cleanups. It
>> seems to have been appropriated though :)
> Well, I didn't realize the code in this case was so closely aligned with
> an actual cleanups scope.

:) Mostly I think all debug lexical scopes are going to be, but a
subset, not a superset.

I've gone ahead and committed the change. Thanks!


More information about the cfe-commits mailing list