summaryrefslogtreecommitdiff
path: root/lib/IR/GCOV.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IR/GCOV.cpp')
-rw-r--r--lib/IR/GCOV.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/IR/GCOV.cpp b/lib/IR/GCOV.cpp
index bcc62b11d5..394c683cee 100644
--- a/lib/IR/GCOV.cpp
+++ b/lib/IR/GCOV.cpp
@@ -317,8 +317,7 @@ void GCOVBlock::dump() const {
// FileInfo implementation.
/// print - Print source files with collected line count information.
-void FileInfo::print(raw_fd_ostream &OS, StringRef gcnoFile,
- StringRef gcdaFile) const {
+void FileInfo::print(StringRef gcnoFile, StringRef gcdaFile) const {
for (StringMap<LineData>::const_iterator I = LineInfo.begin(),
E = LineInfo.end(); I != E; ++I) {
StringRef Filename = I->first();
@@ -329,6 +328,12 @@ void FileInfo::print(raw_fd_ostream &OS, StringRef gcnoFile,
}
StringRef AllLines = Buff->getBuffer();
+ std::string CovFilename = Filename.str() + ".llcov";
+ std::string ErrorInfo;
+ raw_fd_ostream OS(CovFilename.c_str(), ErrorInfo);
+ if (!ErrorInfo.empty())
+ errs() << ErrorInfo << "\n";
+
OS << " -: 0:Source:" << Filename << "\n";
OS << " -: 0:Graph:" << gcnoFile << "\n";
OS << " -: 0:Data:" << gcdaFile << "\n";