[PATCH] D39287: Add a flag to disable inlining calls to cygprofile functions generated by -finstrument-functions

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 08:57:40 PDT 2017


rnk added a comment.

In https://reviews.llvm.org/D39287#906565, @hfinkel wrote:

> If you only want these calls post-inlining (and otherwise wish to minimize the effect on the rest of the optimizer), I'd recommend a different approach. What we did for mcount, which has similar requirements, was that we had the frontend add an attribute, and then a late pass actually added the function calls (lib/CodeGen/CountingFunctionInserter.cpp). I recommend extending CountingFunctionInserter to enable it to add these functions (based on some additional attribute), and then just add whatever attribute is necessary in the frontend based on some new flag.


+1. I know it's a big departure from how the existing feature is implemented, but it's consistent with every other major form of instrumentation that clang emits these days.


https://reviews.llvm.org/D39287





More information about the llvm-commits mailing list