[PATCH] Add -finstruments-functions-exclude-{file, function}-list options

Matthew Iselin matthew at theiselins.net
Mon Mar 11 21:31:58 PDT 2013

Hi all,

This patch adds two options, -finstrument-functions-exclude-file-list= and -finstrument-functions-exclude-function=list=, which offer a means through which headers in various locations and individual functions can be excluded from instrumentation via -finstrument-functions. These options can be found in GCC alongside -finstrument-functions.

LLVM Bugzilla bug #15255 should be resolved by this patch.

This was sent to the llvm-commits list yesterday. I have been informed that this list is a better option for clang-specific patches (which makes sense, in hindsight).

Since the original patch submission yesterday, this patch has been updated to resolve GCC incompatibilities: the options should now function more or less equivalently to their GCC counterparts. The updated patch also adds code to avoid instrumenting inline functions that will never be externally visible. This should help avoid cases where an inline function has calls to __cyg_profile_* with a named reference to the inline function emitted within it, but is completely inlined and never has an actual symbol name present. This causes linker errors when trying to resolve the inline function names.

Excluded functions do not have __cyg_profile_* calls emitted in them. I have included a few tests to ensure the behaviour is as expected.


- Matthew

-------------- next part --------------
A non-text attachment was scrubbed...
Name: finstrument-functions-exclusions.patch
Type: application/octet-stream
Size: 12912 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130312/cbe817a8/attachment.obj>

More information about the cfe-commits mailing list