Added log_cmd_error_expection
authorClifford Wolf <clifford@clifford.at>
Sun, 27 Jul 2014 10:04:12 +0000 (12:04 +0200)
committerClifford Wolf <clifford@clifford.at>
Sun, 27 Jul 2014 10:05:50 +0000 (12:05 +0200)
kernel/driver.cc
kernel/log.cc
kernel/log.h
passes/fsm/fsm_export.cc

index 7a1c7ed16a9009736cedcc1065b7879e6e43c6d0..380315e7c91da7a91bd3671aa0454335d9ad973f 100644 (file)
@@ -141,9 +141,9 @@ static void run_frontend(std::string filename, std::string command, RTLIL::Desig
                                        Pass::call(design, command);
                        }
                }
-               catch (...) {
+               catch (log_cmd_error_expection) {
                        Frontend::current_script_file = backup_script_file;
-                       std::rethrow_exception(std::current_exception());
+                       throw log_cmd_error_expection();
                }
 
                Frontend::current_script_file = backup_script_file;
@@ -329,7 +329,7 @@ static void shell(RTLIL::Design *design)
                try {
                        assert(design->selection_stack.size() == 1);
                        Pass::call(design, command);
-               } catch (int) {
+               } catch (log_cmd_error_expection) {
                        while (design->selection_stack.size() > 1)
                                design->selection_stack.pop_back();
                        log_reset_stack();
index 63a0a84dd7eaf59798cce82ad1399e6f2812a3c4..b8a47e1cfe0bac83ad9f232b767d754d1465ae4e 100644 (file)
@@ -160,7 +160,7 @@ void log_cmd_error(const char *format, ...)
                log("ERROR: ");
                logv(format, ap);
                log_flush();
-               throw 0;
+               throw log_cmd_error_expection();
        }
 
        logv_error(format, ap);
index 1658800dd700c82baa909b69484d7121e508843f..abfb810f729cf269172dd9251914085a262fa4b8 100644 (file)
@@ -34,6 +34,8 @@
 #define S__LINE__sub1(x) S__LINE__sub2(x)
 #define S__LINE__ S__LINE__sub1(__LINE__)
 
+struct log_cmd_error_expection { };
+
 extern std::vector<FILE*> log_files;
 extern FILE *log_errfile;
 extern bool log_time;
index f84f372ac974b4a87d84f53a336eda66497a8d15..f6f9faa9baf90b7e99669229097a14e1e961a6e0 100644 (file)
  * Convert a signal into a KISS-compatible textual representation.
  */
 std::string kiss_convert_signal(const RTLIL::SigSpec &sig) {
-       if (!sig.is_fully_const()) {
-               throw 0;
-       }
-
+       log_assert(sig.is_fully_const());
        return sig.as_const().as_string();
 }