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

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 11 01:37:16 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" }
----------------
Walnut356 wrote:

I don't think there's anything I can change about this file that would make debugging easier since it's already so minimal.

There are 8 types in the type stream, the first 5 are for `main` and the `lf_alias` nodes and the rest are strings/build info. The symbol stream contains 12 entries, 2 of which are the `S_UDT` nodes and the rest are for the `main` function and the local variables.

I got rid of what I could but changing much else would alter those streams and there wouldn't be enough info left to test what we're trying to test.


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


More information about the llvm-commits mailing list