diff options
author | Hans Wennborg <hans@hanshq.net> | 2017-11-21 17:30:34 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2017-11-21 17:30:34 +0000 |
commit | c0f88500bdb216836cae033024f43b0024812b55 (patch) | |
tree | 545a6ca5bb07abb45f7251e11245302caf6953e1 /lib/Driver/ToolChains | |
parent | f301ed91f8ffc6899d8e6dc0753e77b84a7092e6 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains')
-rw-r--r-- | lib/Driver/ToolChains/Clang.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index 2f1fa4af80..3ab28d471b 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/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); |