blob: 162289f8c3a3c5ae5d844469f02a5768d977ea4d [file] [log] [blame]
Peter Collingbourne8b1265b2013-11-08 00:08:23 +00001//===--- 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 Collingbourne8b1265b2013-11-08 00:08:23 +000013#include "Query.h"
Samuel Benzaquen1f6066c2014-04-23 14:04:52 +000014#include "clang/ASTMatchers/Dynamic/VariantValue.h"
Chandler Carruth85e6e872014-01-07 20:05:01 +000015#include "llvm/ADT/ArrayRef.h"
Samuel Benzaquen1f6066c2014-04-23 14:04:52 +000016#include "llvm/ADT/StringMap.h"
Peter Collingbourne8b1265b2013-11-08 00:08:23 +000017
18namespace clang {
19
20class ASTUnit;
21
22namespace query {
23
24/// Represents the state for a particular clang-query session.
25class QuerySession {
26public:
David Blaikie329be892014-04-25 15:06:18 +000027 QuerySession(llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs)
Aaron Ballman58907172015-08-06 11:56:57 +000028 : ASTs(ASTs), OutKind(OK_Diag), BindRoot(true), Terminate(false) {}
Peter Collingbourne8b1265b2013-11-08 00:08:23 +000029
David Blaikie329be892014-04-25 15:06:18 +000030 llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs;
Peter Collingbourne8b1265b2013-11-08 00:08:23 +000031 OutputKind OutKind;
32 bool BindRoot;
Aaron Ballman58907172015-08-06 11:56:57 +000033 bool Terminate;
Samuel Benzaquen1f6066c2014-04-23 14:04:52 +000034 llvm::StringMap<ast_matchers::dynamic::VariantValue> NamedValues;
Peter Collingbourne8b1265b2013-11-08 00:08:23 +000035};
36
37} // namespace query
38} // namespace clang
39
40#endif