diff options
author | Petr Hosek <phosek@google.com> | 2021-01-15 01:14:37 -0800 |
---|---|---|
committer | Petr Hosek <phosek@google.com> | 2021-01-26 11:11:39 -0800 |
commit | 4edf35f11a9e20bd5df3cb47283715f0ff38b751 (patch) | |
tree | d8fd7bbd93f7ea0cf187fd995468b85518183918 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 32cc5564e2707c6036230ef3929c0d783ccea04c (diff) | |
download | llvm-4edf35f11a9e20bd5df3cb47283715f0ff38b751.zip llvm-4edf35f11a9e20bd5df3cb47283715f0ff38b751.tar.gz llvm-4edf35f11a9e20bd5df3cb47283715f0ff38b751.tar.bz2 |
Support for instrumenting only selected files or functions
This change implements support for applying profile instrumentation
only to selected files or functions. The implementation uses the
sanitizer special case list format to select which files and functions
to instrument, and relies on the new noprofile IR attribute to exclude
functions from instrumentation.
Differential Revision: https://reviews.llvm.org/D94820
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index f6e392f..b9e3d69 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1355,6 +1355,10 @@ static void ParseDependencyOutputArgs(DependencyOutputOptions &Opts, } } + // -fprofile-list= dependencies. + for (const auto &Filename : Args.getAllArgValues(OPT_fprofile_list_EQ)) + Opts.ExtraDeps.push_back(Filename); + // Propagate the extra dependencies. for (const auto *A : Args.filtered(OPT_fdepfile_entry)) { Opts.ExtraDeps.push_back(A->getValue()); |