2013-11-08 00:08:23 +00:00
|
|
|
//===--- QuerySession.h - clang-query ---------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 08:50:56 +00: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 00:08:23 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H
|
|
|
|
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H
|
|
|
|
|
2019-12-29 19:26:11 +00:00
|
|
|
#include "clang/AST/ASTTypeTraits.h"
|
2014-04-23 14:04:52 +00:00
|
|
|
#include "clang/ASTMatchers/Dynamic/VariantValue.h"
|
2014-01-07 20:05:01 +00:00
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
2014-04-23 14:04:52 +00:00
|
|
|
#include "llvm/ADT/StringMap.h"
|
2013-11-08 00:08:23 +00:00
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
|
|
|
|
class ASTUnit;
|
|
|
|
|
|
|
|
namespace query {
|
|
|
|
|
|
|
|
/// Represents the state for a particular clang-query session.
|
|
|
|
class QuerySession {
|
|
|
|
public:
|
2014-04-25 15:06:18 +00:00
|
|
|
QuerySession(llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs)
|
2018-10-24 20:33:55 +00:00
|
|
|
: ASTs(ASTs), PrintOutput(false), DiagOutput(true),
|
2024-05-17 08:06:46 -04:00
|
|
|
DetailedASTOutput(false), BindRoot(true), PrintMatcher(false),
|
2024-11-05 21:30:58 +08:00
|
|
|
EnableProfile(false), Terminate(false), TK(TK_AsIs) {}
|
2013-11-08 00:08:23 +00:00
|
|
|
|
2014-04-25 15:06:18 +00:00
|
|
|
llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs;
|
2018-10-24 20:33:55 +00:00
|
|
|
|
|
|
|
bool PrintOutput;
|
|
|
|
bool DiagOutput;
|
|
|
|
bool DetailedASTOutput;
|
|
|
|
|
2013-11-08 00:08:23 +00:00
|
|
|
bool BindRoot;
|
2018-10-20 09:13:59 +00:00
|
|
|
bool PrintMatcher;
|
2024-11-05 21:30:58 +08:00
|
|
|
bool EnableProfile;
|
2015-08-06 11:56:57 +00:00
|
|
|
bool Terminate;
|
2019-12-29 19:26:11 +00:00
|
|
|
|
2020-12-11 00:52:35 +01:00
|
|
|
TraversalKind TK;
|
2014-04-23 14:04:52 +00:00
|
|
|
llvm::StringMap<ast_matchers::dynamic::VariantValue> NamedValues;
|
2013-11-08 00:08:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace query
|
|
|
|
} // namespace clang
|
|
|
|
|
|
|
|
#endif
|