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

2020-04-22 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. kadircet marked an inline comment as done. Closed by commit rG411a254af3ff: [clang] Make sure argument expansion locations are correct in presence of… (authored by kadircet). Changed prior to commit:

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

2020-04-22 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Basic/SourceManager.cpp:1816 + } else if (IncludeLoc.isValid()) { +// If file wasn't included from FID, there is no more

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

2020-04-22 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 259332. kadircet marked an inline comment as done. kadircet added a comment. - address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78649/new/ https://reviews.llvm.org/D78649 Files:

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

2020-04-22 Thread Kadir Cetinkaya via Phabricator via cfe-commits
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

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

2020-04-22 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang/lib/Basic/SourceManager.cpp:1805 + // macro args expanded in the main file. + if (Entry.getFile().Filename == "" && FID == getMainFileID()) { +if (Entry.getFile().NumCreatedFIDs) nit: reverse

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

2020-04-22 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: sammccall. Herald added a project: clang. Herald added a subscriber: cfe-commits. Macro argument expansion logic relies on skipping file IDs that created as a result of an include. Unfortunately it fails to do that for predefined buffer