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

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 28 08:13:05 PDT 2025


================
@@ -1728,14 +1728,17 @@ TypeIndex CodeViewDebug::lowerTypeAlias(const DIDerivedType *Ty) {
 
   addToUDTs(Ty);
 
+  AliasRecord AR(UnderlyingTypeIndex, TypeName);
+  auto alias_index = TypeTable.writeLeafType(AR);
----------------
aganea wrote:

The tests below do not cover this change, the fact that we properly generate `LF_ALIAS` when building from Clang or LLVM-IR. As @Michael137 says, you can generate that as a test. I suppose something like that would work:
```
REM ---- This part is generated by you offline
echo typedef unsigned char u8; int main() { u8 a = 1; } > typedef.cpp
clang-cl /c /FA /Z7 typedef.cpp
(chop down non-relevant parts of typedef.asm to your needs)

REM ---- This is part of the LLVM test
llvm-mc typedef.asm --filetype=obj -o typedef.obj
llvm-pdbutil dump -types typedef.obj | FileCheck ...
```

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


More information about the llvm-commits mailing list