[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 15:08:38 PDT 2023


jansvoboda11 wrote:

I got around investigating "SemaCXX/warn-unsafe-buffer-usage-fixits-parm-span.cpp" and found out it uses this pattern:
```
%clang_cc1 ... -include %s %s
```

This means `FileID(1)` is the main input file `%s` and `FileID(2)` is the built-ins buffer that includes `%s` as `FileID(3)`.

Since I moved up the special-casing of built-ins buffer up in my last commit, it was happening **before** we got chance to walk up from `FileID(3)` to `FileID(2)`, meaning it wasn't kicking in. I think we need to sink the special-casing into `isInTheSameTranslationUnit()` and apply it to whatever `FileID` we end up with after not finding the common ancestor.

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


More information about the cfe-commits mailing list