[PATCH] D78649: [clang] Make sure argument expansion locations are correct in presence of predefined buffer

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 22 10:52:53 PDT 2020


kadircet marked 4 inline comments as done.
kadircet added inline comments.


================
Comment at: clang/lib/Lex/PPLexerChange.cpp:420
+         // Predefines file doesn't have a valid include location.
+         CurPPLexer->FID == getPredefinesFileID())) {
       // Notify SourceManager to record the number of FileIDs that were created
----------------
sammccall wrote:
> Can we ever get spurious equality here because both sides are 0?
the latter is set during `Preprocessor::EnterMainSourceFile()` which initializes the PP and all users seem to be calling it first, therefore I assumed it would alwyas be a valid file id.

putting a `&& getPredefinesFileID().isValid()` to be on the safe side.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78649/new/

https://reviews.llvm.org/D78649





More information about the cfe-commits mailing list