[cfe-dev] C++11 migration tools
dgregor at apple.com
Fri Jun 29 14:39:51 PDT 2012
On Jun 29, 2012, at 12:42 PM, Sam Panzer <panzer at google.com> wrote:
> Thank you for giving a concrete proposal!
> One other feature to add would be a degree of confidence for any given change (Certain success, will probably work, risky), so that a command-line flag could control how aggressive any transformations are.
I don't think that we should admit any transformation unless we know that the resulting code type-checks. The tooling/refactoring stuff should provide that for us, and we'll need to be careful with some transformations (like the for-range loop transformation) that could break the semantics of the program if we're not careful. Migration tools aren't useful if they're going to break my code without telling me.
> To be more specific, one option is modeling the tool after diagnostics:
> - Transformations are grouped in a new tool, source-migrate
> - Each transformation should be named, so it can be turned on/off, such as -range-for-loop or -noconst-expr
> - Each transformation should be grouped, so that all C++11 transformations could be enabled or disabled in one go, e.g. -Tnocxx11
> - Each transformation should have some way to specify compiler requirements, such as requiring C++ mode.
> I think this is a good starting place for a code migration framework - I will try setting up a tool with proper command-line flags.
Yes, this seems completely reasonable.
More information about the cfe-dev