aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorPaul Eggert2019-04-18 00:30:24 -0700
committerPaul Eggert2019-04-18 00:35:18 -0700
commit6d6c55db2cdfb6b354873f17285a3f602e011817 (patch)
treefc9647797be220e613962260700c05e5f37100c1 /src/keyboard.c
parentdded2c4cf30fbdb5e90c44bc76a26970d00e0f22 (diff)
downloademacs-6d6c55db2cdfb6b354873f17285a3f602e011817.tar.gz
emacs-6d6c55db2cdfb6b354873f17285a3f602e011817.zip
Mark _Noreturn error functions as cold
On my platform this made ‘make compile-always’ 1.3% faster. Suggested by Alex Gramiak in: https://lists.gnu.org/r/emacs-devel/2019-04/msg00684.html * configure.ac (nw): Don’t use -Wsuggest-attribute=cold. * lib-src/make-docfile.c (write_globals): Mark noreturn functions as cold. * src/callproc.c (exec_failed): * src/data.c (wrong_length_argument, wrong_type_argument): * src/emacs-module.c (module_abort): * src/emacs.c (terminate_due_to_signal): * src/eval.c (unwind_to_catch): * src/image.c (my_png_error, my_error_exit): * src/json.c (json_out_of_memory, json_parse_error): * src/keyboard.c (quit_throw_to_read_char, user_error): * src/lisp.h (die, wrong_type_argument, wrong_choice) (args_out_of_range, args_out_of_range_3, circular_list) (buffer_overflow, memory_full, buffer_memory_full) (string_overflow, xsignal, xsignal0, xsignal1, xsignal2) (xsignal3, signal_error, overflow_error, error, verror) (nsberror, report_file_errno, report_file_error) (report_file_notify_error, terminate_due_to_signal) (emacs_abort, fatal): * src/lread.c (load_error_old_style_backquotes) (end_of_file_error, invalid_syntax): * src/pdumper.c (error_unsupported_dump_object): * src/puresize.h (pure_write_error): * src/search.c (matcher_overflow): * src/sound.c (sound_perror, alsa_sound_perror): * src/sysdep.c (handle_arith_signal): * src/systime.h (time_overflow): * src/term.c (maybe_fatal, vfatal): * src/textprop.c (text_read_only): * src/timefns.c (invalid_time_zone_specification) (time_error, invalid_hz): * src/xterm.c (x_connection_closed): Use AVOID instead of _Noreturn void, so that it’s marked cold. * src/conf_post.h (__has_attribute_cold) [!__has_attribute]: New macro. (ATTRIBUTE_COLD): New macro. * src/frame.h (WINDOW_SYSTEM_RETURN): Add ATTRIBUTE_COLD. * src/lisp.h (AVOID): New macro. * src/xterm.c: Omit unnecessary static decls, so that we needn’t worry about which functions should be marked cold. (x_io_error_quitter): Mark as cold.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 8fb6db987b5..dff8f6b2fc9 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -364,7 +364,7 @@ static void restore_getcjmp (void *);
364static Lisp_Object apply_modifiers (int, Lisp_Object); 364static Lisp_Object apply_modifiers (int, Lisp_Object);
365static void restore_kboard_configuration (int); 365static void restore_kboard_configuration (int);
366static void handle_interrupt (bool); 366static void handle_interrupt (bool);
367static _Noreturn void quit_throw_to_read_char (bool); 367static AVOID quit_throw_to_read_char (bool);
368static void timer_start_idle (void); 368static void timer_start_idle (void);
369static void timer_stop_idle (void); 369static void timer_stop_idle (void);
370static void timer_resume_idle (void); 370static void timer_resume_idle (void);
@@ -1131,13 +1131,12 @@ This also exits all active minibuffers. */
1131 Fthrow (Qtop_level, Qnil); 1131 Fthrow (Qtop_level, Qnil);
1132} 1132}
1133 1133
1134static _Noreturn void 1134static AVOID
1135user_error (const char *msg) 1135user_error (const char *msg)
1136{ 1136{
1137 xsignal1 (Quser_error, build_string (msg)); 1137 xsignal1 (Quser_error, build_string (msg));
1138} 1138}
1139 1139
1140/* _Noreturn will be added to prototype by make-docfile. */
1141DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "", 1140DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "",
1142 doc: /* Exit from the innermost recursive edit or minibuffer. */ 1141 doc: /* Exit from the innermost recursive edit or minibuffer. */
1143 attributes: noreturn) 1142 attributes: noreturn)
@@ -1149,7 +1148,6 @@ DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0,
1149 user_error ("No recursive edit is in progress"); 1148 user_error ("No recursive edit is in progress");
1150} 1149}
1151 1150
1152/* _Noreturn will be added to prototype by make-docfile. */
1153DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "", 1151DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "",
1154 doc: /* Abort the command that requested this recursive edit or minibuffer input. */ 1152 doc: /* Abort the command that requested this recursive edit or minibuffer input. */
1155 attributes: noreturn) 1153 attributes: noreturn)