[PATCH] D127647: [clang][lex] NFCI: Use FileEntryRef in ModuleMap::{load,lookup}ModuleMap()

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 13 10:41:26 PDT 2022


jansvoboda11 added inline comments.


================
Comment at: clang/lib/Frontend/FrontendAction.cpp:444
   FileID ModuleMapID = SrcMgr.getMainFileID();
-  const FileEntry *ModuleMap = SrcMgr.getFileEntryForID(ModuleMapID);
+  Optional<FileEntryRef> ModuleMap = SrcMgr.getFileEntryRefForID(ModuleMapID);
 
----------------
bnbarham wrote:
> The empty case isn't checked as far as I can tell. The null case wasn't either, but seems like we should just `return true`?
Good point. I think the entry for `MainFileID` always exists, so I'll add an assert here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127647



More information about the cfe-commits mailing list