CIRCT 24.0.0git
Loading...
Searching...
No Matches
LLHDTypes.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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 CIRCT_DIALECT_LLHD_LLHDTYPES_H
10#define CIRCT_DIALECT_LLHD_LLHDTYPES_H
11
12#include "mlir/IR/Attributes.h"
13#include "mlir/IR/Types.h"
14
15namespace circt {
16namespace llhd {
17
18class NetType;
19class RefType;
20
21/// Common base of types wrapping a nested type.
22class WrapperType : public mlir::Type {
23public:
24 static bool classof(mlir::Type type) {
25 return llvm::isa<RefType, NetType>(type);
26 }
27
28 /// Get the wrapped type.
29 mlir::Type getNestedType() const;
30
31protected:
32 using mlir::Type::Type;
33};
34
35} // namespace llhd
36} // namespace circt
37
38#define GET_TYPEDEF_CLASSES
39#include "circt/Dialect/LLHD/LLHDTypes.h.inc"
40
41#define GET_ATTRDEF_CLASSES
42#include "circt/Dialect/LLHD/LLHDAttributes.h.inc"
43
44namespace llvm {
45template <>
46struct PointerLikeTypeTraits<circt::llhd::TimeAttr>
47 : public PointerLikeTypeTraits<mlir::Attribute> {
48 static inline circt::llhd::TimeAttr getFromVoidPointer(void *p) {
49 return circt::llhd::TimeAttr::getFromOpaquePointer(p);
50 }
51};
52} // namespace llvm
53
54#endif // CIRCT_DIALECT_LLHD_LLHDTYPES_H
Common base of types wrapping a nested type.
Definition LLHDTypes.h:22
static bool classof(mlir::Type type)
Definition LLHDTypes.h:24
mlir::Type getNestedType() const
Get the wrapped type.
Definition LLHDTypes.cpp:33
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
static circt::llhd::TimeAttr getFromVoidPointer(void *p)
Definition LLHDTypes.h:48