diff options
author | Kazu Hirata <kazu@google.com> | 2022-06-25 22:26:24 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-06-25 22:26:24 -0700 |
commit | 97afce08cbbb1390cf8ddab8bf398f3ff5b39676 (patch) | |
tree | 5dbd790ef58e24345eb2f5a56dff401ddea175d0 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 0a0effdd5b654ed90f3c3cfae5d9d9dd0a0db8de (diff) | |
download | llvm-97afce08cbbb1390cf8ddab8bf398f3ff5b39676.zip llvm-97afce08cbbb1390cf8ddab8bf398f3ff5b39676.tar.gz llvm-97afce08cbbb1390cf8ddab8bf398f3ff5b39676.tar.bz2 |
[clang] Don't use Optional::hasValue (NFC)
This patch replaces Optional::hasValue with the implicit cast to bool
in conditionals only.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index c0eed3a..abef4cf 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1951,7 +1951,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, << "-fdiagnostics-hotness-threshold="; } else { Opts.DiagnosticsHotnessThreshold = *ResultOrErr; - if ((!Opts.DiagnosticsHotnessThreshold.hasValue() || + if ((!Opts.DiagnosticsHotnessThreshold || Opts.DiagnosticsHotnessThreshold.getValue() > 0) && !UsingProfile) Diags.Report(diag::warn_drv_diagnostics_hotness_requires_pgo) @@ -1968,7 +1968,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, << "-fdiagnostics-misexpect-tolerance="; } else { Opts.DiagnosticsMisExpectTolerance = *ResultOrErr; - if ((!Opts.DiagnosticsMisExpectTolerance.hasValue() || + if ((!Opts.DiagnosticsMisExpectTolerance || Opts.DiagnosticsMisExpectTolerance.getValue() > 0) && !UsingProfile) Diags.Report(diag::warn_drv_diagnostics_misexpect_requires_pgo) @@ -2578,10 +2578,10 @@ static void GenerateFrontendArgs(const FrontendOptions &Opts, for (const auto &ModuleFile : Opts.ModuleFiles) GenerateArg(Args, OPT_fmodule_file, ModuleFile, SA); - if (Opts.AuxTargetCPU.hasValue()) + if (Opts.AuxTargetCPU) GenerateArg(Args, OPT_aux_target_cpu, *Opts.AuxTargetCPU, SA); - if (Opts.AuxTargetFeatures.hasValue()) + if (Opts.AuxTargetFeatures) for (const auto &Feature : *Opts.AuxTargetFeatures) GenerateArg(Args, OPT_aux_target_feature, Feature, SA); |