From: Arnaud Giersch Date: Tue, 26 Feb 2019 20:32:47 +0000 (+0100) Subject: Remove dead code after exception throw. X-Git-Tag: v3_22~224 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8d3f939a94cc6994ff93c46e33cec56b34374f6d Remove dead code after exception throw. --- diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index 6e15de37e7..14e3d3b4b2 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -283,7 +283,6 @@ static void instr_user_variable(double time, const char* resource, const char* v break; default: THROW_IMPOSSIBLE; - break; } } } diff --git a/src/kernel/activity/IoImpl.cpp b/src/kernel/activity/IoImpl.cpp index f8fd4c99e6..daacc4a082 100644 --- a/src/kernel/activity/IoImpl.cpp +++ b/src/kernel/activity/IoImpl.cpp @@ -87,7 +87,6 @@ void IoImpl::post() break; default: THROW_IMPOSSIBLE; - break; } on_completion(this); diff --git a/src/kernel/activity/SleepImpl.cpp b/src/kernel/activity/SleepImpl.cpp index edabd248fa..25ff77d000 100644 --- a/src/kernel/activity/SleepImpl.cpp +++ b/src/kernel/activity/SleepImpl.cpp @@ -60,7 +60,6 @@ void SleepImpl::post() default: THROW_IMPOSSIBLE; - break; } if (not simcall->issuer->get_host()->is_on()) { simcall->issuer->context_->iwannadie = true; diff --git a/src/plugins/vm/VirtualMachineImpl.cpp b/src/plugins/vm/VirtualMachineImpl.cpp index 6d3f9f15ce..a921bcf846 100644 --- a/src/plugins/vm/VirtualMachineImpl.cpp +++ b/src/plugins/vm/VirtualMachineImpl.cpp @@ -234,7 +234,6 @@ void VirtualMachineImpl::shutdown(smx_actor_t issuer) break; default: /* SURF_VM_STATE_RUNNING or unexpected values */ THROW_IMPOSSIBLE; - break; } XBT_VERB("Shutting down the VM %s even if it's not running but %s", piface_->get_cname(), stateName); } diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index 0e69a7b159..d75abb13cb 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -52,7 +52,6 @@ Exec* Exec::wait() Exec* Exec::wait_for(double) { THROW_UNIMPLEMENTED; - return this; } /** @brief Returns whether the state of the exec is finished */ diff --git a/src/s4u/s4u_Io.cpp b/src/s4u/s4u_Io.cpp index 52f55b4322..129fc605a4 100644 --- a/src/s4u/s4u_Io.cpp +++ b/src/s4u/s4u_Io.cpp @@ -44,7 +44,6 @@ Io* Io::wait() Io* Io::wait_for(double) { THROW_UNIMPLEMENTED; - return this; } bool Io::test() @@ -59,7 +58,7 @@ bool Io::test() THROW_UNIMPLEMENTED; - return false; + // return false } /** @brief Returns the amount of flops that remain to be done */ diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index 1123281656..f456507981 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -81,7 +81,6 @@ ActorImplPtr ActorImpl::attach(std::string name, void* data, s4u::Host* host, XBT_WARN("Cannot launch process '%s' on failed host '%s'", name.c_str(), host->get_cname()); std::rethrow_exception( std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot attach actor on failed host."))); - return nullptr; } ActorImpl* actor = new ActorImpl(xbt::string(name), host); @@ -454,7 +453,6 @@ ActorImplPtr ActorImpl::create(std::string name, simix::ActorCode code, void* da XBT_WARN("Cannot launch actor '%s' on failed host '%s'", name.c_str(), host->get_cname()); std::rethrow_exception( std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot create actor on failed host."))); - return nullptr; } ActorImpl* actor = new ActorImpl(simgrid::xbt::string(name), host); diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index 1d7194f8ff..222730111a 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -177,7 +177,6 @@ case SIMCALL_RUN_BLOCKING: case SIMCALL_NONE: THROWF(arg_error, 0, "Asked to do the noop syscall on %s@%s", simcall->issuer->get_cname(), sg_host_get_name(simcall->issuer->get_host())); - break; default: THROW_IMPOSSIBLE; } diff --git a/src/simix/simcalls.py b/src/simix/simcalls.py index 2f8b00cc40..d214ff1f4e 100755 --- a/src/simix/simcalls.py +++ b/src/simix/simcalls.py @@ -350,7 +350,6 @@ if __name__ == '__main__': fd.write(' case SIMCALL_NONE:\n') fd.write(' THROWF(arg_error, 0, "Asked to do the noop syscall on %s@%s", simcall->issuer->get_cname(),\n') fd.write(' sg_host_get_name(simcall->issuer->get_host()));\n') - fd.write(' break;\n') fd.write(' default:\n') fd.write(' THROW_IMPOSSIBLE;\n') fd.write(' }\n') diff --git a/src/surf/StorageImpl.cpp b/src/surf/StorageImpl.cpp index afc9463169..55a31bd6e0 100644 --- a/src/surf/StorageImpl.cpp +++ b/src/surf/StorageImpl.cpp @@ -71,7 +71,6 @@ void StorageImpl::destroy() bool StorageImpl::is_used() { THROW_UNIMPLEMENTED; - return false; } void StorageImpl::apply_event(kernel::profile::Event* /*event*/, double /*value*/) diff --git a/src/xbt/dynar.cpp b/src/xbt/dynar.cpp index 1bd60bba1e..6b9a73981d 100644 --- a/src/xbt/dynar.cpp +++ b/src/xbt/dynar.cpp @@ -444,7 +444,6 @@ unsigned int xbt_dynar_search(xbt_dynar_t const dynar, void* const elem) } THROWF(not_found_error, 0, "Element %p not part of dynar %p", elem, dynar); - return 0; // Won't happen, just to please eclipse } /** @brief Returns the position of the element in the dynar (or -1 if not found)