X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FSupport%2FCommandLine.cpp;h=e556d76f96580c7e872cd84ae622e69e4404d84d;hb=cd6f2bfc268add3dd54cbdf98b2a2c4862fe4ba5;hp=012f759d4f65ca4bd0617ca16137bf97193a7bcf;hpb=1a097e30d39e60303ae2b19f7a56e813f3e3c18e;p=oota-llvm.git diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index 012f759d4f6..e556d76f965 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -980,9 +980,7 @@ static void (*OverrideVersionPrinter)() = 0; namespace { class VersionPrinter { public: - void operator=(bool OptionWasSpecified) { - if (OptionWasSpecified) { - if (OverrideVersionPrinter == 0) { + void print() { cout << "Low Level Virtual Machine (http://llvm.org/):\n"; cout << " " << PACKAGE_NAME << " version " << PACKAGE_VERSION; #ifdef LLVM_VERSION_INFO @@ -998,6 +996,11 @@ public: cout << " with assertions"; #endif cout << ".\n"; + } + void operator=(bool OptionWasSpecified) { + if (OptionWasSpecified) { + if (OverrideVersionPrinter == 0) { + print(); Options->clear(); // Don't bother making option dtors remove from map. exit(1); } else { @@ -1028,6 +1031,11 @@ void cl::PrintHelpMessage() { NormalPrinter = true; } +/// Utility function for printing version number. +void cl::PrintVersionMessage() { + VersionPrinterInstance.print(); +} + void cl::SetVersionPrinter(void (*func)()) { OverrideVersionPrinter = func; }