diff options
| author | Paul Eggert | 2019-04-18 00:30:24 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-04-18 00:35:18 -0700 |
| commit | 6d6c55db2cdfb6b354873f17285a3f602e011817 (patch) | |
| tree | fc9647797be220e613962260700c05e5f37100c1 /src/xterm.c | |
| parent | dded2c4cf30fbdb5e90c44bc76a26970d00e0f22 (diff) | |
| download | emacs-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/xterm.c')
| -rw-r--r-- | src/xterm.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/src/xterm.c b/src/xterm.c index 0facb524549..0b83263a0e6 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -1505,37 +1505,8 @@ x_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fring | |||
| 1505 | Glyph display | 1505 | Glyph display |
| 1506 | ***********************************************************************/ | 1506 | ***********************************************************************/ |
| 1507 | 1507 | ||
| 1508 | |||
| 1509 | |||
| 1510 | static void x_set_glyph_string_clipping (struct glyph_string *); | ||
| 1511 | static void x_set_glyph_string_gc (struct glyph_string *); | ||
| 1512 | static void x_draw_glyph_string_foreground (struct glyph_string *); | ||
| 1513 | static void x_draw_composite_glyph_string_foreground (struct glyph_string *); | ||
| 1514 | static void x_draw_glyph_string_box (struct glyph_string *); | ||
| 1515 | static void x_draw_glyph_string (struct glyph_string *); | ||
| 1516 | static _Noreturn void x_delete_glyphs (struct frame *, int); | ||
| 1517 | static void x_compute_glyph_string_overhangs (struct glyph_string *); | ||
| 1518 | static void x_set_cursor_gc (struct glyph_string *); | ||
| 1519 | static void x_set_mode_line_face_gc (struct glyph_string *); | ||
| 1520 | static void x_set_mouse_face_gc (struct glyph_string *); | ||
| 1521 | static bool x_alloc_lighter_color (struct frame *, Display *, Colormap, | 1508 | static bool x_alloc_lighter_color (struct frame *, Display *, Colormap, |
| 1522 | unsigned long *, double, int); | 1509 | unsigned long *, double, int); |
| 1523 | static void x_setup_relief_color (struct frame *, struct relief *, | ||
| 1524 | double, int, unsigned long); | ||
| 1525 | static void x_setup_relief_colors (struct glyph_string *); | ||
| 1526 | static void x_draw_image_glyph_string (struct glyph_string *); | ||
| 1527 | static void x_draw_image_relief (struct glyph_string *); | ||
| 1528 | static void x_draw_image_foreground (struct glyph_string *); | ||
| 1529 | #ifndef USE_CAIRO | ||
| 1530 | static void x_draw_image_foreground_1 (struct glyph_string *, Pixmap); | ||
| 1531 | #endif | ||
| 1532 | static void x_clear_glyph_string_rect (struct glyph_string *, int, | ||
| 1533 | int, int, int); | ||
| 1534 | static void x_draw_relief_rect (struct frame *, int, int, int, int, | ||
| 1535 | int, bool, bool, bool, bool, bool, | ||
| 1536 | XRectangle *); | ||
| 1537 | static void x_draw_box_rect (struct glyph_string *, int, int, int, int, | ||
| 1538 | int, bool, bool, XRectangle *); | ||
| 1539 | static void x_scroll_bar_clear (struct frame *); | 1510 | static void x_scroll_bar_clear (struct frame *); |
| 1540 | 1511 | ||
| 1541 | #ifdef GLYPH_DEBUG | 1512 | #ifdef GLYPH_DEBUG |
| @@ -3975,7 +3946,7 @@ x_shift_glyphs_for_insert (struct frame *f, int x, int y, int width, int height, | |||
| 3975 | for X frames. */ | 3946 | for X frames. */ |
| 3976 | 3947 | ||
| 3977 | static void | 3948 | static void |
| 3978 | x_delete_glyphs (struct frame *f, register int n) | 3949 | x_delete_glyphs (struct frame *f, int n) |
| 3979 | { | 3950 | { |
| 3980 | emacs_abort (); | 3951 | emacs_abort (); |
| 3981 | } | 3952 | } |
| @@ -9842,7 +9813,7 @@ static char *error_msg; | |||
| 9842 | /* Handle the loss of connection to display DPY. ERROR_MESSAGE is | 9813 | /* Handle the loss of connection to display DPY. ERROR_MESSAGE is |
| 9843 | the text of an error message that lead to the connection loss. */ | 9814 | the text of an error message that lead to the connection loss. */ |
| 9844 | 9815 | ||
| 9845 | static _Noreturn void | 9816 | static AVOID |
| 9846 | x_connection_closed (Display *dpy, const char *error_message, bool ioerror) | 9817 | x_connection_closed (Display *dpy, const char *error_message, bool ioerror) |
| 9847 | { | 9818 | { |
| 9848 | struct x_display_info *dpyinfo = x_display_info_for_display (dpy); | 9819 | struct x_display_info *dpyinfo = x_display_info_for_display (dpy); |
| @@ -10005,7 +9976,7 @@ x_error_quitter (Display *display, XErrorEvent *event) | |||
| 10005 | It kills all frames on the display that we lost touch with. | 9976 | It kills all frames on the display that we lost touch with. |
| 10006 | If that was the only one, it prints an error message and kills Emacs. */ | 9977 | If that was the only one, it prints an error message and kills Emacs. */ |
| 10007 | 9978 | ||
| 10008 | static _Noreturn int | 9979 | static _Noreturn ATTRIBUTE_COLD int |
| 10009 | x_io_error_quitter (Display *display) | 9980 | x_io_error_quitter (Display *display) |
| 10010 | { | 9981 | { |
| 10011 | char buf[256]; | 9982 | char buf[256]; |