[PATCH] D30328: [change-namepsace] make it possible to whitelist symbols so they don't get updated.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 24 03:26:29 PST 2017
hokein added inline comments.
================
Comment at: change-namespace/tool/ClangChangeNamespace.cpp:82
+
+llvm::ErrorOr<std::vector<std::string>> GetWhiteListedSymbolPatterns() {
+ llvm::SmallVector<StringRef, 8> Lines;
----------------
Instead `std::vector<std::string>`, maybe std::vector<llvm::Regex> is better, with that we don't need to do transform stuff in `ChangeNamespaceTool`.
================
Comment at: test/change-namespace/Inputs/white-list.txt:1
+^std::.*$
----------------
As this is only one-line file, I'd create this file in `whitelist` lint test like `echo XX > whitelist.txt` to avoid adding a new file in test.
================
Comment at: unittests/change-namespace/ChangeNamespaceTests.cpp:42
change_namespace::ChangeNamespaceTool NamespaceTool(
- OldNamespace, NewNamespace, FilePattern, &FileToReplacements);
+ OldNamespace, NewNamespace, FilePattern, WhiteList,
+ &FileToReplacements);
----------------
`/*WhiteListedSymbolPatterns*/{}` is enough.
https://reviews.llvm.org/D30328
More information about the cfe-commits
mailing list