diff options
| author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2019-11-15 14:23:05 -0500 |
|---|---|---|
| committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2019-11-15 14:23:11 -0500 |
| commit | 478ad94c8e1457a707f41fa64cf0967b219d2806 (patch) | |
| tree | 0bf9f65f6ecacc2ea364491a63e60e6ae0ad21c3 /llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp | |
| parent | e06f3e064a1e462f1ee2e8751f2b02f60be53f7b (diff) | |
| download | bcm5719-llvm-478ad94c8e1457a707f41fa64cf0967b219d2806.tar.gz bcm5719-llvm-478ad94c8e1457a707f41fa64cf0967b219d2806.zip | |
[GCOV] Skip artificial functions from being emitted
This is a patch to support D66328, which was reverted until this lands.
Enable a compiler-rt test that used to fail previously with D66328.
Differential Revision: https://reviews.llvm.org/D67283
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp index bda32878400..bf3e4ed3e31 100644 --- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -714,7 +714,10 @@ void GCOVProfiler::emitProfileNotes() { // 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); |

