blob: 9a08289a253449193d9a0a0868d8ec93a24dd244 [file] [log] [blame]
Peter Collingbourne8b1265b2013-11-08 00:08:231//===--- QuerySession.h - clang-query ---------------------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:563// 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
Peter Collingbourne8b1265b2013-11-08 00:08:236//
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
Stephen Kelly10f0f982019-12-29 19:26:1112#include "clang/AST/ASTTypeTraits.h"
Samuel Benzaquen1f6066c2014-04-23 14:04:5213#include "clang/ASTMatchers/Dynamic/VariantValue.h"
Chandler Carruth85e6e872014-01-07 20:05:0114#include "llvm/ADT/ArrayRef.h"
Samuel Benzaquen1f6066c2014-04-23 14:04:5215#include "llvm/ADT/StringMap.h"
Peter Collingbourne8b1265b2013-11-08 00:08:2316
17namespace clang {
18
19class ASTUnit;
20
21namespace query {
22
23/// Represents the state for a particular clang-query session.
24class QuerySession {
25public:
David Blaikie329be892014-04-25 15:06:1826 QuerySession(llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs)
Stephen Kelly70d77172018-10-24 20:33:5527 : ASTs(ASTs), PrintOutput(false), DiagOutput(true),
Stephen Kelly8d018c72020-12-12 18:39:4928 DetailedASTOutput(false), SrcLocOutput(false), BindRoot(true),
29 PrintMatcher(false), Terminate(false), TK(TK_AsIs) {}
Peter Collingbourne8b1265b2013-11-08 00:08:2330
David Blaikie329be892014-04-25 15:06:1831 llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs;
Stephen Kelly70d77172018-10-24 20:33:5532
33 bool PrintOutput;
34 bool DiagOutput;
35 bool DetailedASTOutput;
Stephen Kelly8d018c72020-12-12 18:39:4936 bool SrcLocOutput;
Stephen Kelly70d77172018-10-24 20:33:5537
Peter Collingbourne8b1265b2013-11-08 00:08:2338 bool BindRoot;
Stephen Kelly4a5b01d2018-10-20 09:13:5939 bool PrintMatcher;
Aaron Ballman58907172015-08-06 11:56:5740 bool Terminate;
Stephen Kelly10f0f982019-12-29 19:26:1141
Alexander Kornienko027899d2020-12-10 23:52:3542 TraversalKind TK;
Samuel Benzaquen1f6066c2014-04-23 14:04:5243 llvm::StringMap<ast_matchers::dynamic::VariantValue> NamedValues;
Peter Collingbourne8b1265b2013-11-08 00:08:2344};
45
46} // namespace query
47} // namespace clang
48
49#endif