[llvm-commits] [llvm] r58865 - /llvm/trunk/utils/TableGen/TableGen.cpp

Dan Gohman gohman at apple.com
Fri Nov 7 13:01:13 PST 2008


Author: djg
Date: Fri Nov  7 15:01:13 2008
New Revision: 58865

URL: http://llvm.org/viewvc/llvm-project?rev=58865&view=rev
Log:
Make tablegen print out a nice error message for a const char*
exception, like it does for a std::string exception.

Modified:
    llvm/trunk/utils/TableGen/TableGen.cpp

Modified: llvm/trunk/utils/TableGen/TableGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TableGen.cpp?rev=58865&r1=58864&r2=58865&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/TableGen.cpp (original)
+++ llvm/trunk/utils/TableGen/TableGen.cpp Fri Nov  7 15:01:13 2008
@@ -212,6 +212,13 @@
       std::remove(OutputFilename.c_str());    // Remove the file, it's broken
     }
     return 1;
+  } catch (const char *Error) {
+    cerr << argv[0] << ": " << Error << "\n";
+    if (Out != cout.stream()) {
+      delete Out;                             // Close the file
+      std::remove(OutputFilename.c_str());    // Remove the file, it's broken
+    }
+    return 1;
   } catch (...) {
     cerr << argv[0] << ": Unknown unexpected exception occurred.\n";
     if (Out != cout.stream()) {





More information about the llvm-commits mailing list