summaryrefslogtreecommitdiff
path: root/tools/llvm-cov/llvm-cov.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-11-07 05:19:04 +0000
committerBill Wendling <isanbard@gmail.com>2012-11-07 05:19:04 +0000
commit168c190c581d21d50edefeedebe38400a12845e1 (patch)
treed3be950b1e79769734639b71498f98f45deb5b02 /tools/llvm-cov/llvm-cov.cpp
parenta4c769311877916cc73994d318d5e962228bf3cd (diff)
downloadllvm-168c190c581d21d50edefeedebe38400a12845e1.tar.gz
llvm-168c190c581d21d50edefeedebe38400a12845e1.tar.bz2
llvm-168c190c581d21d50edefeedebe38400a12845e1.tar.xz
Add comment describing what's going on here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167525 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-cov/llvm-cov.cpp')
-rw-r--r--tools/llvm-cov/llvm-cov.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/llvm-cov/llvm-cov.cpp b/tools/llvm-cov/llvm-cov.cpp
index 7b21c5bae2..ce5ff9c450 100644
--- a/tools/llvm-cov/llvm-cov.cpp
+++ b/tools/llvm-cov/llvm-cov.cpp
@@ -16,11 +16,15 @@
#include "llvm/Support/GCOV.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryObject.h"
+#include "llvm/Support/Path.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/system_error.h"
using namespace llvm;
+static cl::opt<std::string>
+InputFilename(cl::Positional, cl::desc("source filename"), cl::init(""));
+
static cl::opt<bool>
DumpGCOV("dump", cl::init(false), cl::desc("dump gcov file"));
@@ -40,6 +44,23 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, "llvm cov\n");
+ if (InputFilename.empty()) {
+ // FIXME: Error out here.
+ }
+
+ sys::Path SrcFile(InputFilename);
+
+ sys::Path GCNOFile(SrcFile);
+ GCNOFile.eraseSuffix();
+ GCNOFile.appendSuffix(".gcno");
+
+ sys::Path GCDAFile(SrcFile);
+ GCDAFile.eraseSuffix();
+ GCDAFile.appendSuffix(".gcda");
+
+ sys::Path OutputFile(SrcFile);
+ OutputFile.appendSuffix(".gcov");
+
GCOVFile GF;
if (InputGCNO.empty())
errs() << " " << argv[0] << ": No gcov input file!\n";