[llvm] [DebugInfo][RemoveDIs] Find types hidden in DbgRecords (PR #106547)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 29 05:49:50 PDT 2024
================
@@ -0,0 +1,43 @@
+; RUN: opt --passes=verify %s -o - -S | FileCheck %s
+
+;; Test that the type definitions are discovered when serialising to LLVM-IR,
+;; even if they're only present inside a DbgRecord, and thus not normally
+;; visible.
+
+; CHECK: %union.anon = type { %struct.a }
+; CHECK: %struct.a = type { i32 }
+
+; ModuleID = 'bbi-98372.ll'
+source_filename = "bbi-98372.ll"
+
+%union.anon = type { %struct.a }
+%struct.a = type { i32 }
+
+ at d = global [1 x { i16, i16 }] [{ i16, i16 } { i16 0, i16 undef }], align 1
+
+define void @e() {
+entry:
+ #dbg_value(ptr getelementptr inbounds ([1 x %union.anon], ptr @d, i32 0, i32 3), !7, !DIExpression(), !14)
----------------
OCHyams wrote:
possibly worth adding dbg_assign and dbg_declare for completeness? (dbg_assign more important here imo, given the extra fields)
https://github.com/llvm/llvm-project/pull/106547
More information about the llvm-commits
mailing list