[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
Sun Oct 1 00:13:42 PDT 2017


choikwa added a comment.

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

> In https://reviews.llvm.org/D37624#885295, @choikwa wrote:
>
> > 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.
> >
> > g++ man page shows
> >
> >   "The function name to be matched is its user-visible name, such as "vector<int> blah(const vector<int> &)", not the internal mangled name"
> >
> > but it doesn't seem to be including parameters.
>
>
> Interesting. Can you tell what GCC is doing w.r.t. namespace names, class names, etc. and template parameters?
>
> > Also uncovered a bug where sub argument list containing comma needs to be surrounded by single quote, but clang seems to ignores single quote.
> >  I'll try to dig around ArgList implementation to see if it can return argument surrounded by single-quote as a whole.


Given A::B::C<D>(T a), only 'C<D>' is meaningful in g++'s matcher. Adding anything else escapes the match [  'B::C', 'C<D>('  ].


https://reviews.llvm.org/D37624





More information about the cfe-commits mailing list