Skip to content

Commit 432c557

Browse files
committed
Deprecate order file instrumentation
1 parent d9111f1 commit 432c557

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1888,7 +1888,7 @@ defm pseudo_probe_for_profiling : BoolFOption<"pseudo-probe-for-profiling",
18881888
" pseudo probes for sample profiling">>;
18891889
def forder_file_instrumentation : Flag<["-"], "forder-file-instrumentation">,
18901890
Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
1891-
HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
1891+
HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var). Deprecated, please use temporal profiling.">;
18921892
def fprofile_list_EQ : Joined<["-"], "fprofile-list=">,
18931893
Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
18941894
HelpText<"Filename defining the list of functions/files to instrument. "

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8010,7 +8010,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
80108010
}
80118011
}
80128012

8013-
if (Args.hasArg(options::OPT_forder_file_instrumentation)) {
8013+
if (const Arg *A =
8014+
Args.getLastArg(options::OPT_forder_file_instrumentation)) {
8015+
D.Diag(diag::warn_drv_deprecated_arg)
8016+
<< A->getAsString(Args) << /*hasReplacement=*/true
8017+
<< "-mllvm -pgo-temporal-instrumentation";
80148018
CmdArgs.push_back("-forder-file-instrumentation");
80158019
// Enable order file instrumentation when ThinLTO is not on. When ThinLTO is
80168020
// on, we need to pass these flags as linker flags and that will be handled

clang/test/Driver/clang_f_opts.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@
364364
// RUN: -fno-devirtualize-speculatively \
365365
// RUN: -fslp-vectorize-aggressive \
366366
// RUN: -fno-slp-vectorize-aggressive \
367+
// RUN: -forder-file-instrumentation \
367368
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-WARNING %s
368369
// CHECK-WARNING-DAG: optimization flag '-finline-limit=1000' is not supported
369370
// CHECK-WARNING-DAG: optimization flag '-finline-limit' is not supported
@@ -423,6 +424,7 @@
423424
// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize-speculatively' is not supported
424425
// CHECK-WARNING-DAG: the flag '-fslp-vectorize-aggressive' has been deprecated and will be ignored
425426
// CHECK-WARNING-DAG: the flag '-fno-slp-vectorize-aggressive' has been deprecated and will be ignored
427+
// CHECK-WARNING-DAG: argument '-forder-file-instrumentation' is deprecated, use '-mllvm -pgo-temporal-instrumentation' instead
426428

427429
// Test that we mute the warning on these
428430
// RUN: %clang -### -finline-limit=1000 -Wno-invalid-command-line-argument \

0 commit comments

Comments
 (0)