CIRCT 20.0.0git
Loading...
Searching...
No Matches
Naming.h
Go to the documentation of this file.
1//===- Naming.h - Utilities for handling names ------------------*- C++ -*-===//
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_SUPPORT_NAMING_H
10#define CIRCT_SUPPORT_NAMING_H
11
12#include "circt/Support/LLVM.h"
13
14namespace circt {
15
16/// Return true if this is a possibly useless temporary name.
17/// This method is FIRRTL-centric, dropping useless temporaries.
18bool isUselessName(StringRef name);
19
20/// Choose a good name for an item from two options.
21StringRef chooseName(StringRef a, StringRef b);
22
23/// Choose a good name for an item from two options.
24StringAttr chooseName(StringAttr a, StringAttr b);
25
26/// Choose the better name between two ops. Picks the "name" attribute as first
27/// preference, using "sv.namehint" as an alternative.
28StringAttr chooseName(Operation *a, Operation *b);
29
30} // namespace circt
31
32#endif // CIRCT_SUPPORT_NAMING_H
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
bool isUselessName(StringRef name)
Return true if this is a possibly useless temporary name.
Definition Naming.cpp:16
StringRef chooseName(StringRef a, StringRef b)
Choose a good name for an item from two options.
Definition Naming.cpp:47