[clang][modules] NFCI: Extract optionality out of `Module::{Header,DirectoryName}`
commite6830b6028ec5434ccf8dbebdd992918f67b1751
authorJan Svoboda <jan_svoboda@apple.com>
Wed, 31 May 2023 04:06:50 +0000 (30 21:06 -0700)
committerJan Svoboda <jan_svoboda@apple.com>
Wed, 31 May 2023 04:06:51 +0000 (30 21:06 -0700)
tree94813ba74063a562fcfcdb8e279e3185857c8d1f
parent0442d08fdb173d89b0779d32eb929957a344f5e6
[clang][modules] NFCI: Extract optionality out of `Module::{Header,DirectoryName}`

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.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D151586
clang-tools-extra/modularize/CoverageChecker.cpp
clang-tools-extra/modularize/ModularizeUtilities.cpp
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