clang-tools  14.0.0git
QuerySession.h
Go to the documentation of this file.
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 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H
11 
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"
16 
17 namespace clang {
18 
19 class ASTUnit;
20 
21 namespace query {
22 
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) {}
30 
31  llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs;
32 
34  bool DiagOutput;
37 
38  bool BindRoot;
40  bool Terminate;
41 
42  TraversalKind TK;
43  llvm::StringMap<ast_matchers::dynamic::VariantValue> NamedValues;
44 };
45 
46 } // namespace query
47 } // namespace clang
48 
49 #endif
clang::query::QuerySession::DiagOutput
bool DiagOutput
Definition: QuerySession.h:34
clang::query::QuerySession::TK
TraversalKind TK
Definition: QuerySession.h:42
clang::query::QuerySession::SrcLocOutput
bool SrcLocOutput
Definition: QuerySession.h:36
clang::query::QuerySession::PrintMatcher
bool PrintMatcher
Definition: QuerySession.h:39
clang::query::QuerySession::QuerySession
QuerySession(llvm::ArrayRef< std::unique_ptr< ASTUnit >> ASTs)
Definition: QuerySession.h:26
clang::query::QuerySession::PrintOutput
bool PrintOutput
Definition: QuerySession.h:33
clang::query::QuerySession::ASTs
llvm::ArrayRef< std::unique_ptr< ASTUnit > > ASTs
Definition: QuerySession.h:31
clang::query::QuerySession::Terminate
bool Terminate
Definition: QuerySession.h:40
clang::query::QuerySession::NamedValues
llvm::StringMap< ast_matchers::dynamic::VariantValue > NamedValues
Definition: QuerySession.h:43
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ApplyReplacements.h:27
clang::query::QuerySession::DetailedASTOutput
bool DetailedASTOutput
Definition: QuerySession.h:35
clang::query::QuerySession
Represents the state for a particular clang-query session.
Definition: QuerySession.h:24
clang::query::QuerySession::BindRoot
bool BindRoot
Definition: QuerySession.h:38