aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-12-17 06:37:59 +0000
committerFangrui Song <i@maskray.me>2022-12-17 06:37:59 +0000
commit53e5cd4d3e39dad47312a48d4c6c71318bb2c283 (patch)
tree808d8a35b84061021fe7896084ece92bb470ba2a /clang/lib/Lex/ModuleMap.cpp
parent40ba0942e2ab1107f83aa5a0ee5ae2980bf47b1a (diff)
downloadllvm-53e5cd4d3e39dad47312a48d4c6c71318bb2c283.zip
llvm-53e5cd4d3e39dad47312a48d4c6c71318bb2c283.tar.gz
llvm-53e5cd4d3e39dad47312a48d4c6c71318bb2c283.tar.bz2
llvm::Optional::value => operator*/operator->
std::optional::value() has undesired exception checking semantics and is unavailable in older Xcode (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). The call sites block std::optional migration. This makes `ninja clang` work in the absence of llvm::Optional::value.
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r--clang/lib/Lex/ModuleMap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index 1032922..f5a7f51 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -1215,8 +1215,8 @@ void ModuleMap::resolveHeaderDirectives(
Module *Mod, llvm::Optional<const FileEntry *> File) const {
bool NeedsFramework = false;
SmallVector<Module::UnresolvedHeaderDirective, 1> NewHeaders;
- const auto Size = File ? File.value()->getSize() : 0;
- const auto ModTime = File ? File.value()->getModificationTime() : 0;
+ const auto Size = File ? (*File)->getSize() : 0;
+ const auto ModTime = File ? (*File)->getModificationTime() : 0;
for (auto &Header : Mod->UnresolvedHeaders) {
if (File && ((Header.ModTime && Header.ModTime != ModTime) ||