[cfe-commits] [PATCH] Added use-nullptr transform into cpp11-migrate tool

David Blaikie dblaikie at gmail.com
Tue Jan 15 08:51:21 PST 2013


On Tue, Jan 15, 2013 at 6:17 AM, Vane, Edwin <edwin.vane at intel.com> wrote:
> I tend to agree with Stefanus. If we were to make the use of nullptr a fixit
> only it would mean a two-step process for anybody migrating their code base
> with the cpp11-migrate tool: use cpp11-migrate to get everything but nullptr
> and then use clang in fixit mode to get nullptr. A fixit is definitely
> useful but having the same functionality in cpp11-migrate is also useful.

Sure enough. Is there anything we can do to mitigate the duplicated
effort/code, then?

>
>
>
> From: cfe-commits-bounces at cs.uiuc.edu
> [mailto:cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Stefanus Du Toit
> Sent: Monday, January 14, 2013 3:11 PM
> To: David Blaikie
> Cc: reviews+D295+public+6744ee1860a6976b at llvm-reviews.chandlerc.com; llvm
> cfe; Siraj, Tareq A
> Subject: Re: [cfe-commits] [PATCH] Added use-nullptr transform into
> cpp11-migrate tool
>
>
>
> On Monday, January 14, 2013, David Blaikie wrote:
>
> On Mon, Jan 14, 2013 at 8:50 AM, Tareq A. Siraj <tareq.a.siraj at intel.com>
> wrote:
>> This transform converts the usage of null pointer constants (e.g. NULL, 0,
>> etc.) in legacy C++ code and converts them to use the new C++11 nullptr
>> keyword.
>
> There are probably good reasons not to do this, but I'm still curious:
>
> Why not just build this in as a warning in clang with a FixIt? (&, if
> necessary, have a Clang Tool designed for applying a particular fixit
> to a codebase) GCC 4.8 already intends to have a
> -Wzero-as-null-pointer warning which we could match.
>
>
>
> I think it makes sense to do this in both places. Having it in the rewriter
> tool is sensible so it can be applied along with other C++11
> transformations. The warning/fixit also makes sense. The core of this can
> probably be reused and live in Clang eventually, but start off in the tool.
>
>
>
> Stefanus



More information about the cfe-commits mailing list