[PATCH] Don't replace macro usage if macro body has NULL

Edwin Vane edwin.vane at intel.com
Mon Mar 18 10:13:24 PDT 2013


  Drop the Signed-off-by.


================
Comment at: cpp11-migrate/UseNullptr/NullptrActions.cpp:131
@@ +130,3 @@
+          StartLoc, SM, Result.Context->getLangOpts());
+      if ("NULL" != ImmediateMacroName)
+        return;
----------------
In LLVM style, comparison with constants has the constants on the RHS of the comparison operator.

================
Comment at: cpp11-migrate/UseNullptr/NullptrActions.cpp:141
@@ +140,3 @@
+        EndLoc = SM.getFileLoc(EndLoc);
+      }
+    }
----------------
What happens if macroCaller(StartLoc|EndLoc) is a macro ID?




================
Comment at: test/cpp11-migrate/UseNullptr/basic.cpp:11
@@ -10,2 +10,3 @@
 #define NULL 0
+// CHECK: define NULL 0
 
----------------
#define?

================
Comment at: cpp11-migrate/UseNullptr/NullptrActions.cpp:22
@@ -21,2 +21,3 @@
 #include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/Lex/Lexer.h"
 
----------------
Sort includes.


http://llvm-reviews.chandlerc.com/D549



More information about the cfe-commits mailing list