9 #ifndef CIRCT_SUPPORT_BUILDERUTILS_H
10 #define CIRCT_SUPPORT_BUILDERUTILS_H
15 #include "mlir/IR/BuiltinOps.h"
16 #include "mlir/IR/ImplicitLocOpBuilder.h"
17 #include "llvm/ADT/StringSet.h"
18 #include "llvm/ADT/TypeSwitch.h"
28 std::variant<StringAttr, StringRef, Twine, const char *>
value;
39 StringAttr
get(MLIRContext *context)
const {
40 if (
auto *attr = std::get_if<StringAttr>(&
value))
42 if (
auto *ref = std::get_if<StringRef>(&
value))
44 if (
auto *twine = std::get_if<Twine>(&
value))
46 if (
auto *ptr = std::get_if<const char *>(&
value))
A helper union that can represent a StringAttr, StringRef, or Twine.
StringAttr get(MLIRContext *context) const
Return the represented string as a StringAttr.
std::variant< StringAttr, StringRef, Twine, const char * > value
StringAttrOrRef(const std::string &str)
StringAttrOrRef(const char *ptr)
StringAttrOrRef(StringAttr attr)
StringAttrOrRef(const StringRef &str)
StringAttrOrRef(const Twine &twine)
Direction get(bool isOutput)
Returns an output direction if isOutput is true, otherwise returns an input direction.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.