[PATCH] Allow users to specify NULL like macros to be replaced
Edwin Vane
edwin.vane at intel.com
Tue Mar 26 10:03:11 PDT 2013
These are in addition to other reviewers suggestions.
Also, log a bugzilla for enhancing the transform to print possible user-defined macros as diagnostic output. I like the idea but doesn't have to be in this commit.
================
Comment at: cpp11-migrate/UseNullptr/NullptrActions.cpp:36
@@ +35,3 @@
+ llvm::cl::desc("User defined macro names (separated by "
+ "comma) to migrate that behave like NULL"),
+ llvm::cl::init(""));
----------------
Perhaps "Comma-separated list of user-defined macro names that behave like NULL".
================
Comment at: cpp11-migrate/UseNullptr/NullptrActions.cpp:31
@@ -30,1 +30,3 @@
+const char NullMacroName[] = "NULL";
+
----------------
Style nit: use const char *NullMacroName = "NULL".
================
Comment at: docs/UseNullptrTransform.rst:48
@@ +47,3 @@
+user defined macros that behaves like ``NULL``. The user can use the
+:option:`-user-null-macros` option to specify a comma separated list of macro
+names that will be transformed along with ``NULL``.
----------------
comma-separated
================
Comment at: docs/UseNullptrTransform.rst:56
@@ +55,3 @@
+
+ #define MY_NULL NULL
+ void assignment() {
----------------
It might be more clear to do something more user-specific like we've seen in ITK:
#define MY_NULL (void*)0
================
Comment at: docs/cpp11-migrate.rst:45
@@ +44,3 @@
+
+ ``<string>`` is a comma separated list of user supplied macro names that
+ behave like the ``NULL`` macro. The :option:`-use-nullptr` transform will
----------------
...is a comma-separated list of user-defined macros that...
http://llvm-reviews.chandlerc.com/D574
More information about the cfe-commits
mailing list