[PATCH] D130161: Added command-line options to exclude functions from function instrumentation output.
Jacques Légaré via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 20 10:41:22 PDT 2022
jlegare updated this revision to Diff 446210.
jlegare added a comment.
Addressing review comments.
- Dropped argument to ShouldInstrumentFunction().
- Added file name based exclusion, which had accidentally been left out of previous commit.
- Added demangler.
- Applied git clang-format.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130161/new/
https://reviews.llvm.org/D130161
Files:
clang/lib/CodeGen/CodeGenFunction.cpp
Index: clang/lib/CodeGen/CodeGenFunction.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenFunction.cpp
+++ clang/lib/CodeGen/CodeGenFunction.cpp
@@ -536,8 +536,7 @@
// generate tracing for it: at link-time, the function will be gone and the
// first argument to the __cyg_profile_* function will be unresolvable.
const FunctionDecl *FDecl = dyn_cast<FunctionDecl>(CurFuncDecl);
- if (FDecl &&
- FDecl->isInlined() &&
+ if (FDecl && FDecl->isInlined() &&
!FDecl->isInlineDefinitionExternallyVisible())
return false;
@@ -563,10 +562,11 @@
typedef std::vector<std::string>::const_iterator ExcludedPathIterator;
const std::vector<std::string> &ExcludedPaths =
- CGM.getCodeGenOpts().InstrumentFunctionsExcludedPaths;
+ CGM.getCodeGenOpts().InstrumentFunctionsExcludedPaths;
for (ExcludedPathIterator ExcludedPath = ExcludedPaths.begin(),
- Sentinel = ExcludedPaths.end(); ExcludedPath != Sentinel; ++ExcludedPath)
+ Sentinel = ExcludedPaths.end();
+ ExcludedPath != Sentinel; ++ExcludedPath)
if (Path.find(*ExcludedPath) != std::string::npos)
return false;
}
@@ -577,12 +577,12 @@
// is searched to see if any of them is a substring of our (current) function
// name.
const std::vector<std::string> &ExcludedFunctions =
- CGM.getCodeGenOpts().InstrumentFunctionsExcludedFunctions;
+ CGM.getCodeGenOpts().InstrumentFunctionsExcludedFunctions;
std::string MangledName(CurFn->getName());
std::string DemangledName(llvm::demangle(MangledName));
for (ExcludedFunctionIterator ExcludedFunction = ExcludedFunctions.begin(),
- Sentinel = ExcludedFunctions.end();
+ Sentinel = ExcludedFunctions.end();
ExcludedFunction != Sentinel; ++ExcludedFunction)
if (DemangledName.find(*ExcludedFunction) != std::string::npos)
return false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130161.446210.patch
Type: text/x-patch
Size: 1983 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220720/53245d55/attachment.bin>
More information about the cfe-commits
mailing list