diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2014-02-01 01:42:46 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2014-02-01 01:42:46 +0000 |
| commit | d9a0f254bcd7e550bd504358fcda7a8e5b9906b3 (patch) | |
| tree | f5ade30942fa795900b328c42bcaa679530417fe /clang-tools-extra/clang-query/tool | |
| parent | c31176da0265ee3b47c76e3a6af8273d5dd26561 (diff) | |
| download | bcm5719-llvm-d9a0f254bcd7e550bd504358fcda7a8e5b9906b3.tar.gz bcm5719-llvm-d9a0f254bcd7e550bd504358fcda7a8e5b9906b3.zip | |
Add completion to the query parser, and hook it up to clang-query.
Differential Revision: http://llvm-reviews.chandlerc.com/D2263
llvm-svn: 200604
Diffstat (limited to 'clang-tools-extra/clang-query/tool')
| -rw-r--r-- | clang-tools-extra/clang-query/tool/ClangQuery.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-query/tool/ClangQuery.cpp b/clang-tools-extra/clang-query/tool/ClangQuery.cpp index 0150d416064..f9b62e0866c 100644 --- a/clang-tools-extra/clang-query/tool/ClangQuery.cpp +++ b/clang-tools-extra/clang-query/tool/ClangQuery.cpp @@ -96,7 +96,7 @@ int main(int argc, const char **argv) { for (cl::list<std::string>::iterator I = Commands.begin(), E = Commands.end(); I != E; ++I) { - QueryRef Q = ParseQuery(I->c_str()); + QueryRef Q = QueryParser::parse(I->c_str()); if (!Q->run(llvm::outs(), QS)) return 1; } @@ -113,15 +113,16 @@ int main(int argc, const char **argv) { std::string Line; std::getline(Input, Line); - QueryRef Q = ParseQuery(Line.c_str()); + QueryRef Q = QueryParser::parse(Line.c_str()); if (!Q->run(llvm::outs(), QS)) return 1; } } } else { LineEditor LE("clang-query"); + LE.setListCompleter(QueryParser::complete); while (llvm::Optional<std::string> Line = LE.readLine()) { - QueryRef Q = ParseQuery(*Line); + QueryRef Q = QueryParser::parse(*Line); Q->run(llvm::outs(), QS); } } |

