extrahelp(const char* help);
};
+void PrintVersionMessage();
// This function just prints the help message, exactly the same way as if the
// --help option had been given on the command line.
// NOTE: THIS FUNCTION TERMINATES THE PROGRAM!
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
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 {
NormalPrinter = true;
}
+/// Utility function for printing version number.
+void cl::PrintVersionMessage() {
+ VersionPrinterInstance.print();
+}
+
void cl::SetVersionPrinter(void (*func)()) {
OverrideVersionPrinter = func;
}