Revert "llvm-cov: Added command-line option to change dir."
This reverts commit d8acf0078cf363252727acff00f85ae8074f95b3.
llvm-svn: 194040
diff --git a/llvm/lib/IR/GCOV.cpp b/llvm/lib/IR/GCOV.cpp
index 9f4b536..a33da2a 100644
--- a/llvm/lib/IR/GCOV.cpp
+++ b/llvm/lib/IR/GCOV.cpp
@@ -266,20 +266,18 @@
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()) {
diff --git a/llvm/tools/llvm-cov/llvm-cov.cpp b/llvm/tools/llvm-cov/llvm-cov.cpp
index 1827773..ad6c671 100644
--- a/llvm/tools/llvm-cov/llvm-cov.cpp
+++ b/llvm/tools/llvm-cov/llvm-cov.cpp
@@ -20,7 +20,6 @@
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/system_error.h"
-#include <unistd.h>
using namespace llvm;
static cl::opt<bool>
@@ -35,9 +34,6 @@
static cl::opt<std::string>
OutputFile("o", cl::desc("<output llvm-cov file>"), cl::init("-"));
-static cl::opt<std::string>
-WorkingDir("C", cl::desc("change path of working directory"),
- cl::init(""));
//===----------------------------------------------------------------------===//
int main(int argc, char **argv) {
@@ -48,13 +44,6 @@
cl::ParseCommandLineOptions(argc, argv, "llvm coverage tool\n");
- if (!WorkingDir.empty()) {
- if (chdir(WorkingDir.c_str()) == -1) {
- errs() << "Cannot change to directory: " << WorkingDir << ".\n";
- return 1;
- }
- }
-
std::string ErrorInfo;
raw_fd_ostream OS(OutputFile.c_str(), ErrorInfo);
if (!ErrorInfo.empty())
@@ -88,6 +77,7 @@
}
}
+
if (DumpGCOV)
GF.dump();