MLIR
22.0.0git
include
mlir
Query
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
"
13
#include "
mlir/Query/Matcher/Registry.h
"
14
#include "llvm/ADT/StringMap.h"
15
#include "llvm/Support/SourceMgr.h"
16
17
namespace
mlir::query
{
18
19
class
Registry;
20
// Represents the state for a particular mlir-query session.
21
class
QuerySession
{
22
public
:
23
QuerySession
(
Operation
*rootOp, llvm::SourceMgr &sourceMgr,
unsigned
bufferId,
24
const
matcher::Registry
&matcherRegistry)
25
: rootOp(rootOp), sourceMgr(sourceMgr), bufferId(bufferId),
26
matcherRegistry(matcherRegistry) {}
27
28
Operation
*
getRootOp
() {
return
rootOp; }
29
llvm::SourceMgr &
getSourceManager
()
const
{
return
sourceMgr; }
30
unsigned
getBufferId
() {
return
bufferId; }
31
const
matcher::Registry
&
getRegistryData
()
const
{
return
matcherRegistry; }
32
33
llvm::StringMap<matcher::VariantValue>
namedValues
;
34
bool
terminate
=
false
;
35
36
private
:
37
Operation
*rootOp;
38
llvm::SourceMgr &sourceMgr;
39
unsigned
bufferId;
40
const
matcher::Registry
&matcherRegistry;
41
};
42
43
}
// namespace mlir::query
44
45
#endif
// MLIR_TOOLS_MLIRQUERY_QUERYSESSION_H
Operation.h
Registry.h
mlir::Operation
Operation is the basic unit of execution within MLIR.
Definition
Operation.h:88
mlir::query::QuerySession::terminate
bool terminate
Definition
QuerySession.h:34
mlir::query::QuerySession::getRootOp
Operation * getRootOp()
Definition
QuerySession.h:28
mlir::query::QuerySession::getRegistryData
const matcher::Registry & getRegistryData() const
Definition
QuerySession.h:31
mlir::query::QuerySession::QuerySession
QuerySession(Operation *rootOp, llvm::SourceMgr &sourceMgr, unsigned bufferId, const matcher::Registry &matcherRegistry)
Definition
QuerySession.h:23
mlir::query::QuerySession::namedValues
llvm::StringMap< matcher::VariantValue > namedValues
Definition
QuerySession.h:33
mlir::query::QuerySession::getSourceManager
llvm::SourceMgr & getSourceManager() const
Definition
QuerySession.h:29
mlir::query::QuerySession::getBufferId
unsigned getBufferId()
Definition
QuerySession.h:30
mlir::query::matcher::Registry
Definition
Registry.h:28
mlir::query
Definition
ErrorBuilder.h:20
Generated on
for MLIR by
1.14.0