diff options
author | Samuel Benzaquen <sbenza@google.com> | 2014-04-23 14:04:52 +0000 |
---|---|---|
committer | Samuel Benzaquen <sbenza@google.com> | 2014-04-23 14:04:52 +0000 |
commit | 1f6066c9acced984fb808284f40c834a8740fb2b (patch) | |
tree | 9791b9784fc6376a872c3a048630e0ae4d965c6f /clang-tools-extra/clang-query/QueryParser.h | |
parent | 5a7c3643437c262137bd3dac7f6a0f5b9e8501be (diff) | |
download | bcm5719-llvm-1f6066c9acced984fb808284f40c834a8740fb2b.tar.gz bcm5719-llvm-1f6066c9acced984fb808284f40c834a8740fb2b.zip |
Add new 'let' command to bind arbitrary values into constants.
Summary:
Add new 'let' command to bind arbitrary values into constants.
These constants can then be used in the matcher expressions.
Reviewers: pcc
CC: cfe-commits
Differential Revision: http://reviews.llvm.org/D3383
llvm-svn: 206984
Diffstat (limited to 'clang-tools-extra/clang-query/QueryParser.h')
-rw-r--r-- | clang-tools-extra/clang-query/QueryParser.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/clang-tools-extra/clang-query/QueryParser.h b/clang-tools-extra/clang-query/QueryParser.h index b448c907dc2..5ebeaf2c473 100644 --- a/clang-tools-extra/clang-query/QueryParser.h +++ b/clang-tools-extra/clang-query/QueryParser.h @@ -11,6 +11,7 @@ #define LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_PARSER_H #include "Query.h" +#include "QuerySession.h" #include "llvm/LineEditor/LineEditor.h" #include <stddef.h> @@ -24,19 +25,20 @@ public: /// Parse \a Line as a query. /// /// \return A QueryRef representing the query, which may be an InvalidQuery. - static QueryRef parse(StringRef Line); + static QueryRef parse(StringRef Line, const QuerySession &QS); /// Compute a list of completions for \a Line assuming a cursor at /// \param Pos characters past the start of \a Line, ordered from most /// likely to least likely. /// /// \return A vector of completions for \a Line. - static std::vector<llvm::LineEditor::Completion> complete(StringRef Line, - size_t Pos); + static std::vector<llvm::LineEditor::Completion> + complete(StringRef Line, size_t Pos, const QuerySession &QS); private: - QueryParser(StringRef Line) - : Begin(Line.data()), End(Line.data() + Line.size()), CompletionPos(0) {} + QueryParser(StringRef Line, const QuerySession &QS) + : Begin(Line.data()), End(Line.data() + Line.size()), CompletionPos(0), + QS(QS) {} StringRef lexWord(); @@ -45,6 +47,7 @@ private: QueryRef parseSetBool(bool QuerySession::*Var); QueryRef parseSetOutputKind(); + QueryRef completeMatcherExpression(); QueryRef endQuery(QueryRef Q); @@ -59,6 +62,8 @@ private: const char *CompletionPos; std::vector<llvm::LineEditor::Completion> Completions; + + const QuerySession &QS; }; } // namespace query |