2013-11-08 08:08:23 +08:00
|
|
|
//===--- QuerySession.h - clang-query ---------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2013-11-08 08:08:23 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H
|
|
|
|
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H
|
|
|
|
|
2019-12-30 03:26:11 +08:00
|
|
|
#include "clang/AST/ASTTypeTraits.h"
|
2014-04-23 22:04:52 +08:00
|
|
|
#include "clang/ASTMatchers/Dynamic/VariantValue.h"
|
2014-01-08 04:05:01 +08:00
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
2014-04-23 22:04:52 +08:00
|
|
|
#include "llvm/ADT/StringMap.h"
|
2013-11-08 08:08:23 +08:00
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
|
|
|
|
class ASTUnit;
|
|
|
|
|
|
|
|
namespace query {
|
|
|
|
|
|
|
|
/// Represents the state for a particular clang-query session.
|
|
|
|
class QuerySession {
|
|
|
|
public:
|
2014-04-25 23:06:18 +08:00
|
|
|
QuerySession(llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs)
|
2018-10-25 04:33:55 +08:00
|
|
|
: ASTs(ASTs), PrintOutput(false), DiagOutput(true),
|
|
|
|
DetailedASTOutput(false), BindRoot(true), PrintMatcher(false),
|
2020-12-11 07:52:35 +08:00
|
|
|
Terminate(false), TK(TK_AsIs) {}
|
2013-11-08 08:08:23 +08:00
|
|
|
|
2014-04-25 23:06:18 +08:00
|
|
|
llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs;
|
2018-10-25 04:33:55 +08:00
|
|
|
|
|
|
|
bool PrintOutput;
|
|
|
|
bool DiagOutput;
|
|
|
|
bool DetailedASTOutput;
|
|
|
|
|
2013-11-08 08:08:23 +08:00
|
|
|
bool BindRoot;
|
2018-10-20 17:13:59 +08:00
|
|
|
bool PrintMatcher;
|
2015-08-06 19:56:57 +08:00
|
|
|
bool Terminate;
|
2019-12-30 03:26:11 +08:00
|
|
|
|
2020-12-11 07:52:35 +08:00
|
|
|
TraversalKind TK;
|
2014-04-23 22:04:52 +08:00
|
|
|
llvm::StringMap<ast_matchers::dynamic::VariantValue> NamedValues;
|
2013-11-08 08:08:23 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace query
|
|
|
|
} // namespace clang
|
|
|
|
|
|
|
|
#endif
|