From 7d3a11fd9f687e6e9644cf65eac9ec38ab50f266 Mon Sep 17 00:00:00 2001 From: Yuchen Wu Date: Thu, 5 Dec 2013 22:02:33 +0000 Subject: [PATCH] llvm-cov: Further improved error messages. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196542 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/GCOV.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/IR/GCOV.cpp b/lib/IR/GCOV.cpp index 8e5fd775a89..c7a1102d10a 100644 --- a/lib/IR/GCOV.cpp +++ b/lib/IR/GCOV.cpp @@ -159,7 +159,8 @@ bool GCOVFunction::readGCNO(GCOVBuffer &Buff, GCOV::GCOVVersion Version) { uint32_t BlockNo; if (!Buff.readInt(BlockNo)) return false; if (BlockNo >= BlockCount) { - errs() << "Unexpected block number (in " << Name << ").\n"; + errs() << "Unexpected block number: " << BlockNo << " (in " << Name + << ").\n"; return false; } for (uint32_t i = 0, e = EdgeCount; i != e; ++i) { @@ -181,7 +182,8 @@ bool GCOVFunction::readGCNO(GCOVBuffer &Buff, GCOV::GCOVVersion Version) { uint32_t BlockNo; if (!Buff.readInt(BlockNo)) return false; if (BlockNo >= BlockCount) { - errs() << "Unexpected block number (in " << Name << ").\n"; + errs() << "Unexpected block number: " << BlockNo << " (in " << Name + << ").\n"; return false; } GCOVBlock *Block = Blocks[BlockNo]; @@ -189,9 +191,9 @@ bool GCOVFunction::readGCNO(GCOVBuffer &Buff, GCOV::GCOVVersion Version) { while (Buff.getCursor() != (EndPos - 4)) { StringRef F; if (!Buff.readString(F)) return false; - if (F != Filename) { - errs() << "Multiple sources for a single basic block (in " - << Name << ").\n"; + if (Filename != F) { + errs() << "Multiple sources for a single basic block: " << Filename + << " != " << F << " (in " << Name << ").\n"; return false; } if (Buff.getCursor() == (EndPos - 4)) break;