summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3d41cbb)
raw | patch | inline | side by side (parent: 3d41cbb)
author | Justin Bogner <mail@justinbogner.com> | |
Thu, 30 Oct 2014 20:51:24 +0000 (20:51 +0000) | ||
committer | Justin Bogner <mail@justinbogner.com> | |
Thu, 30 Oct 2014 20:51:24 +0000 (20:51 +0000) |
We're using cl::opt here, but for some reason we're reading out one
particular option by hand instead. This makes -help and the like
behave rather poorly, so let's not do it this way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220928 91177308-0d34-0410-b5e6-96231b3b80d8
particular option by hand instead. This makes -help and the like
behave rather poorly, so let's not do it this way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220928 91177308-0d34-0410-b5e6-96231b3b80d8
tools/llvm-cov/CodeCoverage.cpp | patch | blob | history |
index 9e2f154c233f63b564acc291b42062194d2c37c1..eef4732c9c58cc04df4796df2a65ff1dccf83c2d 100644 (file)
int report(int argc, const char **argv,
CommandLineParserType commandLineParser);
- StringRef ObjectFilename;
+ std::string ObjectFilename;
CoverageViewOptions ViewOpts;
std::string PGOFilename;
CoverageFiltersMatchAll Filters;
PrettyStackTraceProgram X(argc, argv);
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
+ cl::opt<std::string, true> ObjectFilename(
+ cl::Positional, cl::Required, cl::location(this->ObjectFilename),
+ cl::desc("Covered executable or object file."));
+
cl::list<std::string> InputSourceFiles(
cl::Positional, cl::desc("<Source files>"), cl::ZeroOrMore);
return 0;
};
- // Parse the object filename
- if (argc > 1) {
- StringRef Arg(argv[1]);
- if (Arg.equals_lower("-help") || Arg.equals_lower("-version")) {
- cl::ParseCommandLineOptions(2, argv, "LLVM code coverage tool\n");
- return 0;
- }
- ObjectFilename = Arg;
-
- argv[1] = argv[0];
- --argc;
- ++argv;
- } else {
- errs() << sys::path::filename(argv[0]) << ": No executable file given!\n";
- return 1;
- }
-
switch (Cmd) {
case Show:
return show(argc, argv, commandLineParser);