blob: e6a26acd251965bd8e5ecde24bcf29b5697c9267 [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)
Peter Collingbourne8b1265b2013-11-08 00:08:23 +000028 : ASTs(ASTs), OutKind(OK_Diag), BindRoot(true) {}
29
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;
Samuel Benzaquen1f6066c2014-04-23 14:04:52 +000033 llvm::StringMap<ast_matchers::dynamic::VariantValue> NamedValues;
Peter Collingbourne8b1265b2013-11-08 00:08:23 +000034};
35
36} // namespace query
37} // namespace clang
38
39#endif