summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorCalixte Denizet <cdenizet@mozilla.com>2018-09-21 09:17:06 +0000
committerCalixte Denizet <cdenizet@mozilla.com>2018-09-21 09:17:06 +0000
commit2bc1c8b8c87e6b0e27d66dcb05955449b2e5a6db (patch)
treeb00181ab2e555b0c38bb904e75e8e761a1613568 /lib/CodeGen/CodeGenFunction.cpp
parentd1a487bb6cc2e427dbf06b0218893e841891b9c1 (diff)
downloadclang-2bc1c8b8c87e6b0e27d66dcb05955449b2e5a6db.tar.gz
[CodeGen] Add to emitted DebugLoc information about coverage when it's required
Summary: Some lines have a hit counter where they should not have one. Cleanup stuff is located to the last line of the body which is most of the time a '}'. And Exception stuff is added at the beginning of a function and at the end (represented by '{' and '}'). So in such cases, the DebugLoc used in GCOVProfiling.cpp must be marked as not covered. This patch is a followup of https://reviews.llvm.org/D49915. Tests in projects/compiler_rt are fixed by: https://reviews.llvm.org/D49917 Reviewers: marco-c, davidxl Reviewed By: marco-c Subscribers: dblaikie, cfe-commits, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D49916 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 77f978f687..8fa0badc6e 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -317,7 +317,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
if (OnlySimpleReturnStmts)
DI->EmitLocation(Builder, LastStopPoint);
else
- DI->EmitLocation(Builder, EndLoc);
+ DI->EmitLocation(Builder, EndLoc, true /* ImplicitCode */);
}
// Pop any cleanups that might have been associated with the
@@ -333,7 +333,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
// the ret after it's been at EndLoc.
if (CGDebugInfo *DI = getDebugInfo())
if (OnlySimpleReturnStmts)
- DI->EmitLocation(Builder, EndLoc);
+ DI->EmitLocation(Builder, EndLoc, true /* ImplicitCode */);
PopCleanupBlocks(PrologueCleanupDepth);
}
@@ -1179,7 +1179,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD,
}
// Emit a location at the end of the prologue.
if (CGDebugInfo *DI = getDebugInfo())
- DI->EmitLocation(Builder, StartLoc);
+ DI->EmitLocation(Builder, StartLoc, true /* ImplicitCode */);
// TODO: Do we need to handle this in two places like we do with
// target-features/target-cpu?