[llvm-branch-commits] [llvm-branch] r258731 - Merging r258406:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jan 25 14:24:51 PST 2016


Author: hans
Date: Mon Jan 25 16:24:50 2016
New Revision: 258731

URL: http://llvm.org/viewvc/llvm-project?rev=258731&view=rev
Log:
Merging r258406:
------------------------------------------------------------------------
r258406 | vedantk | 2016-01-21 09:04:42 -0800 (Thu, 21 Jan 2016) | 16 lines

[GCOV] Avoid emitting profile arcs for module and skeleton CUs

Do not emit profile arc files and note files for module and skeleton
CU's.

Our users report seeing unexpected *.gcda and *.gcno files in their
projects when using gcov-style profiling with modules or frameworks.
The unwanted files come from these modules. This is not very helpful
for end-users. Further, we've seen reports of instrumented programs
crashing while writing these files out (due to I/O failures).

rdar://problem/22838296

Reviewed-by: aprantl

Differential Revision: http://reviews.llvm.org/D15997
------------------------------------------------------------------------

Added:
    llvm/branches/release_38/test/Transforms/GCOVProfiling/modules.ll
      - copied unchanged from r258406, llvm/trunk/test/Transforms/GCOVProfiling/modules.ll
Modified:
    llvm/branches/release_38/   (props changed)
    llvm/branches/release_38/lib/Transforms/Instrumentation/GCOVProfiling.cpp

Propchange: llvm/branches/release_38/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 25 16:24:50 2016
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,257645,257648,257730,257775,257791,257875,257886,257902,257905,257925,257929-257930,257940,257942,257977,257979,257997,258168,258207,258221,258273,258325,258416,258428
+/llvm/trunk:155241,257645,257648,257730,257775,257791,257875,257886,257902,257905,257925,257929-257930,257940,257942,257977,257979,257997,258168,258207,258221,258273,258325,258406,258416,258428

Modified: llvm/branches/release_38/lib/Transforms/Instrumentation/GCOVProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_38/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=258731&r1=258730&r2=258731&view=diff
==============================================================================
--- llvm/branches/release_38/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
+++ llvm/branches/release_38/lib/Transforms/Instrumentation/GCOVProfiling.cpp Mon Jan 25 16:24:50 2016
@@ -494,6 +494,11 @@ void GCOVProfiler::emitProfileNotes() {
     // LTO, we'll generate the same .gcno files.
 
     auto *CU = cast<DICompileUnit>(CU_Nodes->getOperand(i));
+
+    // Skip module skeleton (and module) CUs.
+    if (CU->getDWOId())
+      continue;
+
     std::error_code EC;
     raw_fd_ostream out(mangleName(CU, "gcno"), EC, sys::fs::F_None);
     std::string EdgeDestinations;
@@ -853,6 +858,11 @@ Function *GCOVProfiler::insertCounterWri
   if (CU_Nodes) {
     for (unsigned i = 0, e = CU_Nodes->getNumOperands(); i != e; ++i) {
       auto *CU = cast<DICompileUnit>(CU_Nodes->getOperand(i));
+
+      // Skip module skeleton (and module) CUs.
+      if (CU->getDWOId())
+        continue;
+
       std::string FilenameGcda = mangleName(CU, "gcda");
       uint32_t CfgChecksum = FileChecksums.empty() ? 0 : FileChecksums[i];
       Builder.CreateCall(StartFile,




More information about the llvm-branch-commits mailing list