[PATCH] D65907: Introduce FileEntryRef and use it when handling includes to report correct dependencies when the FileManager is reused across invocations

Michael Spencer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 15 15:56:10 PDT 2019


Bigcheese requested changes to this revision.
Bigcheese added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/include/clang/Basic/SourceManager.h:1024
+  Optional<FileEntryRef> getFileEntryRefForID(FileID FID) const {
+    bool MyInvalid = false;
+    const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &MyInvalid);
----------------
`Invalid`?  I realize this is copied from above, but i'd fix the name.


================
Comment at: clang/lib/Lex/PPDirectives.cpp:1757
 
-  if (!File) {
+  auto LookupHeaderFile = [&]() -> Optional<FileEntryRef> {
+    Optional<FileEntryRef> File = LookupFile(
----------------
This lambda is huge and I only see it used once.  Should this be a separate function?


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

https://reviews.llvm.org/D65907





More information about the cfe-commits mailing list