[llvm] [CodeView] Match MSVC implicit this records for Visual Studio (PR #214289)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 07:54:09 PDT 2026


GkvJwa wrote:

> I spent a little time looking, and it looks like MSVC can and will generate S_LOCAL etc. for "this", at least in some cases. Just take your original example, compile it with /O2, and we get the following in the PDB:
> 
> ```
>           - Kind:            S_LOCAL
>             LocalSym:
>               Type:            4099
>               Flags:           [ IsParameter ]
>               VarName:         this
>           - Kind:            S_DEFRANGE_REGISTER
>             DefRangeRegisterSym:
>               Register:        50
>               MayHaveNoName:   0
>               Range:
>                 OffsetStart:     64
>                 ISectStart:      1
>                 Range:           16
>               Gaps:            []
> ```

In the release mode, the parsed result should be similar to S_DEFRANGE_* + S_LOCAL

However, if this is the case, when it comes to registers (such as rsp/rbp), a lot of additional compatibility logic needs to be added in LLVM.

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


More information about the llvm-commits mailing list