[PATCH] D74953: [profile] Don't dump counters when forking and don't reset when calling exec** functions

calixte via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 07:18:48 PST 2020


calixte marked an inline comment as done.
calixte added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp:635
 void GCOVProfiler::AddFlushBeforeForkAndExec() {
-  SmallVector<Instruction *, 2> ForkAndExecs;
+  SmallVector<std::pair<bool, CallInst *>, 2> ForkAndExecs;
   for (auto &F : M->functions()) {
----------------
marco-c wrote:
> calixte wrote:
> > marco-c wrote:
> > > Since we are now mostly doing different things on forks and execs, we could remove this vector and just do the operations directly instead of adding to the vec.
> > If we make the insertions of new code in the second for loop, we'll invalidate the iterator used in this loop. 
> M->getOrInsertFunction is what would invalidate the iterator?
> 
> You could clean things up a bit by having two vectors then, one for forks and one for execs.
Builder.Create** will invalidate the iterator 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74953/new/

https://reviews.llvm.org/D74953





More information about the llvm-commits mailing list