CIRCT 20.0.0git
Loading...
Searching...
No Matches
OMUtils.h
Go to the documentation of this file.
1//===- OMUtils.h - OM Utility Functions -----------------------------------===//
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_OM_OMUTILS_H
10#define CIRCT_DIALECT_OM_OMUTILS_H
11
12#include "circt/Support/LLVM.h"
13#include "llvm/ADT/STLExtras.h"
14
15namespace circt::om {
16
17struct PathElement;
18class PathAttr;
19
20/// Parse a target string of the form "Foo/bar:Bar/baz" in to a base path.
21ParseResult parseBasePath(MLIRContext *context, StringRef spelling,
22 PathAttr &path);
23
24/// Parse a target string in to a path.
25/// "Foo/bar:Bar/baz:Baz>wire.a[1]"
26/// |--------------| Path
27/// |--| Module
28/// |--| Ref
29/// |---| Field
30ParseResult parsePath(MLIRContext *context, StringRef spelling, PathAttr &path,
31 StringAttr &module, StringAttr &ref, StringAttr &field);
32
33} // namespace circt::om
34
35#endif // CIRCT_DIALECT_OM_OMUTILS_H
ParseResult parsePath(MLIRContext *context, StringRef spelling, PathAttr &path, StringAttr &module, StringAttr &ref, StringAttr &field)
Parse a target string in to a path.
Definition OMUtils.cpp:182
ParseResult parseBasePath(MLIRContext *context, StringRef spelling, PathAttr &path)
Parse a target string of the form "Foo/bar:Bar/baz" in to a base path.
Definition OMUtils.cpp:177