Allows llvm-cov to read GCOV data generated by CLANG 3.6

Vanderson Martins do Rosario vandersonmr2 at gmail.com
Thu Feb 5 10:45:28 PST 2015


FIX bug 22436. llvm-cov now allows to continuing reading gcda file if it
has arcs from exit block, and just showing a message warning about that in
the same way as GNU gcov.

Vanderson M. Rosario
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150205/40d00f5f/attachment.html>
-------------- next part --------------
diff --git a/lib/IR/GCOV.cpp b/lib/IR/GCOV.cpp
index 245c500..c43cb99 100644
--- a/lib/IR/GCOV.cpp
+++ b/lib/IR/GCOV.cpp
@@ -263,10 +263,13 @@ bool GCOVFunction::readGCDA(GCOVBuffer &Buff, GCOV::GCOVVersion Version) {
   // required to combine the edge counts that are contained in the GCDA file.
   for (uint32_t BlockNo = 0; Count > 0; ++BlockNo) {
     // The last block is always reserved for exit block
-    if (BlockNo >= Blocks.size()-1) {
+    if (BlockNo > Blocks.size()-1) {
       errs() << "Unexpected number of edges (in " << Name << ").\n";
       return false;
     }
+    if (BlockNo == Blocks.size()-1) {
+      errs() << "(" << Name << ") has arcs from exit block.\n";
+    }
     GCOVBlock &Block = *Blocks[BlockNo];
     for (size_t EdgeNo = 0, End = Block.getNumDstEdges(); EdgeNo < End;
            ++EdgeNo) {


More information about the llvm-commits mailing list