[llvm] r196542 - llvm-cov: Further improved error messages.
Yuchen Wu
yuchenericwu at hotmail.com
Thu Dec 5 14:02:33 PST 2013
Author: ywu
Date: Thu Dec 5 16:02:33 2013
New Revision: 196542
URL: http://llvm.org/viewvc/llvm-project?rev=196542&view=rev
Log:
llvm-cov: Further improved error messages.
Modified:
llvm/trunk/lib/IR/GCOV.cpp
Modified: llvm/trunk/lib/IR/GCOV.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/GCOV.cpp?rev=196542&r1=196541&r2=196542&view=diff
==============================================================================
--- llvm/trunk/lib/IR/GCOV.cpp (original)
+++ llvm/trunk/lib/IR/GCOV.cpp Thu Dec 5 16:02:33 2013
@@ -159,7 +159,8 @@ bool GCOVFunction::readGCNO(GCOVBuffer &
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 &
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 &
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;
More information about the llvm-commits
mailing list