[llvm-commits] [llvm] r70175 - /llvm/trunk/tools/bugpoint/bugpoint.cpp

Dan Gohman gohman at apple.com
Sun Apr 26 18:30:38 PDT 2009


Author: djg
Date: Sun Apr 26 20:30:37 2009
New Revision: 70175

URL: http://llvm.org/viewvc/llvm-project?rev=70175&view=rev
Log:
Improve bugpoint's error messages when it runs out of memory,
or when some other std::exception is thrown.

Modified:
    llvm/trunk/tools/bugpoint/bugpoint.cpp

Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=70175&r1=70174&r2=70175&view=diff

==============================================================================
--- llvm/trunk/tools/bugpoint/bugpoint.cpp (original)
+++ llvm/trunk/tools/bugpoint/bugpoint.cpp Sun Apr 26 20:30:37 2009
@@ -88,6 +88,14 @@
     std::cerr << "Tool execution error: " << TEE.what() << '\n';
   } catch (const std::string& msg) {
     std::cerr << argv[0] << ": " << msg << "\n";
+  } catch (const std::bad_alloc &e) {
+    std::cerr << "Oh no, a bugpoint process ran out of memory!\n"
+                 "To increase the allocation limits for bugpoint child\n"
+                 "processes, use the -mlimit option.\n";
+  } catch (const std::exception &e) {
+    std::cerr << "Whoops, a std::exception leaked out of bugpoint: "
+              << e.what() << "\n"
+              << "This is a bug in bugpoint!\n";
   } catch (...) {
     std::cerr << "Whoops, an exception leaked out of bugpoint.  "
               << "This is a bug in bugpoint!\n";





More information about the llvm-commits mailing list