[llvm] [LLVM] Create `lf_alias` nodes for `typedef` and `using` (PR #153936)

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 9 05:56:21 PDT 2025


================
@@ -0,0 +1,55 @@
+; ModuleID = 'typedef.cpp'
+source_filename = "typedef.cpp"
+target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-windows-msvc19.44.35214"
+
+@"?__purecall@@3PEAXEA" = dso_local global ptr null, align 8, !dbg !0
+
+; Function Attrs: mustprogress noinline norecurse nounwind optnone uwtable
+define dso_local noundef i32 @main() #0 !dbg !14 {
+entry:
+  %retval = alloca i32, align 4
+  %val = alloca i8, align 1
+  %val2 = alloca i64, align 8
+  store i32 0, ptr %retval, align 4
+    #dbg_declare(ptr %val, !19, !DIExpression(), !22)
+  store i8 15, ptr %val, align 1, !dbg !22
+    #dbg_declare(ptr %val2, !23, !DIExpression(), !26)
+  store i64 -1, ptr %val2, align 8, !dbg !26
+  ret i32 0, !dbg !27
+}
+
+attributes #0 = { mustprogress noinline norecurse nounwind optnone uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
----------------
aganea wrote:

If we take the perspective from someone who debugs this test (in a debugger like Visual Studio), having extra fields means more steping around the code, adding cognitive load. This kind of thing can happen frequently when making breaking changes accross LLVM, and having larger-than-needed tests can be tedious for the person making that refactoring (if this particular test breaks, and if they needed to debug it). I think this opportunity is also interesting for understanding what the `.ll` file format does, most of these tags/references are quite obvious to understand without documentation. You can quickly iterate on this particular test by using `py your_build_folder\bin\llvm-lit.py -vv -a  llvm/test/DebugInfo/PDB/Inputs/typedef.ll`

Again, if any other reviewer speaks against that, I'd be happy to mege as it is.

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


More information about the llvm-commits mailing list