CIRCT  20.0.0git
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 
19 namespace circt::om {
20 
21 /// A module name, and the name of an instance inside that module.
22 struct PathElement {
23  PathElement(mlir::StringAttr module, mlir::StringAttr 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) {
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
size_t hash_combine(size_t h1, size_t h2)
C++'s stdlib doesn't have a hash_combine function. This is a simple one.
Definition: Utils.h:32
A module name, and the name of an instance inside that module.
Definition: OMAttributes.h:22
bool operator==(const PathElement &rhs) const
Definition: OMAttributes.h:26
mlir::StringAttr module
Definition: OMAttributes.h:35
friend llvm::hash_code hash_value(const PathElement &arg)
Definition: OMAttributes.h:31
PathElement(mlir::StringAttr module, mlir::StringAttr instance)
Definition: OMAttributes.h:23
mlir::StringAttr instance
Definition: OMAttributes.h:36