llvm-cov: Moved printing after error checks.

llvm-svn: 195153
This commit is contained in:
Yuchen Wu 2013-11-19 20:57:20 +00:00
parent 6943b6e5c6
commit aba14a2b9e

View File

@ -281,18 +281,20 @@ void FileInfo::print(raw_fd_ostream &OS, StringRef gcnoFile,
for (StringMap<LineCounts>::const_iterator I = LineInfo.begin(), for (StringMap<LineCounts>::const_iterator I = LineInfo.begin(),
E = LineInfo.end(); I != E; ++I) { E = LineInfo.end(); I != E; ++I) {
StringRef Filename = I->first(); StringRef Filename = I->first();
OS << " -: 0:Source:" << Filename << "\n";
OS << " -: 0:Graph:" << gcnoFile << "\n";
OS << " -: 0:Data:" << gcdaFile << "\n";
OS << " -: 0:Runs:" << RunCount << "\n";
OS << " -: 0:Programs:" << ProgramCount << "\n";
const LineCounts &L = I->second;
OwningPtr<MemoryBuffer> Buff; OwningPtr<MemoryBuffer> Buff;
if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, Buff)) { if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, Buff)) {
errs() << Filename << ": " << ec.message() << "\n"; errs() << Filename << ": " << ec.message() << "\n";
return; return;
} }
StringRef AllLines = Buff->getBuffer(); StringRef AllLines = Buff->getBuffer();
OS << " -: 0:Source:" << Filename << "\n";
OS << " -: 0:Graph:" << gcnoFile << "\n";
OS << " -: 0:Data:" << gcdaFile << "\n";
OS << " -: 0:Runs:" << RunCount << "\n";
OS << " -: 0:Programs:" << ProgramCount << "\n";
const LineCounts &L = I->second;
uint32_t i = 0; uint32_t i = 0;
while (!AllLines.empty()) { while (!AllLines.empty()) {
LineCounts::const_iterator CountIt = L.find(i); LineCounts::const_iterator CountIt = L.find(i);