[cfe-dev] Should we build semantically invalid nodes?

Argiris Kirtzidis akyrtzi at gmail.com
Sun Oct 26 11:25:48 PDT 2008


Sebastian Redl wrote:
> Argiris Kirtzidis wrote:
>> Chris Lattner wrote:
>>  
>>> It seems to me that it comes down to the clients that are the 
>>> ultimate  consumers of this information.  Since Sema is perfectly 
>>> fine for  correct code, lets ignore all clients that require 
>>> well-formed code  (e.g. codegen, refactoring, etc)
>>>     
>>
>> Refactoring, as I see it, doesn't require well-formed code, e.g. 
>> "rename this parameter name" doesn't particularly care about only the 
>> well-formed uses, it just wants to find all the appearances of the 
>> parameter in the function, even if the parameter is used in an 
>> invalid reinterpret_cast.
>>   
> Refactoring invalid code is extremely dangerous. If there are errors 
> in the code, then how can the refactory possibly preserve the 
> semantics? The semantics aren't even well-defined. I'm pretty sure the 
> Eclipse Java refactory requires valid code.

Well, refactoring in Visual Studio works fine on code with invalid 
semantics.

-Argiris



More information about the cfe-dev mailing list