From 7afb107a274ae27c4db90b785b65d20a8fa18c01 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Wed, 4 Jun 2014 21:47:19 +0000 Subject: [PATCH] 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 --- lib/Transforms/Instrumentation/GCOVProfiling.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 1dfe5886804..583a0944689 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(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(I)) continue; const DebugLoc &Loc = I->getDebugLoc(); if (Loc.isUnknown()) continue; -- 2.34.1