summaryrefslogtreecommitdiff
path: root/lib/IR/GCOV.cpp
diff options
context:
space:
mode:
authorYuchen Wu <yuchenericwu@hotmail.com>2013-11-05 01:20:41 +0000
committerYuchen Wu <yuchenericwu@hotmail.com>2013-11-05 01:20:41 +0000
commitd8acf0078cf363252727acff00f85ae8074f95b3 (patch)
treec5d934ebade933a197f6e70eefacfe2e6035efac /lib/IR/GCOV.cpp
parente85959cb2cb6f82959b3cf1a9ef59c6d793a2556 (diff)
downloadllvm-d8acf0078cf363252727acff00f85ae8074f95b3.tar.gz
llvm-d8acf0078cf363252727acff00f85ae8074f95b3.tar.bz2
llvm-d8acf0078cf363252727acff00f85ae8074f95b3.tar.xz
llvm-cov: Added command-line option to change dir.
This will allow for much easier testing when the input files are in a different folder from the test script. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/GCOV.cpp')
-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 a33da2a552..9f4b5367e1 100644
--- a/lib/IR/GCOV.cpp
+++ b/lib/IR/GCOV.cpp
@@ -266,18 +266,20 @@ void FileInfo::print(raw_fd_ostream &OS, StringRef gcnoFile,
for (StringMap<LineCounts>::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";
- LineCounts &L = LineInfo[Filename];
OwningPtr<MemoryBuffer> Buff;
if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, Buff)) {
errs() << Filename << ": " << ec.message() << "\n";
return;
}
StringRef AllLines = Buff.take()->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";
+
+ LineCounts &L = LineInfo[Filename];
uint32_t i = 0;
while (!AllLines.empty()) {
if (L.find(i) != L.end()) {