diff options
| author | Bill Wendling <isanbard@gmail.com> | 2012-11-07 05:19:04 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2012-11-07 05:19:04 +0000 |
| commit | f720bf64d4bb572aa06092af301dee108f889731 (patch) | |
| tree | 6ee9358d76b8d96b92f5d0fdfff86b2961733c78 /llvm/tools/llvm-cov | |
| parent | d9bb9b611bf569b35370caf20438ff9125125f9c (diff) | |
| download | bcm5719-llvm-f720bf64d4bb572aa06092af301dee108f889731.tar.gz bcm5719-llvm-f720bf64d4bb572aa06092af301dee108f889731.zip | |
Add comment describing what's going on here.
llvm-svn: 167525
Diffstat (limited to 'llvm/tools/llvm-cov')
| -rw-r--r-- | llvm/tools/llvm-cov/llvm-cov.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/tools/llvm-cov/llvm-cov.cpp b/llvm/tools/llvm-cov/llvm-cov.cpp index 7b21c5bae20..ce5ff9c450e 100644 --- a/llvm/tools/llvm-cov/llvm-cov.cpp +++ b/llvm/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"; |

