From 9e1b61dedd82dffccbe4f20996eadaf79726d427 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 12 Aug 2016 21:26:12 +0300 Subject: py/runtime: Factor out exception raising helpers. Introduce mp_raise_msg(), mp_raise_ValueError(), mp_raise_TypeError() instead of previous pattern nlr_raise(mp_obj_new_exception_msg(...)). Save few bytes on each call, which are many. --- py/runtime.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'py/runtime.h') diff --git a/py/runtime.h b/py/runtime.h index 3e325a31b..df5e45b2d 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -134,6 +134,10 @@ mp_obj_t mp_import_from(mp_obj_t module, qstr name); void mp_import_all(mp_obj_t module); // Raise NotImplementedError with given message +NORETURN void mp_raise_msg(const mp_obj_type_t *exc_type, const char *msg); +//NORETURN void nlr_raise_msg_varg(const mp_obj_type_t *exc_type, const char *fmt, ...); +NORETURN void mp_raise_ValueError(const char *msg); +NORETURN void mp_raise_TypeError(const char *msg); NORETURN void mp_not_implemented(const char *msg); NORETURN void mp_exc_recursion_depth(void); -- cgit v1.2.3