mirror of
https://github.com/intel/llvm.git
synced 2026-02-01 08:56:15 +08:00
2b0e424b2f7131d7f099708c9ddc208f2ba5a751
Since some profiling tools, such as gprof, ftrace, and uftrace, use -pg option to generate a mcount function call at the entry of each function. Function invocation can be detected by this hook function. But mcount insertion is done before function inlining phase in clang, sometime a function that already has a mcount call can be inlined in the middle of another function. This patch adds an attribute "counting-function" to each function rather than emitting the mcount call directly in frontend so that this attribute can be processed in backend. Then the mcount calls can be properly inserted in backend after all the other optimizations are completed. Link: https://llvm.org/bugs/show_bug.cgi?id=28660 Reviewers: hans, rjmccall, hfinkel, rengolin, compnerd Subscribers: shenhan, cfe-commits Differential Revision: https://reviews.llvm.org/D22666 llvm-svn: 280355
…
Languages
LLVM
41.3%
C++
31.5%
C
13%
Assembly
9.5%
MLIR
1.5%
Other
2.8%