summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-11-21 17:30:34 +0000
committerHans Wennborg <hans@hanshq.net>2017-11-21 17:30:34 +0000
commit14e8a5a32d8f34b5154f24072fb7a8803ea52ae3 (patch)
treec666d8392421acf372a32515befa73481d57c6d9 /clang/lib/Driver
parentd97c0f785576b78aa8c5771841a505f4aef79ad9 (diff)
downloadbcm5719-llvm-14e8a5a32d8f34b5154f24072fb7a8803ea52ae3.tar.gz
bcm5719-llvm-14e8a5a32d8f34b5154f24072fb7a8803ea52ae3.zip
Add -finstrument-function-entry-bare flag
This is an instrumentation flag that's similar to -finstrument-functions, but it only inserts calls on function entry, the calls are inserted post-inlining, and they don't take any arugments. This is intended for users who want to instrument function entry with minimal overhead. (-pg would be another alternative, but forces frame pointer emission and affects link flags, so is probably best left alone to be used for generating gcov data.) Differential revision: https://reviews.llvm.org/D40276 llvm-svn: 318785
Diffstat (limited to 'clang/lib/Driver')
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 2f1fa4af807..3ab28d471be 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3554,8 +3554,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
options::OPT_fno_unique_section_names, true))
CmdArgs.push_back("-fno-unique-section-names");
- Args.AddLastArg(CmdArgs, options::OPT_finstrument_functions,
- options::OPT_finstrument_functions_after_inlining);
+ if (auto *A = Args.getLastArg(
+ options::OPT_finstrument_functions,
+ options::OPT_finstrument_functions_after_inlining,
+ options::OPT_finstrument_function_entry_bare))
+ A->render(Args, CmdArgs);
addPGOAndCoverageFlags(C, D, Output, Args, CmdArgs);
OpenPOWER on IntegriCloud