aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.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/Frontend/CompilerInstance.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/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index b3ec8e4..acb3cb8 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -119,9 +119,9 @@ bool CompilerInstance::createTarget() {
auto TO = std::make_shared<TargetOptions>();
TO->Triple = llvm::Triple::normalize(getFrontendOpts().AuxTriple);
if (getFrontendOpts().AuxTargetCPU)
- TO->CPU = getFrontendOpts().AuxTargetCPU.value();
+ TO->CPU = *getFrontendOpts().AuxTargetCPU;
if (getFrontendOpts().AuxTargetFeatures)
- TO->FeaturesAsWritten = getFrontendOpts().AuxTargetFeatures.value();
+ TO->FeaturesAsWritten = *getFrontendOpts().AuxTargetFeatures;
TO->HostTriple = getTarget().getTriple().str();
setAuxTarget(TargetInfo::CreateTargetInfo(getDiagnostics(), TO));
}