summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2014-06-04 21:47:19 +0000
committerNick Lewycky <nicholas@mxc.ca>2014-06-04 21:47:19 +0000
commit7afb107a274ae27c4db90b785b65d20a8fa18c01 (patch)
treef32a0e4a5f07c64a5e0e7f511d13059462ee2cfb /lib
parent6248abf28d3f1e0c010e519715c416b9d19b9c76 (diff)
downloadllvm-7afb107a274ae27c4db90b785b65d20a8fa18c01.tar.gz
llvm-7afb107a274ae27c4db90b785b65d20a8fa18c01.tar.bz2
llvm-7afb107a274ae27c4db90b785b65d20a8fa18c01.tar.xz
Explain why we skip DbgInfoIntrinsics when looking at line numbers in .gcno file emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Instrumentation/GCOVProfiling.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/lib/Transforms/Instrumentation/GCOVProfiling.cpp
index 1dfe588680..583a094468 100644
--- a/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+++ b/lib/Transforms/Instrumentation/GCOVProfiling.cpp
@@ -454,6 +454,8 @@ static bool functionHasLines(Function *F) {
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
for (BasicBlock::iterator I = BB->begin(), IE = BB->end();
I != IE; ++I) {
+ // Debug intrinsic locations correspond to the location of the
+ // declaration, not necessarily any statements or expressions.
if (isa<DbgInfoIntrinsic>(I)) continue;
const DebugLoc &Loc = I->getDebugLoc();
if (Loc.isUnknown()) continue;
@@ -516,6 +518,8 @@ void GCOVProfiler::emitProfileNotes() {
uint32_t Line = 0;
for (BasicBlock::iterator I = BB->begin(), IE = BB->end();
I != IE; ++I) {
+ // Debug intrinsic locations correspond to the location of the
+ // declaration, not necessarily any statements or expressions.
if (isa<DbgInfoIntrinsic>(I)) continue;
const DebugLoc &Loc = I->getDebugLoc();
if (Loc.isUnknown()) continue;