[cfe-dev] Unneeded declarations invalidation

Douglas Gregor dgregor at apple.com
Fri Jul 24 16:50:13 PDT 2009


On Jul 24, 2009, at 4:37 PM, Daniel Dunbar wrote:

> On Tue, Jul 21, 2009 at 2:34 PM, Eli  
> Friedman<eli.friedman at gmail.com> wrote:
>> On Tue, Jul 21, 2009 at 1:11 PM, Daniel Dunbar<daniel at zuster.org>  
>> wrote:
>>> How hard would it be for us to actually support this extension in  
>>> Sema?
>>
>> Hmm... to support it properly, we'd have to add flags to structures  
>> to
>> note that they're variable length or variably modified, make sure to
>> mark structs and arrays containing such structs as variable
>> length/variably modified as appropriate, avoid trying to compute
>> anything that requires the layout for such structures in Evaluate,
>> adjust isICE to perform checks as appropriate, disallow initializers
>> for such structures, adjust isVariablyModifiedType, disallow
>> variable-size structs with static storage duration, disallow
>> redeclaring a tag with a variably modified type, disallow
>> variable-size structs in function parameters/return values, adjust
>> various places in ObjC code to disallow them, and adjust the goto
>> verifier to look for RecordDecls.  There's probably some stuff I'm
>> forgetting, but that's everything I can think of off the top of my
>> head.
>
> Nice list! :)
>
> It's certainly a non-trivial amount of work, but I don't think any of
> those things make Sema particular gross. I'm not personally motivated
> to add it, for example, but if someone was willing to contribute work
> towards it I think we would accept it?


I won't have the time (or motivation) to actually implement these  
changes, but I could live with them.

   - Doug



More information about the cfe-dev mailing list