[PATCH] D130161: Added command-line options to exclude functions from function instrumentation output.
Hans Wennborg via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 20 06:20:26 PDT 2022
hans added a comment.
Can you share the motivation for this? There's already an attribute to exclude functions from this instrumentation.
================
Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:524
/// instrumented with __cyg_profile_func_* calls
-bool CodeGenFunction::ShouldInstrumentFunction() {
+bool CodeGenFunction::ShouldInstrumentFunction(llvm::Function *F) {
if (!CGM.getCodeGenOpts().InstrumentFunctions &&
----------------
Why do we need the new F parameter? Doesn't CurFuncDecl work?
================
Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:554
+ ExcludedFunction != Sentinel; ++ExcludedFunction) {
+ if (FName.find(*ExcludedFunction) != std::string::npos)
+ return false;
----------------
This seems a rather imprecise match. What is ExcludedFunction is "foo" and we have a function "football", should it be excluded?
Also the description says the demangled name is used (which seemed odd) but I don't see any demangling taking place?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130161/new/
https://reviews.llvm.org/D130161
More information about the cfe-commits
mailing list