aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-06-25 11:56:50 -0700
committerKazu Hirata <kazu@google.com>2022-06-25 11:56:50 -0700
commit3b7c3a654c9175f41ac871a937cbcae73dfb3c5d (patch)
tree21094939ea6c8b726c481d7b28eaf4ea27c64008 /clang/lib/Frontend/CompilerInvocation.cpp
parentaa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d (diff)
downloadllvm-3b7c3a654c9175f41ac871a937cbcae73dfb3c5d.zip
llvm-3b7c3a654c9175f41ac871a937cbcae73dfb3c5d.tar.gz
llvm-3b7c3a654c9175f41ac871a937cbcae73dfb3c5d.tar.bz2
Revert "Don't use Optional::hasValue (NFC)"
This reverts commit aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 4b53d6d..c0eed3a 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1951,8 +1951,8 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
<< "-fdiagnostics-hotness-threshold=";
} else {
Opts.DiagnosticsHotnessThreshold = *ResultOrErr;
- if ((!Opts.DiagnosticsHotnessThreshold ||
- *Opts.DiagnosticsHotnessThreshold > 0) &&
+ if ((!Opts.DiagnosticsHotnessThreshold.hasValue() ||
+ Opts.DiagnosticsHotnessThreshold.getValue() > 0) &&
!UsingProfile)
Diags.Report(diag::warn_drv_diagnostics_hotness_requires_pgo)
<< "-fdiagnostics-hotness-threshold=";
@@ -1968,8 +1968,8 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
<< "-fdiagnostics-misexpect-tolerance=";
} else {
Opts.DiagnosticsMisExpectTolerance = *ResultOrErr;
- if ((!Opts.DiagnosticsMisExpectTolerance ||
- *Opts.DiagnosticsMisExpectTolerance > 0) &&
+ if ((!Opts.DiagnosticsMisExpectTolerance.hasValue() ||
+ Opts.DiagnosticsMisExpectTolerance.getValue() > 0) &&
!UsingProfile)
Diags.Report(diag::warn_drv_diagnostics_misexpect_requires_pgo)
<< "-fdiagnostics-misexpect-tolerance=";
@@ -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)
+ if (Opts.AuxTargetCPU.hasValue())
GenerateArg(Args, OPT_aux_target_cpu, *Opts.AuxTargetCPU, SA);
- if (Opts.AuxTargetFeatures)
+ if (Opts.AuxTargetFeatures.hasValue())
for (const auto &Feature : *Opts.AuxTargetFeatures)
GenerateArg(Args, OPT_aux_target_feature, Feature, SA);