[PATCH] Allow users to specify NULL like macros to be replaced

Tareq A. Siraj tareq.a.siraj at intel.com
Tue Mar 26 08:04:25 PDT 2013


  Waiting for Edwin's review on this before I upload a new patch. Thanks.


================
Comment at: cpp11-migrate/UseNullptr/NullptrActions.cpp:171
@@ +170,3 @@
+      // Check to see if the user wants to replace the macro being expanded.
+      bool ReplaceNullMacro = false;
+      for (StringsVec::iterator it = UserNullMacros.begin(),
----------------
Manuel Klimek wrote:
> Does: ReplaceNullMacro = std::find(UserNullMacros.begin(), UserNullMacros.end(), OutermostMacroName) != UserNullMacros.end();
> not work?
Seems to work.

================
Comment at: cpp11-migrate/UseNullptr/NullptrActions.h:37
@@ -38,1 +36,3 @@
+  typedef llvm::SmallVector<llvm::StringRef, 1> StringsVec;
+  StringsVec UserNullMacros;
 };
----------------
Manuel Klimek wrote:
> I'm opposed to this typedef - I don't think it aids too much in readability. Vectors of strings are so fundamental that I find hiding that we're using a vector of StringRef confusing. (also, I'm opposed to "Vec" when it's just 3 keystrokes (fewer if you use a decent code completion tool))
I just didn't want to write llvm::SmallVector<llvm::StringRef, 1>::iterator in the lookup code :). Since that has been changed to use std::find(), we don't need this typedef.


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



More information about the cfe-commits mailing list