CIRCT 20.0.0git
Loading...
Searching...
No Matches
OMAttributes.h
Go to the documentation of this file.
1//===- OMAttributes.h - Object Model attribute declarations ---------------===//
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// This file contains the Object Model attribute declarations.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CIRCT_DIALECT_OM_OMATTRIBUTES_H
14#define CIRCT_DIALECT_OM_OMATTRIBUTES_H
15
17#include "mlir/IR/BuiltinAttributes.h"
18
19namespace circt::om {
20
21/// A module name, and the name of an instance inside that module.
23 PathElement(mlir::StringAttr module, mlir::StringAttr instance)
24 : module(module), instance(instance) {}
25
26 bool operator==(const PathElement &rhs) const {
27 return module == rhs.module && instance == rhs.instance;
28 }
29
30 // NOLINTNEXTLINE(readability-identifier-naming)
31 friend llvm::hash_code hash_value(const PathElement &arg) {
32 return ::llvm::hash_combine(arg.module, arg.instance);
33 }
34
35 mlir::StringAttr module;
36 mlir::StringAttr instance;
37};
38} // namespace circt::om
39
41#include "mlir/IR/Attributes.h"
42
43#define GET_ATTRDEF_CLASSES
44#include "circt/Dialect/OM/OMAttributes.h.inc"
45
46#endif // CIRCT_DIALECT_OM_OMATTRIBUTES_H
A module name, and the name of an instance inside that module.
bool operator==(const PathElement &rhs) const
mlir::StringAttr mlir::StringAttr instance
friend llvm::hash_code hash_value(const PathElement &arg)
PathElement(mlir::StringAttr module, mlir::StringAttr instance)