//
//===----------------------------------------------------------------------===//
+#include "Config/config.h"
#include "Support/CommandLine.h"
#include <algorithm>
#include <map>
/// them later.
///
static void ParseCStringVector (std::vector<char *> &output,
- const char *input) {
+ const char *input) {
// Characters which will be treated as token separators:
static const char *delims = " \v\f\t\r\n";
}
};
+class VersionPrinter {
+public:
+ void operator=(bool OptionWasSpecified) {
+ if (OptionWasSpecified) {
+ std::cerr << "Low Level Virtual Machine (" << PACKAGE_NAME << ") "
+ << PACKAGE_VERSION << " (see http://llvm.org/)\n";
+ exit(1);
+ }
+ }
+};
// Define the two HelpPrinter instances that are used to print out help, or
HHOp("help-hidden", cl::desc("display all available options"),
cl::location(HiddenPrinter), cl::Hidden, cl::ValueDisallowed);
+// Define the --version option that prints out the LLVM version for the tool
+VersionPrinter VersionPrinterInstance;
+cl::opt<VersionPrinter, true, parser<bool> >
+VersOp("version", cl::desc("display the version"),
+ cl::location(VersionPrinterInstance), cl::ValueDisallowed);
+
} // End anonymous namespace