Skip to content

Commit

Permalink
Revert "llvm-cov: Added command-line option to change dir."
Browse files Browse the repository at this point in the history
This reverts commit d8acf00.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194040 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
yuchenericwu committed Nov 5, 2013
1 parent e6bfdf9 commit f44533c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
14 changes: 6 additions & 8 deletions lib/IR/GCOV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,18 @@ 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();
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];
OwningPtr<MemoryBuffer> Buff;
if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, Buff)) {
errs() << Filename << ": " << ec.message() << "\n";
return;
}
StringRef AllLines = Buff.take()->getBuffer();
uint32_t i = 0;
while (!AllLines.empty()) {
if (L.find(i) != L.end()) {
Expand Down
12 changes: 1 addition & 11 deletions tools/llvm-cov/llvm-cov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -35,9 +34,6 @@ InputGCDA("gcda", cl::desc("<input gcda file>"), cl::init(""));
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) {
Expand All @@ -48,13 +44,6 @@ int main(int argc, char **argv) {

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())
Expand Down Expand Up @@ -88,6 +77,7 @@ int main(int argc, char **argv) {
}
}


if (DumpGCOV)
GF.dump();

Expand Down

0 comments on commit f44533c

Please sign in to comment.