llvm/clang-tools-extra/clang-query/Query.h

//===--- Query.h - clang-query ----------------------------------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_H

#include "QuerySession.h"
#include "clang/ASTMatchers/Dynamic/VariantValue.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include <string>

namespace clang {
namespace query {

enum OutputKind {};

enum QueryKind {};

class QuerySession;

struct Query : llvm::RefCountedBase<Query> {};

QueryRef;

/// Any query which resulted in a parse error.  The error message is in ErrStr.
struct InvalidQuery : Query {};

/// No-op query (i.e. a blank line).
struct NoOpQuery : Query {};

/// Query for "help".
struct HelpQuery : Query {};

/// Query for "quit".
struct QuitQuery : Query {};

/// Query for "match MATCHER".
struct MatchQuery : Query {};

struct LetQuery : Query {};

template <typename T> struct SetQueryKind {};

template <> struct SetQueryKind<bool> {};

template <> struct SetQueryKind<OutputKind> {};

template <> struct SetQueryKind<TraversalKind> {};

/// Query for "set VAR VALUE".
template <typename T> struct SetQuery : Query {};

// Implements the exclusive 'set output dump|diag|print' options.
struct SetExclusiveOutputQuery : Query {};

// Implements the non-exclusive 'set output dump|diag|print' options.
struct SetNonExclusiveOutputQuery : Query {};

struct EnableOutputQuery : SetNonExclusiveOutputQuery {};

struct DisableOutputQuery : SetNonExclusiveOutputQuery {};

struct FileQuery : Query {};

} // namespace query
} // namespace clang

#endif