45 nanobind::ft_lock_guard lock(mutex);
46 return dialectSearchPrefixes;
49 nanobind::ft_lock_guard lock(mutex);
50 dialectSearchPrefixes.swap(newValues);
53 nanobind::ft_lock_guard lock(mutex);
54 dialectSearchPrefixes.push_back(std::move(value));
63 bool loadDialectModule(llvm::StringRef dialectNamespace);
68 void registerAttributeBuilder(
const std::string &attributeKind,
69 nanobind::callable pyFunc,
70 bool replace =
false);
75 void registerTypeCaster(MlirTypeID mlirTypeID, nanobind::callable typeCaster,
76 bool replace =
false);
81 void registerValueCaster(MlirTypeID mlirTypeID,
82 nanobind::callable valueCaster,
83 bool replace =
false);
88 void registerDialectImpl(
const std::string &dialectNamespace,
89 nanobind::object pyClass);
94 void registerOperationImpl(
const std::string &operationName,
95 nanobind::object pyClass,
bool replace =
false);
98 std::optional<nanobind::callable>
99 lookupAttributeBuilder(
const std::string &attributeKind);
102 std::optional<nanobind::callable> lookupTypeCaster(MlirTypeID mlirTypeID,
103 MlirDialect dialect);
106 std::optional<nanobind::callable> lookupValueCaster(MlirTypeID mlirTypeID,
107 MlirDialect dialect);
111 std::optional<nanobind::object>
112 lookupDialectClass(
const std::string &dialectNamespace);
117 std::optional<nanobind::object>
118 lookupOperationClass(llvm::StringRef operationName);
139 nanobind::ft_mutex mutex;
140 bool locTracebackEnabled_ =
false;
141 size_t locTracebackFramesLimit_ = 10;
142 std::unordered_set<std::string> userTracebackIncludeFiles;
143 std::unordered_set<std::string> userTracebackExcludeFiles;
144 std::regex userTracebackIncludeRegex;
145 bool rebuildUserTracebackIncludeRegex =
false;
146 std::regex userTracebackExcludeRegex;
147 bool rebuildUserTracebackExcludeRegex =
false;
148 llvm::StringMap<bool> isUserTracebackFilenameCache;
162 other.allocator.ptr =
nullptr;
165 MlirTypeIDAllocator
get() {
return allocator; }
171 MlirTypeIDAllocator allocator;
179 nanobind::ft_mutex mutex;
182 std::vector<std::string> dialectSearchPrefixes;
184 llvm::StringMap<nanobind::object> dialectClassMap;
186 llvm::StringMap<nanobind::object> operationClassMap;
188 llvm::StringMap<nanobind::callable> attributeBuilderMap;
197 TracebackLoc tracebackLoc;