[PATCH] D27302: [change-namespace] don't generate replacements for files that don't match file pattern.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 1 08:58:35 PST 2016


hokein accepted this revision.
hokein added a comment.
This revision is now accepted and ready to land.

LGTM with two nits.



================
Comment at: change-namespace/ChangeNamespace.cpp:786
+  for (auto &Entry : FileToReplacements)
+    if (!FilePatternRE.match(Entry.first))
+      Entry.second.clear();
----------------
How about creating `FilePatternRE` from `FilePattern` here? So that you don't need save `FilePatternRE` as a member variable.


================
Comment at: test/change-namespace/Inputs/macro.h:1
+#define USING using na::nc::X
----------------
For the simple file like this, I would use `echo "#define USING using na::nc::X" > macro.h` in `macro.cc` instead of creating a new file.


https://reviews.llvm.org/D27302





More information about the cfe-commits mailing list