Peter Collingbourne | 8b1265b | 2013-11-08 00:08:23 +0000 | [diff] [blame] | 1 | //===--- QuerySession.h - clang-query ---------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H |
| 11 | #define LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H |
| 12 | |
Peter Collingbourne | 8b1265b | 2013-11-08 00:08:23 +0000 | [diff] [blame] | 13 | #include "Query.h" |
Samuel Benzaquen | 1f6066c | 2014-04-23 14:04:52 +0000 | [diff] [blame] | 14 | #include "clang/ASTMatchers/Dynamic/VariantValue.h" |
Chandler Carruth | 85e6e87 | 2014-01-07 20:05:01 +0000 | [diff] [blame] | 15 | #include "llvm/ADT/ArrayRef.h" |
Samuel Benzaquen | 1f6066c | 2014-04-23 14:04:52 +0000 | [diff] [blame] | 16 | #include "llvm/ADT/StringMap.h" |
Peter Collingbourne | 8b1265b | 2013-11-08 00:08:23 +0000 | [diff] [blame] | 17 | |
| 18 | namespace clang { |
| 19 | |
| 20 | class ASTUnit; |
| 21 | |
| 22 | namespace query { |
| 23 | |
| 24 | /// Represents the state for a particular clang-query session. |
| 25 | class QuerySession { |
| 26 | public: |
David Blaikie | 329be89 | 2014-04-25 15:06:18 +0000 | [diff] [blame] | 27 | QuerySession(llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs) |
Aaron Ballman | 5890717 | 2015-08-06 11:56:57 +0000 | [diff] [blame] | 28 | : ASTs(ASTs), OutKind(OK_Diag), BindRoot(true), Terminate(false) {} |
Peter Collingbourne | 8b1265b | 2013-11-08 00:08:23 +0000 | [diff] [blame] | 29 | |
David Blaikie | 329be89 | 2014-04-25 15:06:18 +0000 | [diff] [blame] | 30 | llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs; |
Peter Collingbourne | 8b1265b | 2013-11-08 00:08:23 +0000 | [diff] [blame] | 31 | OutputKind OutKind; |
| 32 | bool BindRoot; |
Aaron Ballman | 5890717 | 2015-08-06 11:56:57 +0000 | [diff] [blame] | 33 | bool Terminate; |
Samuel Benzaquen | 1f6066c | 2014-04-23 14:04:52 +0000 | [diff] [blame] | 34 | llvm::StringMap<ast_matchers::dynamic::VariantValue> NamedValues; |
Peter Collingbourne | 8b1265b | 2013-11-08 00:08:23 +0000 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | } // namespace query |
| 38 | } // namespace clang |
| 39 | |
| 40 | #endif |