From afb694bd672b9e44c91455cf4c3eb76c9e7b960a Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 12 Apr 2023 14:23:15 +0200 Subject: [PATCH] Remove useless specialized exceptions from simgrid::mc. --- src/mc/api/RemoteApp.cpp | 2 +- src/mc/api/RemoteApp.hpp | 2 +- src/mc/explo/DFSExplorer.cpp | 2 +- src/mc/explo/LivenessChecker.cpp | 2 +- src/mc/mc_exit.hpp | 10 ---------- 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/mc/api/RemoteApp.cpp b/src/mc/api/RemoteApp.cpp index 61fca1e519..959d191b99 100644 --- a/src/mc/api/RemoteApp.cpp +++ b/src/mc/api/RemoteApp.cpp @@ -178,7 +178,7 @@ void RemoteApp::check_deadlock() const "--cfg=model-check/replay:'%s'", explo->get_record_trace().to_string().c_str()); explo->log_state(); - throw DeadlockError(); + throw McError(ExitStatus::DEADLOCK); } } diff --git a/src/mc/api/RemoteApp.hpp b/src/mc/api/RemoteApp.hpp index 82a93db420..0773721333 100644 --- a/src/mc/api/RemoteApp.hpp +++ b/src/mc/api/RemoteApp.hpp @@ -57,7 +57,7 @@ public: void restore_initial_state(); void wait_for_requests(); - /** Ask to the application to check for a deadlock. If so, do an error message and throw a DeadlockError. */ + /** Ask to the application to check for a deadlock. If so, do an error message and throw a McError(DEADLOCK). */ void check_deadlock() const; /** Ask the application to run post-mortem analysis, and maybe to stop ASAP */ diff --git a/src/mc/explo/DFSExplorer.cpp b/src/mc/explo/DFSExplorer.cpp index a19d17a424..5903739f9e 100644 --- a/src/mc/explo/DFSExplorer.cpp +++ b/src/mc/explo/DFSExplorer.cpp @@ -60,7 +60,7 @@ void DFSExplorer::check_non_termination(const State* current_state) get_record_trace().to_string().c_str()); log_state(); - throw TerminationError(); + throw McError(ExitStatus::NON_TERMINATION); } } #endif diff --git a/src/mc/explo/LivenessChecker.cpp b/src/mc/explo/LivenessChecker.cpp index 3638fd67a3..071c1e4cae 100644 --- a/src/mc/explo/LivenessChecker.cpp +++ b/src/mc/explo/LivenessChecker.cpp @@ -384,7 +384,7 @@ void LivenessChecker::run() reached_pair = this->insert_acceptance_pair(current_pair.get()); if (reached_pair == nullptr) { this->show_acceptance_cycle(current_pair->depth); - throw LivenessError(); + throw McError(ExitStatus::LIVENESS); } } diff --git a/src/mc/mc_exit.hpp b/src/mc/mc_exit.hpp index 6d1ec7c71f..3bb6cdde0b 100644 --- a/src/mc/mc_exit.hpp +++ b/src/mc/mc_exit.hpp @@ -25,16 +25,6 @@ struct McError : public std::exception { const ExitStatus value; McError(ExitStatus v = ExitStatus::ERROR) : value(v) {} }; - -struct DeadlockError : public McError { - DeadlockError() : McError(ExitStatus::DEADLOCK) {} -}; -struct TerminationError : public McError { - TerminationError() : McError(ExitStatus::NON_TERMINATION) {} -}; -struct LivenessError : public McError { - LivenessError() : McError(ExitStatus::LIVENESS) {} -}; } // namespace simgrid::mc #endif -- 2.20.1