[PATCH] D127651: [clang][lex] NFCI: Use DirectoryEntryRef in ModuleMap::parseModuleMapFile()
Ben Barham via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 13 10:01:03 PDT 2022
bnbarham accepted this revision.
bnbarham added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang-tools-extra/modularize/ModularizeUtilities.cpp:275
// Figure out the home directory for the module map file.
- const DirectoryEntry *Dir = ModuleMapEntry->getDir();
+ Optional<DirectoryEntryRef> Dir = ModuleMapEntry.getDir();
StringRef DirName(Dir->getName());
----------------
It seems like this is optional purely because of the assignment below and that has an assert that seems to be invalid anyway - couldn't we just check the optional down there and return an error, assign otherwise, and remove the assert?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127651/new/
https://reviews.llvm.org/D127651
More information about the cfe-commits
mailing list