[PATCH] D15997: [GCOV] Avoid emitting profile arcs for module and skeleton CU's
Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 21 09:08:41 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL258406: [GCOV] Avoid emitting profile arcs for module and skeleton CUs (authored by vedantk).
Changed prior to commit:
http://reviews.llvm.org/D15997?vs=44574&id=45540#toc
Repository:
rL LLVM
http://reviews.llvm.org/D15997
Files:
llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
llvm/trunk/test/Transforms/GCOVProfiling/modules.ll
Index: llvm/trunk/test/Transforms/GCOVProfiling/modules.ll
===================================================================
--- llvm/trunk/test/Transforms/GCOVProfiling/modules.ll
+++ llvm/trunk/test/Transforms/GCOVProfiling/modules.ll
@@ -0,0 +1,12 @@
+; RUN: opt -insert-gcov-profiling -o - < %s | llvm-dis | FileCheck -check-prefix=EMIT-ARCS %s
+
+; EMIT-ARCS-NOT: call void @llvm_gcda_start_file
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "LLVM", isOptimized: false, runtimeVersion: 2, splitDebugFilename: "my.dwo", emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2, dwoId: 43981)
+!1 = !DIFile(filename: "<stdin>", directory: "/")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 4}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
Index: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
@@ -494,6 +494,11 @@
// 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 @@
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,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15997.45540.patch
Type: text/x-patch
Size: 1929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160121/0995a172/attachment.bin>
More information about the llvm-commits
mailing list