[llvm] r210218 - Explain why we skip DbgInfoIntrinsics when looking at line numbers in .gcno file emission.

Nick Lewycky nicholas at mxc.ca
Wed Jun 4 14:47:19 PDT 2014


Author: nicholas
Date: Wed Jun  4 16:47:19 2014
New Revision: 210218

URL: http://llvm.org/viewvc/llvm-project?rev=210218&view=rev
Log:
Explain why we skip DbgInfoIntrinsics when looking at line numbers in .gcno file emission.

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=210218&r1=210217&r2=210218&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Wed Jun  4 16:47:19 2014
@@ -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;





More information about the llvm-commits mailing list