CIRCT  19.0.0git
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 
14 namespace circt {
15 
16 /// Return true if this is a possibly useless temporary name.
17 /// This method is FIRRTL-centric, dropping useless temporaries.
18 bool isUselessName(StringRef name);
19 
20 /// Choose a good name for an item from two options.
21 StringRef chooseName(StringRef a, StringRef b);
22 
23 /// Choose a good name for an item from two options.
24 StringAttr 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.
28 StringAttr chooseName(Operation *a, Operation *b);
29 
30 } // namespace circt
31 
32 #endif // CIRCT_SUPPORT_NAMING_H
This file defines an intermediate representation for circuits acting as an abstraction for constraint...
Definition: DebugAnalysis.h:21
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