diff options
author | Eric Liu <ioeric@google.com> | 2016-09-19 17:40:32 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2016-09-19 17:40:32 +0000 |
commit | 495b211a6c775e6fbc00a1e3a91786f6a880b82e (patch) | |
tree | 3bab5e17837580d699fbf17c0330d84209dc8dd2 /clang-tools-extra/change-namespace/CMakeLists.txt | |
parent | 6f862b1f073cdf13b18eee8d4baf5b319620ddae (diff) | |
download | bcm5719-llvm-495b211a6c775e6fbc00a1e3a91786f6a880b82e.tar.gz bcm5719-llvm-495b211a6c775e6fbc00a1e3a91786f6a880b82e.zip |
A clang tool for changing surrouding namespaces of class/function definitions.
Summary:
A tool for changing surrouding namespaces of class/function definitions while keeping
references to types in the changed namespace correctly qualified by prepending
namespace specifiers before them.
Example: test.cc
namespace na {
class X {};
namespace nb {
class Y { X x; };
} // namespace nb
} // namespace na
To move the definition of class Y from namespace "na::nb" to "x::y", run:
clang-change-namespace --old_namespace "na::nb" \
--new_namespace "x::y" --file_pattern "test.cc" test.cc --
Output:
namespace na {
class X {};
} // namespace na
namespace x {
namespace y {
class Y { na::X x; };
} // namespace y
} // namespace x
Reviewers: alexfh, omtcyfz, hokein
Subscribers: mgorny, klimek, djasper, beanz, alexshap, Eugene.Zelenko, cfe-commits
Differential Revision: https://reviews.llvm.org/D24183
llvm-svn: 281918
Diffstat (limited to 'clang-tools-extra/change-namespace/CMakeLists.txt')
-rw-r--r-- | clang-tools-extra/change-namespace/CMakeLists.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang-tools-extra/change-namespace/CMakeLists.txt b/clang-tools-extra/change-namespace/CMakeLists.txt new file mode 100644 index 00000000000..1c8aba91e39 --- /dev/null +++ b/clang-tools-extra/change-namespace/CMakeLists.txt @@ -0,0 +1,19 @@ +set(LLVM_LINK_COMPONENTS + support + ) + +add_clang_library(clangChangeNamespace + ChangeNamespace.cpp + + LINK_LIBS + clangAST + clangASTMatchers + clangBasic + clangFormat + clangFrontend + clangLex + clangTooling + clangToolingCore + ) + +add_subdirectory(tool) |