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

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 25 12:50:55 PDT 2023


jansvoboda11 wrote:

Ok, the comment below seems to suggests that the built-ins buffers are not considered to be part of any TU:

```c++
bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS,
                                              SourceLocation RHS) const {
  // ...

  if (isInTheSameTranslationUnit(LHS, RHS))
    return X;

  // If we arrived here, the location is either in a built-ins buffer or
  // associated with global inline asm. PR5662 and PR22576 are examples.

  // ...
}
```

I changed `SourceManager::isInTheSameTranslationUnit()` to check for that case explicitly instead of relying on the fact/bug that built-ins buffers happened to be assigned an untranslated include `SourceLocation`.

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


More information about the cfe-commits mailing list