[PATCH] D151586: [clang][modules] NFCI: Extract optionality out of `Module::{Header,DirectoryName}`

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 26 13:41:05 PDT 2023


jansvoboda11 created this revision.
jansvoboda11 added reviewers: benlangmuir, bnbarham.
Herald added a subscriber: ributzka.
Herald added a project: All.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Most users of `Module::Header` already assume its `Entry` is populated. Enforce this assumption in the type system and handle the only case where this is not the case by wrapping the whole struct in `std::optional`. Do the same for `Module::DirectoryName`.

Depends on D151584 <https://reviews.llvm.org/D151584>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151586

Files:
  clang/include/clang/Basic/Module.h
  clang/lib/Basic/Module.cpp
  clang/lib/Frontend/FrontendAction.cpp
  clang/lib/Lex/ModuleMap.cpp
  clang/lib/Lex/PPLexerChange.cpp
  clang/lib/Serialization/ASTReader.cpp
  clang/lib/Serialization/ASTWriter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151586.526183.patch
Type: text/x-patch
Size: 8731 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230526/d2dcc48a/attachment-0001.bin>


More information about the cfe-commits mailing list