diff --git a/clang-tools-extra/clang-tidy/utils/CMakeLists.txt b/clang-tools-extra/clang-tidy/utils/CMakeLists.txt --- a/clang-tools-extra/clang-tidy/utils/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/utils/CMakeLists.txt @@ -23,5 +23,5 @@ clangBasic clangLex clangTidy - clangToolingRefactoring + clangTransformer ) diff --git a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.h b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.h --- a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.h +++ b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.h @@ -13,7 +13,7 @@ #include "../utils/IncludeInserter.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/Frontend/CompilerInstance.h" -#include "clang/Tooling/Refactoring/Transformer.h" +#include "clang/Tooling/Transformer/Transformer.h" #include #include diff --git a/clang-tools-extra/unittests/clang-tidy/TransformerClangTidyCheckTest.cpp b/clang-tools-extra/unittests/clang-tidy/TransformerClangTidyCheckTest.cpp --- a/clang-tools-extra/unittests/clang-tidy/TransformerClangTidyCheckTest.cpp +++ b/clang-tools-extra/unittests/clang-tidy/TransformerClangTidyCheckTest.cpp @@ -9,9 +9,9 @@ #include "../clang-tidy/utils/TransformerClangTidyCheck.h" #include "ClangTidyTest.h" #include "clang/ASTMatchers/ASTMatchers.h" -#include "clang/Tooling/Refactoring/RangeSelector.h" -#include "clang/Tooling/Refactoring/Stencil.h" -#include "clang/Tooling/Refactoring/Transformer.h" +#include "clang/Tooling/Transformer/RangeSelector.h" +#include "clang/Tooling/Transformer/Stencil.h" +#include "clang/Tooling/Transformer/Transformer.h" #include "gtest/gtest.h" namespace clang { diff --git a/clang/include/clang/Tooling/Refactoring/MatchConsumer.h b/clang/include/clang/Tooling/Transformer/MatchConsumer.h rename from clang/include/clang/Tooling/Refactoring/MatchConsumer.h rename to clang/include/clang/Tooling/Transformer/MatchConsumer.h diff --git a/clang/include/clang/Tooling/Refactoring/RangeSelector.h b/clang/include/clang/Tooling/Transformer/RangeSelector.h rename from clang/include/clang/Tooling/Refactoring/RangeSelector.h rename to clang/include/clang/Tooling/Transformer/RangeSelector.h --- a/clang/include/clang/Tooling/Refactoring/RangeSelector.h +++ b/clang/include/clang/Tooling/Transformer/RangeSelector.h @@ -17,7 +17,7 @@ #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/Basic/SourceLocation.h" -#include "clang/Tooling/Refactoring/MatchConsumer.h" +#include "clang/Tooling/Transformer/MatchConsumer.h" #include "llvm/Support/Error.h" #include #include diff --git a/clang/include/clang/Tooling/Refactoring/SourceCode.h b/clang/include/clang/Tooling/Transformer/SourceCode.h rename from clang/include/clang/Tooling/Refactoring/SourceCode.h rename to clang/include/clang/Tooling/Transformer/SourceCode.h diff --git a/clang/include/clang/Tooling/Refactoring/SourceCodeBuilders.h b/clang/include/clang/Tooling/Transformer/SourceCodeBuilders.h rename from clang/include/clang/Tooling/Refactoring/SourceCodeBuilders.h rename to clang/include/clang/Tooling/Transformer/SourceCodeBuilders.h diff --git a/clang/include/clang/Tooling/Refactoring/Stencil.h b/clang/include/clang/Tooling/Transformer/Stencil.h rename from clang/include/clang/Tooling/Refactoring/Stencil.h rename to clang/include/clang/Tooling/Transformer/Stencil.h --- a/clang/include/clang/Tooling/Refactoring/Stencil.h +++ b/clang/include/clang/Tooling/Transformer/Stencil.h @@ -23,8 +23,8 @@ #include "clang/AST/ASTContext.h" #include "clang/AST/ASTTypeTraits.h" #include "clang/ASTMatchers/ASTMatchFinder.h" -#include "clang/Tooling/Refactoring/MatchConsumer.h" -#include "clang/Tooling/Refactoring/RangeSelector.h" +#include "clang/Tooling/Transformer/MatchConsumer.h" +#include "clang/Tooling/Transformer/RangeSelector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Error.h" #include diff --git a/clang/include/clang/Tooling/Refactoring/Transformer.h b/clang/include/clang/Tooling/Transformer/Transformer.h rename from clang/include/clang/Tooling/Refactoring/Transformer.h rename to clang/include/clang/Tooling/Transformer/Transformer.h --- a/clang/include/clang/Tooling/Refactoring/Transformer.h +++ b/clang/include/clang/Tooling/Transformer/Transformer.h @@ -19,8 +19,8 @@ #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/ASTMatchers/ASTMatchersInternal.h" #include "clang/Tooling/Refactoring/AtomicChange.h" -#include "clang/Tooling/Refactoring/MatchConsumer.h" -#include "clang/Tooling/Refactoring/RangeSelector.h" +#include "clang/Tooling/Transformer/MatchConsumer.h" +#include "clang/Tooling/Transformer/RangeSelector.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Error.h" diff --git a/clang/lib/Tooling/CMakeLists.txt b/clang/lib/Tooling/CMakeLists.txt --- a/clang/lib/Tooling/CMakeLists.txt +++ b/clang/lib/Tooling/CMakeLists.txt @@ -9,6 +9,7 @@ add_subdirectory(ASTDiff) add_subdirectory(Syntax) add_subdirectory(DependencyScanning) +add_subdirectory(Transformer) add_clang_library(clangTooling AllTUsExecution.cpp diff --git a/clang/lib/Tooling/Refactoring/CMakeLists.txt b/clang/lib/Tooling/Refactoring/CMakeLists.txt --- a/clang/lib/Tooling/Refactoring/CMakeLists.txt +++ b/clang/lib/Tooling/Refactoring/CMakeLists.txt @@ -6,17 +6,12 @@ AtomicChange.cpp Extract/Extract.cpp Extract/SourceExtraction.cpp - RangeSelector.cpp RefactoringActions.cpp Rename/RenamingAction.cpp Rename/SymbolOccurrences.cpp Rename/USRFinder.cpp Rename/USRFindingAction.cpp Rename/USRLocFinder.cpp - SourceCode.cpp - SourceCodeBuilders.cpp - Stencil.cpp - Transformer.cpp LINK_LIBS clangAST diff --git a/clang/lib/Tooling/Transformer/CMakeLists.txt b/clang/lib/Tooling/Transformer/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/clang/lib/Tooling/Transformer/CMakeLists.txt @@ -0,0 +1,17 @@ +set(LLVM_LINK_COMPONENTS Support) + +add_clang_library(clangTransformer + RangeSelector.cpp + SourceCode.cpp + SourceCodeBuilders.cpp + Stencil.cpp + Transformer.cpp + + LINK_LIBS + clangAST + clangASTMatchers + clangBasic + clangLex + clangToolingCore + clangToolingRefactoring + ) diff --git a/clang/lib/Tooling/Refactoring/RangeSelector.cpp b/clang/lib/Tooling/Transformer/RangeSelector.cpp rename from clang/lib/Tooling/Refactoring/RangeSelector.cpp rename to clang/lib/Tooling/Transformer/RangeSelector.cpp --- a/clang/lib/Tooling/Refactoring/RangeSelector.cpp +++ b/clang/lib/Tooling/Transformer/RangeSelector.cpp @@ -6,12 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "clang/Tooling/Refactoring/RangeSelector.h" +#include "clang/Tooling/Transformer/RangeSelector.h" #include "clang/AST/Expr.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/Basic/SourceLocation.h" #include "clang/Lex/Lexer.h" -#include "clang/Tooling/Refactoring/SourceCode.h" +#include "clang/Tooling/Transformer/SourceCode.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Errc.h" #include "llvm/Support/Error.h" diff --git a/clang/lib/Tooling/Refactoring/SourceCode.cpp b/clang/lib/Tooling/Transformer/SourceCode.cpp rename from clang/lib/Tooling/Refactoring/SourceCode.cpp rename to clang/lib/Tooling/Transformer/SourceCode.cpp --- a/clang/lib/Tooling/Refactoring/SourceCode.cpp +++ b/clang/lib/Tooling/Transformer/SourceCode.cpp @@ -9,7 +9,7 @@ // This file provides functions that simplify extraction of source code. // //===----------------------------------------------------------------------===// -#include "clang/Tooling/Refactoring/SourceCode.h" +#include "clang/Tooling/Transformer/SourceCode.h" #include "clang/Lex/Lexer.h" using namespace clang; diff --git a/clang/lib/Tooling/Refactoring/SourceCodeBuilders.cpp b/clang/lib/Tooling/Transformer/SourceCodeBuilders.cpp rename from clang/lib/Tooling/Refactoring/SourceCodeBuilders.cpp rename to clang/lib/Tooling/Transformer/SourceCodeBuilders.cpp --- a/clang/lib/Tooling/Refactoring/SourceCodeBuilders.cpp +++ b/clang/lib/Tooling/Transformer/SourceCodeBuilders.cpp @@ -6,11 +6,11 @@ // //===----------------------------------------------------------------------===// -#include "clang/Tooling/Refactoring/SourceCodeBuilders.h" +#include "clang/Tooling/Transformer/SourceCodeBuilders.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" -#include "clang/Tooling/Refactoring/SourceCode.h" +#include "clang/Tooling/Transformer/SourceCode.h" #include "llvm/ADT/Twine.h" #include diff --git a/clang/lib/Tooling/Refactoring/Stencil.cpp b/clang/lib/Tooling/Transformer/Stencil.cpp rename from clang/lib/Tooling/Refactoring/Stencil.cpp rename to clang/lib/Tooling/Transformer/Stencil.cpp --- a/clang/lib/Tooling/Refactoring/Stencil.cpp +++ b/clang/lib/Tooling/Transformer/Stencil.cpp @@ -6,15 +6,15 @@ // //===----------------------------------------------------------------------===// -#include "clang/Tooling/Refactoring/Stencil.h" +#include "clang/Tooling/Transformer/Stencil.h" #include "clang/AST/ASTContext.h" #include "clang/AST/ASTTypeTraits.h" #include "clang/AST/Expr.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Lex/Lexer.h" -#include "clang/Tooling/Refactoring/SourceCode.h" -#include "clang/Tooling/Refactoring/SourceCodeBuilders.h" +#include "clang/Tooling/Transformer/SourceCode.h" +#include "clang/Tooling/Transformer/SourceCodeBuilders.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/Errc.h" #include diff --git a/clang/lib/Tooling/Refactoring/Transformer.cpp b/clang/lib/Tooling/Transformer/Transformer.cpp rename from clang/lib/Tooling/Refactoring/Transformer.cpp rename to clang/lib/Tooling/Transformer/Transformer.cpp --- a/clang/lib/Tooling/Refactoring/Transformer.cpp +++ b/clang/lib/Tooling/Transformer/Transformer.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Tooling/Refactoring/Transformer.h" +#include "clang/Tooling/Transformer/Transformer.h" #include "clang/AST/Expr.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" @@ -14,15 +14,15 @@ #include "clang/Basic/SourceLocation.h" #include "clang/Rewrite/Core/Rewriter.h" #include "clang/Tooling/Refactoring/AtomicChange.h" -#include "clang/Tooling/Refactoring/SourceCode.h" +#include "clang/Tooling/Transformer/SourceCode.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Errc.h" #include "llvm/Support/Error.h" +#include #include #include #include -#include using namespace clang; using namespace tooling; diff --git a/clang/unittests/Tooling/CMakeLists.txt b/clang/unittests/Tooling/CMakeLists.txt --- a/clang/unittests/Tooling/CMakeLists.txt +++ b/clang/unittests/Tooling/CMakeLists.txt @@ -75,6 +75,7 @@ clangToolingCore clangToolingInclusions clangToolingRefactoring + clangTransformer ) target_link_libraries(ToolingTests diff --git a/clang/unittests/Tooling/RangeSelectorTest.cpp b/clang/unittests/Tooling/RangeSelectorTest.cpp --- a/clang/unittests/Tooling/RangeSelectorTest.cpp +++ b/clang/unittests/Tooling/RangeSelectorTest.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Tooling/Refactoring/RangeSelector.h" +#include "clang/Tooling/Transformer/RangeSelector.h" #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Frontend/ASTUnit.h" #include "clang/Tooling/FixIt.h" diff --git a/clang/unittests/Tooling/SourceCodeBuildersTest.cpp b/clang/unittests/Tooling/SourceCodeBuildersTest.cpp --- a/clang/unittests/Tooling/SourceCodeBuildersTest.cpp +++ b/clang/unittests/Tooling/SourceCodeBuildersTest.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Tooling/Refactoring/SourceCodeBuilders.h" +#include "clang/Tooling/Transformer/SourceCodeBuilders.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Tooling/Tooling.h" diff --git a/clang/unittests/Tooling/SourceCodeTest.cpp b/clang/unittests/Tooling/SourceCodeTest.cpp --- a/clang/unittests/Tooling/SourceCodeTest.cpp +++ b/clang/unittests/Tooling/SourceCodeTest.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Tooling/Refactoring/SourceCode.h" +#include "clang/Tooling/Transformer/SourceCode.h" #include "TestVisitor.h" #include "clang/Basic/Diagnostic.h" #include "llvm/Testing/Support/Annotations.h" diff --git a/clang/unittests/Tooling/StencilTest.cpp b/clang/unittests/Tooling/StencilTest.cpp --- a/clang/unittests/Tooling/StencilTest.cpp +++ b/clang/unittests/Tooling/StencilTest.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Tooling/Refactoring/Stencil.h" +#include "clang/Tooling/Transformer/Stencil.h" #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Tooling/FixIt.h" #include "clang/Tooling/Tooling.h" diff --git a/clang/unittests/Tooling/TransformerTest.cpp b/clang/unittests/Tooling/TransformerTest.cpp --- a/clang/unittests/Tooling/TransformerTest.cpp +++ b/clang/unittests/Tooling/TransformerTest.cpp @@ -6,9 +6,9 @@ // //===----------------------------------------------------------------------===// -#include "clang/Tooling/Refactoring/Transformer.h" +#include "clang/Tooling/Transformer/Transformer.h" #include "clang/ASTMatchers/ASTMatchers.h" -#include "clang/Tooling/Refactoring/RangeSelector.h" +#include "clang/Tooling/Transformer/RangeSelector.h" #include "clang/Tooling/Tooling.h" #include "llvm/Support/Errc.h" #include "llvm/Support/Error.h"