CIRCT 22.0.0git
Loading...
Searching...
No Matches
LTLDialect.cpp
Go to the documentation of this file.
1//===- LTLDialect.cpp - LTL dialect implementation ------------------------===//
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
14#include "mlir/IR/DialectImplementation.h"
15#include "llvm/ADT/TypeSwitch.h"
16
17using namespace circt;
18using namespace ltl;
19
20void LTLDialect::initialize() {
21 addTypes<
22#define GET_TYPEDEF_LIST
23#include "circt/Dialect/LTL/LTLTypes.cpp.inc"
24 >();
25 addOperations<
26#define GET_OP_LIST
27#include "circt/Dialect/LTL/LTL.cpp.inc"
28 >();
29}
30
31Operation *LTLDialect::materializeConstant(OpBuilder &builder, Attribute value,
32 Type type, Location loc) {
33 // Materialize boolean constants as ltl.boolean_constant for property types.
34 if (auto boolAttr = dyn_cast<BoolAttr>(value))
35 if (isa<PropertyType>(type))
36 return BooleanConstantOp::create(builder, loc, boolAttr);
37
38 return nullptr;
39}
40
41#include "circt/Dialect/LTL/LTLDialect.cpp.inc"
42#include "circt/Dialect/LTL/LTLEnums.cpp.inc"
43
44#define GET_TYPEDEF_CLASSES
45#include "circt/Dialect/LTL/LTLTypes.cpp.inc"
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition ltl.py:1