[Mlir-commits] [mlir] [MLIR][Python] Make location optional in Python-defined dialect loading (PR #186172)

Maksim Levental llvmlistbot at llvm.org
Thu Mar 12 19:02:09 PDT 2026


================
@@ -804,9 +805,10 @@ def _emit_dialect(cls) -> None:
 
     @classmethod
     def _emit_module(cls) -> ir.Module:
-        m = ir.Module.create()
-        with ir.InsertionPoint(m.body):
-            cls._emit_dialect()
+        with ir.Location.unknown() if not ir.Location.current else nullcontext():
----------------
makslevental wrote:

Ya you're right - current just queries the "thread context" stack.

https://github.com/llvm/llvm-project/pull/186172


More information about the Mlir-commits mailing list