Explain why we skip DbgInfoIntrinsics when looking at line numbers in .gcno file...
authorNick Lewycky <nicholas@mxc.ca>
Wed, 4 Jun 2014 21:47:19 +0000 (21:47 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 4 Jun 2014 21:47:19 +0000 (21:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210218 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/GCOVProfiling.cpp

index 1dfe58868045e98e7876d40e8a7b6a33e1773001..583a09446897ad6b27716c35ec860d945dcf0afd 100644 (file)
@@ -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;