[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang-tools-extra / clang-query / QuerySession.h
blob9a08289a253449193d9a0a0868d8ec93a24dd244
1 //===--- QuerySession.h - clang-query ---------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H
12 #include "clang/AST/ASTTypeTraits.h"
13 #include "clang/ASTMatchers/Dynamic/VariantValue.h"
14 #include "llvm/ADT/ArrayRef.h"
15 #include "llvm/ADT/StringMap.h"
17 namespace clang {
19 class ASTUnit;
21 namespace query {
23 /// Represents the state for a particular clang-query session.
24 class QuerySession {
25 public:
26 QuerySession(llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs)
27 : ASTs(ASTs), PrintOutput(false), DiagOutput(true),
28 DetailedASTOutput(false), SrcLocOutput(false), BindRoot(true),
29 PrintMatcher(false), Terminate(false), TK(TK_AsIs) {}
31 llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs;
33 bool PrintOutput;
34 bool DiagOutput;
35 bool DetailedASTOutput;
36 bool SrcLocOutput;
38 bool BindRoot;
39 bool PrintMatcher;
40 bool Terminate;
42 TraversalKind TK;
43 llvm::StringMap<ast_matchers::dynamic::VariantValue> NamedValues;
46 } // namespace query
47 } // namespace clang
49 #endif