This is an archive of the discontinued LLVM Phabricator instance.

[change-namepsace] make it possible to whitelist symbols so they don't get updated.
ClosedPublic

Authored by ioeric on Feb 24 2017, 2:13 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

ioeric updated this revision to Diff 89627.Feb 24 2017, 2:13 AM
ioeric created this revision.
  • removed a debug message
hokein accepted this revision.Feb 24 2017, 2:31 AM

LGTM.

change-namespace/tool/ClangChangeNamespace.cpp
78 ↗(On Diff #89627)

Maybe consider create a command-line option for it? It will make the tool more pluggable IMO.

This revision is now accepted and ready to land.Feb 24 2017, 2:31 AM
ioeric updated this revision to Diff 89637.Feb 24 2017, 3:09 AM
ioeric marked an inline comment as done.
  • Make the whitelist an option.

PTAL

change-namespace/tool/ClangChangeNamespace.cpp
78 ↗(On Diff #89627)

Good idea. Done.

hokein added inline comments.Feb 24 2017, 3:26 AM
change-namespace/tool/ClangChangeNamespace.cpp
82 ↗(On Diff #89637)

Instead std::vector<std::string>, maybe std::vector<llvm::Regex> is better, with that we don't need to do transform stuff in ChangeNamespaceTool.

test/change-namespace/Inputs/white-list.txt
1 ↗(On Diff #89637)

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.

unittests/change-namespace/ChangeNamespaceTests.cpp
42 ↗(On Diff #89637)

/*WhiteListedSymbolPatterns*/{} is enough.

ioeric updated this revision to Diff 89640.Feb 24 2017, 3:33 AM
ioeric marked 2 inline comments as done.
  • Addressed comments.
change-namespace/tool/ClangChangeNamespace.cpp
82 ↗(On Diff #89637)

I'd like ChangeNamespaceTool to own the Regex vector and make sure it is not shared since Regex is not thread safe.

This revision was automatically updated to reflect the committed changes.