CIRCT 24.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}
26
27Operation *LTLDialect::materializeConstant(OpBuilder &builder, Attribute value,
28 Type type, Location loc) {
29 // Materialize boolean constants as ltl.boolean_constant for property types.
30 if (auto boolAttr = dyn_cast<BoolAttr>(value))
31 if (isa<PropertyType>(type))
32 return BooleanConstantOp::create(builder, loc, boolAttr);
33
34 return nullptr;
35}
36
37#include "circt/Dialect/LTL/LTLDialect.cpp.inc"
38#include "circt/Dialect/LTL/LTLEnums.cpp.inc"
39
40#define GET_TYPEDEF_CLASSES
41#include "circt/Dialect/LTL/LTLTypes.cpp.inc"
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition ltl.py:1