Author: arphaman Date: Mon Aug 26 18:03:25 2019 New Revision: 369998 URL: http://llvm.org/viewvc/llvm-project?rev=369998&view=rev Log: Use FileEntryRef for PPCallbacks::FileSkipped
This fixes the issue where a filename dependendency was missing if the file that was skipped was included through a symlink in an earlier run, if the file manager was reused between runs. Modified: clang-tools-extra/trunk/clangd/ClangdUnit.cpp clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.cpp clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h Modified: clang-tools-extra/trunk/clangd/ClangdUnit.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ClangdUnit.cpp?rev=369998&r1=369997&r2=369998&view=diff ============================================================================== --- clang-tools-extra/trunk/clangd/ClangdUnit.cpp (original) +++ clang-tools-extra/trunk/clangd/ClangdUnit.cpp Mon Aug 26 18:03:25 2019 @@ -268,7 +268,9 @@ private: FilenameTok.getEndLoc()), File, "SearchPath", "RelPath", /*Imported=*/nullptr, Inc.FileKind); if (File) - Delegate->FileSkipped(*File, FilenameTok, Inc.FileKind); + // FIXME: Use correctly named FileEntryRef. + Delegate->FileSkipped(FileEntryRef(File->getName(), *File), FilenameTok, + Inc.FileKind); else { llvm::SmallString<1> UnusedRecovery; Delegate->FileNotFound(WrittenFilename, UnusedRecovery); Modified: clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.cpp?rev=369998&r1=369997&r2=369998&view=diff ============================================================================== --- clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.cpp (original) +++ clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.cpp Mon Aug 26 18:03:25 2019 @@ -112,11 +112,11 @@ void PPCallbacksTracker::FileChanged(Sou // Callback invoked whenever a source file is skipped as the result // of header guard optimization. -void PPCallbacksTracker::FileSkipped(const FileEntry &SkippedFile, +void PPCallbacksTracker::FileSkipped(const FileEntryRef &SkippedFile, const Token &FilenameTok, SrcMgr::CharacteristicKind FileType) { beginCallback("FileSkipped"); - appendArgument("ParentFile", &SkippedFile); + appendArgument("ParentFile", &SkippedFile.getFileEntry()); appendArgument("FilenameTok", FilenameTok); appendArgument("FileType", FileType, CharacteristicKindStrings); } Modified: clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h?rev=369998&r1=369997&r2=369998&view=diff ============================================================================== --- clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h (original) +++ clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h Mon Aug 26 18:03:25 2019 @@ -89,7 +89,7 @@ public: void FileChanged(SourceLocation Loc, PPCallbacks::FileChangeReason Reason, SrcMgr::CharacteristicKind FileType, FileID PrevFID = FileID()) override; - void FileSkipped(const FileEntry &SkippedFile, const Token &FilenameTok, + void FileSkipped(const FileEntryRef &SkippedFile, const Token &FilenameTok, SrcMgr::CharacteristicKind FileType) override; bool FileNotFound(llvm::StringRef FileName, llvm::SmallVectorImpl<char> &RecoveryPath) override; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits