Work around GCC PR19958, which causes programs to sometimes crash after
authorChris Lattner <sabre@nondot.org>
Mon, 14 Feb 2005 19:17:29 +0000 (19:17 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 14 Feb 2005 19:17:29 +0000 (19:17 +0000)
printing help output or version info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20180 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/CommandLine.cpp

index 52e4bbded0299678ef72616bf3dae8fe95dd53a0..f73ec6d8780acc532dc6ed71891bead3dc104a0f 100644 (file)
@@ -919,6 +919,7 @@ public:
     MoreHelp().clear();
 
     // Halt the program since help information was printed
+    getOpts().clear();  // Don't bother making option dtors remove from map.
     exit(1);
   }
 };
@@ -929,6 +930,7 @@ public:
     if (OptionWasSpecified) {
       std::cerr << "Low Level Virtual Machine (" << PACKAGE_NAME << ") " 
                 << PACKAGE_VERSION << " (see http://llvm.cs.uiuc.edu/)\n";
+      getOpts().clear();  // Don't bother making option dtors remove from map.
       exit(1);
     }
   }