[Mlir-commits] [mlir] [mlir] Add support for DIGlobalVariable and DIGlobalVariableExpression (PR #73367)

Christian Ulmann llvmlistbot at llvm.org
Wed Nov 29 00:53:43 PST 2023


================
@@ -258,3 +258,11 @@ llvm.mlir.global @target_ext_init() : !llvm.target<"spirv.Image", i32, 0> {
 
 // expected-error @+1 {{global with target extension type can only be initialized with zero-initializer}}
 llvm.mlir.global @target_fail(0 : i64) : !llvm.target<"spirv.Image", i32, 0>
+
+// -----
+
+// CHECK: llvm.mlir.global external @global_with_expr() {addr_space = 0 : i32, dbg_expr = #llvm.di_global_variable_expression<var = <scope = #di_compile_unit, name = "global_with_expr", linkageName = "global_with_expr", file = #di_file, line = 370, type = #di_basic_type, isLocalToUnit = true, isDefined = true, alignInBits = 8>, expr = <>>} : i64
+#di_file = #llvm.di_file<"not" in "existence">
+#di_compile_unit = #llvm.di_compile_unit<sourceLanguage = DW_LANG_C, file = #di_file, producer = "MLIR", isOptimized = true, emissionKind = Full>
+#di_basic_type = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "uint64_t", sizeInBits = 64, encoding = DW_ATE_unsigned>
+llvm.mlir.global external @global_with_expr() {addr_space = 0 : i32, dbg_expr = #llvm.di_global_variable_expression<var = <scope = #di_compile_unit, name = "global_with_expr", linkageName = "global_with_expr", file = #di_file, line = 370, type = #di_basic_type, isLocalToUnit = true, isDefined = true, alignInBits = 8>, expr = <>>} : i64
----------------
Dinistro wrote:

Nit: Missing newline.

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


More information about the Mlir-commits mailing list