[llvm-commits] CVS: llvm/utils/TableGen/TableGen.cpp

Reid Spencer reid at x10sys.com
Fri Sep 3 16:18:04 PDT 2004



Changes in directory llvm/utils/TableGen:

TableGen.cpp updated: 1.34 -> 1.35
---
Log message:

Make tblgen's exception handling a little more robust by printing the 
program name and also catching ... 


---
Diffs of the changes:  (+8 -1)

Index: llvm/utils/TableGen/TableGen.cpp
diff -u llvm/utils/TableGen/TableGen.cpp:1.34 llvm/utils/TableGen/TableGen.cpp:1.35
--- llvm/utils/TableGen/TableGen.cpp:1.34	Wed Sep  1 17:55:40 2004
+++ llvm/utils/TableGen/TableGen.cpp	Fri Sep  3 18:17:54 2004
@@ -478,12 +478,19 @@
       return 1;
     }
   } catch (const std::string &Error) {
-    std::cerr << Error << "\n";
+    std::cerr << argv[0] << ": " << Error << "\n";
     if (Out != &std::cout) {
       delete Out;                             // Close the file
       std::remove(OutputFilename.c_str());    // Remove the file, it's broken
     }
     return 1;
+  } catch (...) {
+    std::cerr << argv[0] << ": Unknown unexpected exception occurred.\n";
+    if (Out != &std::cout) {
+      delete Out;                             // Close the file
+      std::remove(OutputFilename.c_str());    // Remove the file, it's broken
+    }
+    return 2;
   }
 
   if (Out != &std::cout) {






More information about the llvm-commits mailing list