[Mlir-commits] [flang] [mlir] [MLIR][LLVMIR] Add support for the full form of global_{ctor, dtor} (PR #133176)

Tobias Gysi llvmlistbot at llvm.org
Thu Mar 27 00:13:32 PDT 2025


================
@@ -1438,61 +1438,73 @@ def LLVM_GlobalOp : LLVM_Op<"mlir.global",
 
 def LLVM_GlobalCtorsOp : LLVM_Op<"mlir.global_ctors", [
                            DeclareOpInterfaceMethods<SymbolUserOpInterface>]> {
-  let arguments = (ins FlatSymbolRefArrayAttr
-                   : $ctors, I32ArrayAttr
-                   : $priorities);
+  let arguments = (ins FlatSymbolRefArrayAttr:$ctors,
+                       I32ArrayAttr:$priorities,
+                       ArrayAttr:$data);
   let summary = "LLVM dialect global_ctors.";
   let description = [{
-    Specifies a list of constructor functions and priorities. The functions
-    referenced by this array will be called in ascending order of priority (i.e.
-    lowest first) when the module is loaded. The order of functions with the
-    same priority is not defined. This operation is translated to LLVM's
-    global_ctors global variable. The initializer functions are run at load
-    time. The `data` field present in LLVM's global_ctors variable is not
-    modeled here.
+    Specifies a list of constructor functions, priorities and associated data.
----------------
gysit wrote:

```suggestion
    Specifies a list of constructor functions, priorities, and associated data.
```
ultra nit:

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


More information about the Mlir-commits mailing list