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

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 21 04:00:33 PDT 2025


Walnut356 wrote:

> Does Clang handle the case I have in mind by generating IR in such a way that the Foo composite type records refer to the canonical int type, or the typedef?

Here is a [gist containing the](https://gist.github.com/Walnut356/8e33f5abab9beaaece9551993023b3f0) llvm IR and pdb info. Looks like there's only 1 struct definition and the typedef is completely ignored. It also doesn't appear in the debug info. I also tried assigning `auto x = v2.x` and it just sees it as an `int`, with no `myint_t` present in the debug info. AFAIK that makes sense because there's no mechanism for template parameters at all in codeview. 

Explicitly designating the type `myint_t x;`  maintains the above behavior for `v1` and `v2`, but now `myint_t` is present in the debug info and the local variable `x` references type index `0x1004`, which is the `LF_ALIAS` node.



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


More information about the llvm-commits mailing list