[libTooling] Fix r374962: add more Transformer forwarding decls.
Summary:
The move to a new, single namespace in r374962 left out some type definitions
from the old namespace and resulted in one naming conflict (`text`). This
revision adds aliases for those definitions and removes one of the `text`
functions from the new namespace.
Reviewers: alexfh
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69036
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375003 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Tooling/Transformer/RangeSelector.h b/include/clang/Tooling/Transformer/RangeSelector.h
index 00f1f84..9f556d2 100644
--- a/include/clang/Tooling/Transformer/RangeSelector.h
+++ b/include/clang/Tooling/Transformer/RangeSelector.h
@@ -92,6 +92,8 @@
namespace tooling {
// DEPRECATED: These are temporary aliases supporting client migration to the
// `transformer` namespace.
+using RangeSelector = transformer::RangeSelector;
+
using transformer::after;
using transformer::before;
using transformer::callArgs;
diff --git a/include/clang/Tooling/Transformer/RewriteRule.h b/include/clang/Tooling/Transformer/RewriteRule.h
index 058ef3f..6e99151 100644
--- a/include/clang/Tooling/Transformer/RewriteRule.h
+++ b/include/clang/Tooling/Transformer/RewriteRule.h
@@ -31,11 +31,6 @@
namespace clang {
namespace transformer {
using TextGenerator = MatchConsumer<std::string>;
-/// Wraps a string as a TextGenerator.
-inline TextGenerator text(std::string M) {
- return [M](const ast_matchers::MatchFinder::MatchResult &)
- -> Expected<std::string> { return M; };
-}
// Description of a source-code edit, expressed in terms of an AST node.
// Includes: an ID for the (bound) node, a selector for source related to the
@@ -221,7 +216,9 @@
/// Removes the source selected by \p S.
inline ASTEdit remove(RangeSelector S) {
- return change(std::move(S), text(""));
+ return change(std::move(S),
+ [](const ast_matchers::MatchFinder::MatchResult &)
+ -> Expected<std::string> { return ""; });
}
/// The following three functions are a low-level part of the RewriteRule
@@ -286,6 +283,14 @@
namespace tooling {
// DEPRECATED: These are temporary aliases supporting client migration to the
// `transformer` namespace.
+/// Wraps a string as a TextGenerator.
+using TextGenerator = transformer::TextGenerator;
+
+inline TextGenerator text(std::string M) {
+ return [M](const ast_matchers::MatchFinder::MatchResult &)
+ -> Expected<std::string> { return M; };
+}
+
using transformer::addInclude;
using transformer::applyFirst;
using transformer::change;
@@ -293,7 +298,6 @@
using transformer::insertBefore;
using transformer::makeRule;
using transformer::remove;
-using transformer::text;
using transformer::RewriteRule;
using transformer::IncludeFormat;
namespace detail {
diff --git a/include/clang/Tooling/Transformer/Stencil.h b/include/clang/Tooling/Transformer/Stencil.h
index feb3ac8..66d1388 100644
--- a/include/clang/Tooling/Transformer/Stencil.h
+++ b/include/clang/Tooling/Transformer/Stencil.h
@@ -195,9 +195,11 @@
} // namespace transformer
namespace tooling {
-namespace stencil {
// DEPRECATED: These are temporary aliases supporting client migration to the
// `transformer` namespace.
+using Stencil = transformer::Stencil;
+using StencilPart = transformer::StencilPart;
+namespace stencil {
using transformer::access;
using transformer::addressOf;
using transformer::cat;
diff --git a/unittests/Tooling/TransformerTest.cpp b/unittests/Tooling/TransformerTest.cpp
index c42976a..ee05b74 100644
--- a/unittests/Tooling/TransformerTest.cpp
+++ b/unittests/Tooling/TransformerTest.cpp
@@ -21,7 +21,6 @@
namespace {
using ::testing::IsEmpty;
using transformer::RewriteRule;
-using transformer::text;
constexpr char KHeaderContents[] = R"cc(
struct string {