aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2025-06-27 13:46:54 -0700
committerGitHub <noreply@github.com>2025-06-27 13:46:54 -0700
commit8d2034cf68b51041a40069b0d868dfcdbf719685 (patch)
tree1239d166a421bc77f2df42c4c77691d866eacaff /clang/lib/Frontend/CompilerInvocation.cpp
parent23be14b22200905b42bcea9add95f1f9233c728a (diff)
downloadllvm-8d2034cf68b51041a40069b0d868dfcdbf719685.zip
llvm-8d2034cf68b51041a40069b0d868dfcdbf719685.tar.gz
llvm-8d2034cf68b51041a40069b0d868dfcdbf719685.tar.bz2
[clang] Add flag fallow-runtime-check-skip-hot-cutoff (#145999)
Co-authored-by: Kazu Hirata <kazu@google.com>
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 9e269ab..f366e90 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1820,6 +1820,11 @@ void CompilerInvocationBase::GenerateCodeGenArgs(const CodeGenOptions &Opts,
for (std::string Sanitizer : Values)
GenerateArg(Consumer, OPT_fsanitize_skip_hot_cutoff_EQ, Sanitizer);
+ if (Opts.AllowRuntimeCheckSkipHotCutoff) {
+ GenerateArg(Consumer, OPT_fallow_runtime_check_skip_hot_cutoff_EQ,
+ std::to_string(*Opts.AllowRuntimeCheckSkipHotCutoff));
+ }
+
for (StringRef Sanitizer :
serializeSanitizerKinds(Opts.SanitizeAnnotateDebugInfo))
GenerateArg(Consumer, OPT_fsanitize_annotate_debug_info_EQ, Sanitizer);
@@ -2322,6 +2327,18 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
Args.getAllArgValues(OPT_fsanitize_annotate_debug_info_EQ), Diags,
Opts.SanitizeAnnotateDebugInfo);
+ if (StringRef V =
+ Args.getLastArgValue(OPT_fallow_runtime_check_skip_hot_cutoff_EQ);
+ !V.empty()) {
+ double A;
+ if (V.getAsDouble(A) || A < 0.0 || A > 1.0) {
+ Diags.Report(diag::err_drv_invalid_value)
+ << "-fallow-runtime-check-skip-hot-cutoff=" << V;
+ } else {
+ Opts.AllowRuntimeCheckSkipHotCutoff = A;
+ }
+ }
+
Opts.EmitVersionIdentMetadata = Args.hasFlag(OPT_Qy, OPT_Qn, true);
if (!LangOpts->CUDAIsDevice)