[PATCH] D127654: [clang] NFCI: Use DirectoryEntryRef in Module::Directory

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 25 14:36:42 PDT 2023


jansvoboda11 marked 2 inline comments as done.
jansvoboda11 added inline comments.
Herald added a subscriber: ributzka.


================
Comment at: clang/include/clang/Basic/Module.h:138
   /// are found.
-  const DirectoryEntry *Directory = nullptr;
+  OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr Directory;
 
----------------
bnbarham wrote:
> Too many places to update I assume?
Yes.


================
Comment at: clang/lib/Lex/ModuleMap.cpp:178
   // Search for the header file within the module's home directory.
-  auto *Directory = M->Directory;
+  auto Directory = M->Directory;
   SmallString<128> FullPathName(Directory->getName());
----------------
bnbarham wrote:
> Does a module always have a directory?
No. Only a module we have read module map for. Module we only read from the PCM (and perhaps a standard C++ module) will not have a directory.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127654



More information about the cfe-commits mailing list