[PATCH] D37624: add support for -fno-instrument-functions and -finstrument-functions-exclude-{file, function}-list=<arg1, arg2, ...> to match gcc options.

kchoi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 30 20:34:37 PDT 2017


choikwa added a comment.

In https://reviews.llvm.org/D37624#885290, @hfinkel wrote:

> In https://reviews.llvm.org/D37624#885288, @choikwa wrote:
>
> > - add comment to CPP test to explain usage
>
>
> Thanks. Please also add some tests showing matching overloaded functions, functions with template parameters, etc.
>
> Do we need to strip whitespace before trying to match the demangled names?


Some cursory testing with g++ shows that only the 'test5' of 'test5(float, int, int*)' is matched. 'test5(' or 'test5 (' is not matched. It seems weird that arguments are not matched.



================
Comment at: test/CodeGenCXX/instrument-functions.cpp:8
+// RUN: %clang -S -emit-llvm -o - %s -finstrument-functions -finstrument-functions-exclude-function-list=test3 | FileCheck %s --check-prefix=NOFUNC
+// RUN: %clang -S -emit-llvm -o - %s -finstrument-functions -finstrument-functions-exclude-function-list=Z5test3 | FileCheck %s --check-prefix=NOFUNC2
+
----------------
hfinkel wrote:
> I'm a bit confused about this test. Are you trying to match against the mangled names, or the demangled names, or both?
It's matching demangled names, so Z5test3 would not match and insert instrumentation calls to test3(int). Since this wasn't clear, I will add comment in the test.


https://reviews.llvm.org/D37624





More information about the cfe-commits mailing list