MLIR 24.0.0git
QuerySession.h
Go to the documentation of this file.
1//===--- QuerySession.h -----------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef MLIR_TOOLS_MLIRQUERY_QUERYSESSION_H
10#define MLIR_TOOLS_MLIRQUERY_QUERYSESSION_H
11
12#include "mlir/IR/Operation.h"
14#include "llvm/ADT/StringMap.h"
15#include "llvm/Support/SourceMgr.h"
16
17namespace mlir::query {
18// Represents the state for a particular mlir-query session.
20public:
21 QuerySession(Operation *rootOp, llvm::SourceMgr &sourceMgr, unsigned bufferId,
22 const matcher::Registry &matcherRegistry)
23 : rootOp(rootOp), sourceMgr(sourceMgr), bufferId(bufferId),
24 matcherRegistry(matcherRegistry) {}
25
26 Operation *getRootOp() { return rootOp; }
27 llvm::SourceMgr &getSourceManager() const { return sourceMgr; }
28 unsigned getBufferId() { return bufferId; }
29 const matcher::Registry &getRegistryData() const { return matcherRegistry; }
30
31 llvm::StringMap<matcher::VariantValue> namedValues;
32 bool terminate = false;
33
34private:
35 Operation *rootOp;
36 llvm::SourceMgr &sourceMgr;
37 unsigned bufferId;
38 const matcher::Registry &matcherRegistry;
39};
40} // namespace mlir::query
41
42#endif // MLIR_TOOLS_MLIRQUERY_QUERYSESSION_H
Operation is the basic unit of execution within MLIR.
Definition Operation.h:87
const matcher::Registry & getRegistryData() const
QuerySession(Operation *rootOp, llvm::SourceMgr &sourceMgr, unsigned bufferId, const matcher::Registry &matcherRegistry)
llvm::StringMap< matcher::VariantValue > namedValues
llvm::SourceMgr & getSourceManager() const