aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSamuel Benzaquen <sbenza@google.com>2014-04-03 12:50:47 +0000
committerSamuel Benzaquen <sbenza@google.com>2014-04-03 12:50:47 +0000
commit282d5f5e34cc1e5e6eb312edc213d526ed96fc68 (patch)
tree93067d4f7f6f5e48d286830f3a7d1ce25d46bb2e /include
parent0e8e53bc16e589b64f9263c0fb8d574f28b64260 (diff)
downloadclang_35a-282d5f5e34cc1e5e6eb312edc213d526ed96fc68.tar.gz
Revert "Add support for named values in the parser."
This was submitted before it was ready. This reverts commit 62060a01e095cf35eb9ca42a333752d12714f35c. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/ASTMatchers/Dynamic/Parser.h37
-rw-r--r--include/clang/ASTMatchers/Dynamic/VariantValue.h6
2 files changed, 5 insertions, 38 deletions
diff --git a/include/clang/ASTMatchers/Dynamic/Parser.h b/include/clang/ASTMatchers/Dynamic/Parser.h
index 896b07010c..5901495bdd 100644
--- a/include/clang/ASTMatchers/Dynamic/Parser.h
+++ b/include/clang/ASTMatchers/Dynamic/Parser.h
@@ -18,14 +18,13 @@
///
/// \code
/// Grammar for the expressions supported:
-/// <Expression> := <Literal> | <NamedValue> | <MatcherExpression>
+/// <Expression> := <Literal> | <MatcherExpression>
/// <Literal> := <StringLiteral> | <Unsigned>
/// <StringLiteral> := "quoted string"
/// <Unsigned> := [0-9]+
-/// <NamedValue> := <Identifier>
-/// <MatcherExpression> := <Identifier>(<ArgumentList>) |
-/// <Identifier>(<ArgumentList>).bind(<StringLiteral>)
-/// <Identifier> := [a-zA-Z]+
+/// <MatcherExpression> := <MatcherName>(<ArgumentList>) |
+/// <MatcherName>(<ArgumentList>).bind(<StringLiteral>)
+/// <MatcherName> := [a-zA-Z]+
/// <ArgumentList> := <Expression> | <Expression>,<ArgumentList>
/// \endcode
///
@@ -63,19 +62,6 @@ public:
public:
virtual ~Sema();
- /// \brief Lookup a value by name.
- ///
- /// This can be used in the Sema layer to declare known constants or to
- /// allow to split an expression in pieces.
- ///
- /// \param Name The name of the value to lookup.
- ///
- /// \return The named value. It could be any type that VariantValue
- /// supports. A 'nothing' value means that the name is not recognized.
- virtual VariantValue getNamedValue(StringRef Name) {
- return VariantValue();
- }
-
/// \brief Process a matcher expression.
///
/// All the arguments passed here have already been processed.
@@ -114,21 +100,6 @@ public:
Diagnostics *Error) = 0;
};
- /// \brief Sema implementation that uses the matcher registry to process the
- /// tokens.
- class RegistrySema : public Parser::Sema {
- public:
- virtual ~RegistrySema();
- llvm::Optional<MatcherCtor> lookupMatcherCtor(StringRef MatcherName,
- const SourceRange &NameRange,
- Diagnostics *Error) override;
- VariantMatcher actOnMatcherExpression(MatcherCtor Ctor,
- const SourceRange &NameRange,
- StringRef BindID,
- ArrayRef<ParserValue> Args,
- Diagnostics *Error) override;
- };
-
/// \brief Parse a matcher expression, creating matchers from the registry.
///
/// This overload creates matchers calling directly into the registry. If the
diff --git a/include/clang/ASTMatchers/Dynamic/VariantValue.h b/include/clang/ASTMatchers/Dynamic/VariantValue.h
index cd7395b415..c6853572ec 100644
--- a/include/clang/ASTMatchers/Dynamic/VariantValue.h
+++ b/include/clang/ASTMatchers/Dynamic/VariantValue.h
@@ -78,8 +78,7 @@ public:
/// \brief Clones the provided matchers.
///
/// They should be the result of a polymorphic matcher.
- static VariantMatcher
- PolymorphicMatcher(std::vector<DynTypedMatcher> Matchers);
+ static VariantMatcher PolymorphicMatcher(std::vector<DynTypedMatcher> Matchers);
/// \brief Creates a 'variadic' operator matcher.
///
@@ -209,9 +208,6 @@ public:
VariantValue(const std::string &String);
VariantValue(const VariantMatcher &Matchers);
- /// \brief Returns true iff this is an empty value.
- bool isNothing() const { return Type == VT_Nothing; }
-
/// \brief Unsigned value functions.
bool isUnsigned() const;
unsigned getUnsigned() const;