diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2014-06-03 04:25:36 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2014-06-03 04:25:36 +0000 |
commit | 5f53ddd0cc284061519c40e0b98cf124db3674fb (patch) | |
tree | 873d7b71d8217679dadeb96a9f935540d1ebcaa2 /llvm/lib/Transforms | |
parent | cc4f38bc280cd013b786f1a2d757f02fd8f71b50 (diff) | |
download | bcm5719-llvm-5f53ddd0cc284061519c40e0b98cf124db3674fb.tar.gz bcm5719-llvm-5f53ddd0cc284061519c40e0b98cf124db3674fb.zip |
Ignore line numbers on debug intrinsics. Add an assert to ensure that we aren't emitting line number zero, the .gcno format uses this to indicate that the next field is a filename.
llvm-svn: 210068
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 8330a9bc335..1dfe5886804 100644 --- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -211,6 +211,7 @@ namespace { class GCOVLines : public GCOVRecord { public: void addLine(uint32_t Line) { + assert(Line != 0 && "Line zero is not a valid real line number."); Lines.push_back(Line); } @@ -453,10 +454,10 @@ 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) { + if (isa<DbgInfoIntrinsic>(I)) continue; const DebugLoc &Loc = I->getDebugLoc(); if (Loc.isUnknown()) continue; - if (Loc.getLine() != 0) - return true; + return true; } } return false; @@ -515,6 +516,7 @@ void GCOVProfiler::emitProfileNotes() { uint32_t Line = 0; for (BasicBlock::iterator I = BB->begin(), IE = BB->end(); I != IE; ++I) { + if (isa<DbgInfoIntrinsic>(I)) continue; const DebugLoc &Loc = I->getDebugLoc(); if (Loc.isUnknown()) continue; if (Line == Loc.getLine()) continue; |