10 #include "mlir/IR/BuiltinAttributes.h"
11 #include "mlir/IR/Operation.h"
12 #include "llvm/ADT/StringRef.h"
14 using namespace circt;
20 return name.starts_with(
"_T") || name.starts_with(
"_WIRE");
36 if (a.starts_with(
"_"))
38 if (b.starts_with(
"_"))
40 if (b.count(
'_') < a.count(
'_'))
42 if (b.count(
'_') > a.count(
'_'))
44 return a.size() <= b.size();
60 StringAttr name = a->getAttrOfType<StringAttr>(
"name");
61 if (!name || name.getValue().empty())
62 return a->getAttrOfType<StringAttr>(
"sv.namehint");
static StringAttr getNameOrHint(Operation *a)
static bool isNameBetter(StringRef a, StringRef b)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
bool isUselessName(StringRef name)
Return true if this is a possibly useless temporary name.
StringRef chooseName(StringRef a, StringRef b)
Choose a good name for an item from two options.