summaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorYuchen Wu <yuchenericwu@hotmail.com>2013-11-19 20:57:20 +0000
committerYuchen Wu <yuchenericwu@hotmail.com>2013-11-19 20:57:20 +0000
commita49e1f55da902fe1b50e3ea989357d3e70b24dc9 (patch)
treeef6462a4e8877c464744f7f2cf31a2be6582499a /lib/IR
parent0233715d7441fca39634655caca8a17b31514fe1 (diff)
downloadllvm-a49e1f55da902fe1b50e3ea989357d3e70b24dc9.tar.gz
llvm-a49e1f55da902fe1b50e3ea989357d3e70b24dc9.tar.bz2
llvm-a49e1f55da902fe1b50e3ea989357d3e70b24dc9.tar.xz
llvm-cov: Moved printing after error checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/GCOV.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/IR/GCOV.cpp b/lib/IR/GCOV.cpp
index b6f4917764..25a4ff669d 100644
--- a/lib/IR/GCOV.cpp
+++ b/lib/IR/GCOV.cpp
@@ -281,18 +281,20 @@ void FileInfo::print(raw_fd_ostream &OS, StringRef gcnoFile,
for (StringMap<LineCounts>::const_iterator I = LineInfo.begin(),
E = LineInfo.end(); I != E; ++I) {
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;
if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, Buff)) {
errs() << Filename << ": " << ec.message() << "\n";
return;
}
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;
while (!AllLines.empty()) {
LineCounts::const_iterator CountIt = L.find(i);