[flang-commits] [mlir] [flang] [MLIR][LLVM] Enable export of DISubprograms on function declarations (PR #78026)

Christian Ulmann via flang-commits flang-commits at lists.llvm.org
Sat Jan 13 08:31:51 PST 2024


================
@@ -169,6 +169,20 @@ llvm.func @empty_types() {
 
 // -----
 
+#di_file = #llvm.di_file<"foo.mlir" in "/test/">
+#di_subprogram = #llvm.di_subprogram<
+  scope = #di_file, name = "func_decl_with_subprogram", file = #di_file, subprogramFlags = "Optimized"
+>
+
+// CHECK-LABEL: declare !dbg
+// CHECK-SAME: ![[SUBPROGRAM:.*]] i32 @func_decl_with_subprogram(
+llvm.func @func_decl_with_subprogram() -> (i32) loc(fused<#di_subprogram>["foo.mlir":2:1])
+
+// CHECK: ![[SUBPROGRAM]] = !DISubprogram(name: "func_decl_with_subprogram", scope: ![[FILE:.*]], file: ![[FILE]], spFlags: DISPFlagOptimized)
+// CHECK: ![[FILE:.*]] = !DIFile(filename: "foo.mlir", directory: "/test/")
----------------
Dinistro wrote:

Moved it around and didn't update it properly, good catch.

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


More information about the flang-commits mailing list