Index: include/clang/Lex/PPCallbacks.h =================================================================== --- include/clang/Lex/PPCallbacks.h +++ include/clang/Lex/PPCallbacks.h @@ -54,11 +54,12 @@ /// \brief Callback invoked whenever a source file is skipped as the result /// of header guard optimization. /// - /// \param ParentFile The file that \#included the skipped file. + /// \param SkippedFile The file that is skipped instead of entering \#include /// - /// \param FilenameTok The token in ParentFile that indicates the - /// skipped file. - virtual void FileSkipped(const FileEntry &ParentFile, + /// \param FilenameTok The file name token in \#include "FileName" directive + /// or macro expanded file name token from \#include MACRO(PARAMS) directive. + /// Note that FilenameTok contains corresponding quotes/angles symbols. + virtual void FileSkipped(const FileEntry &SkippedFile, const Token &FilenameTok, SrcMgr::CharacteristicKind FileType) { } @@ -336,11 +337,11 @@ Second->FileChanged(Loc, Reason, FileType, PrevFID); } - void FileSkipped(const FileEntry &ParentFile, + void FileSkipped(const FileEntry &SkippedFile, const Token &FilenameTok, SrcMgr::CharacteristicKind FileType) override { - First->FileSkipped(ParentFile, FilenameTok, FileType); - Second->FileSkipped(ParentFile, FilenameTok, FileType); + First->FileSkipped(SkippedFile, FilenameTok, FileType); + Second->FileSkipped(SkippedFile, FilenameTok, FileType); } bool FileNotFound(StringRef FileName, Index: lib/Frontend/Rewrite/InclusionRewriter.cpp =================================================================== --- lib/Frontend/Rewrite/InclusionRewriter.cpp +++ lib/Frontend/Rewrite/InclusionRewriter.cpp @@ -61,7 +61,7 @@ void FileChanged(SourceLocation Loc, FileChangeReason Reason, SrcMgr::CharacteristicKind FileType, FileID PrevFID) override; - void FileSkipped(const FileEntry &ParentFile, const Token &FilenameTok, + void FileSkipped(const FileEntry &SkippedFile, const Token &FilenameTok, SrcMgr::CharacteristicKind FileType) override; void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, bool IsAngled, @@ -153,7 +153,7 @@ /// Called whenever an inclusion is skipped due to canonical header protection /// macros. -void InclusionRewriter::FileSkipped(const FileEntry &/*ParentFile*/, +void InclusionRewriter::FileSkipped(const FileEntry &/*SkippedFile*/, const Token &/*FilenameTok*/, SrcMgr::CharacteristicKind /*FileType*/) { assert(LastInsertedFileChange != FileChanges.end() && "A file, that wasn't "