Correctly track GCOVProfiling IR update
authorserge-sans-paille <sguelton@redhat.com>
Mon, 29 Jun 2020 08:58:08 +0000 (10:58 +0200)
committerserge-sans-paille <sguelton@redhat.com>
Wed, 1 Jul 2020 07:30:59 +0000 (09:30 +0200)
Differential Revision: https://reviews.llvm.org/D82742

llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp

index 3a94096..d8a965a 100644 (file)
@@ -844,7 +844,6 @@ bool GCOVProfiler::emitProfileArcs() {
         continue;
       // TODO: Functions using scope-based EH are currently not supported.
       if (isUsingScopeBasedEH(F)) continue;
-      if (!Result) Result = true;
 
       DenseMap<std::pair<BasicBlock *, BasicBlock *>, unsigned> EdgeToCounter;
       unsigned Edges = 0;
@@ -939,6 +938,7 @@ bool GCOVProfiler::emitProfileArcs() {
     Builder.CreateRetVoid();
 
     appendToGlobalCtors(*M, F, 0);
+    Result = true;
   }
 
   return Result;