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

Sebastian Redl sebastian.redl at getdesigned.at
Sun Oct 26 11:15:13 PDT 2008

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.


More information about the cfe-dev mailing list