[PATCH] D67283: [GCOV] Skip artificial functions from being emitted

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 11:26:04 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG478ad94c8e14: [GCOV] Skip artificial functions from being emitted (authored by aganea).
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67283

Files:
  compiler-rt/test/asan/TestCases/asan_and_llvm_coverage_test.cpp
  llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp


Index: llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+++ llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
@@ -714,7 +714,10 @@
       // to have a counter for the function definition.
       uint32_t Line = SP->getLine();
       auto Filename = getFilename(SP);
-      Func.getBlock(&EntryBlock).getFile(Filename).addLine(Line);
+
+      // Artificial functions such as global initializers
+      if (!SP->isArtificial())
+        Func.getBlock(&EntryBlock).getFile(Filename).addLine(Line);
 
       for (auto &BB : F) {
         GCOVBlock &Block = Func.getBlock(&BB);
Index: compiler-rt/test/asan/TestCases/asan_and_llvm_coverage_test.cpp
===================================================================
--- compiler-rt/test/asan/TestCases/asan_and_llvm_coverage_test.cpp
+++ compiler-rt/test/asan/TestCases/asan_and_llvm_coverage_test.cpp
@@ -1,9 +1,6 @@
 // RUN: %clangxx_asan -coverage -O0 %s -o %t
 // RUN: %env_asan_opts=check_initialization_order=1 %run %t 2>&1 | FileCheck %s
 
-// We don't really support running tests using profile runtime on Windows.
-// UNSUPPORTED: windows-msvc
-
 #include <stdio.h>
 int foo() { return 1; }
 int XXX = foo();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67283.229603.patch
Type: text/x-patch
Size: 1299 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191115/238daa74/attachment-0001.bin>


More information about the llvm-commits mailing list