Skip to content
This repository was archived by the owner on Jun 20, 2019. It is now read-only.

Commit bb5ea63

Browse files
committed
Mark noreturn library functions as ECF_LEAF and ECF_COLD.
1 parent 899e3c1 commit bb5ea63

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

gcc/d/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2018-02-11 Iain Buclaw <ibuclaw@gdcproject.org>
2+
3+
* runtime.def (ASSERT, ASSERT_MSG): Set ECF_COLD and ECF_LEAF flags.
4+
(UNITTEST, UNITTEST_MSG): Likewise.
5+
(ARRAY_BOUNDS, SWITCH_ERROR): Likewise.
6+
17
2018-01-28 Iain Buclaw <ibuclaw@gdcproject.org>
28

39
* gdc.texi (Runtime Options): Remove deprecated -fproperty option.

gcc/d/runtime.def

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,20 @@ along with GCC; see the file COPYING3. If not see
3434
#define RT(T1) LCT_ ## T1
3535

3636
/* Used when an assert() contract fails. */
37-
DEF_D_RUNTIME (ASSERT, "_d_assert", RT(VOID), P2(STRING, UINT), ECF_NORETURN)
37+
DEF_D_RUNTIME (ASSERT, "_d_assert", RT(VOID), P2(STRING, UINT),
38+
ECF_COLD | ECF_LEAF | ECF_NORETURN)
3839
DEF_D_RUNTIME (ASSERT_MSG, "_d_assert_msg", RT(VOID), P3(STRING, STRING, UINT),
39-
ECF_NORETURN)
40+
ECF_COLD | ECF_LEAF | ECF_NORETURN)
4041

4142
/* Used when an assert() contract fails in a unittest function. */
4243
DEF_D_RUNTIME (UNITTEST, "_d_unittest", RT(VOID), P2(STRING, UINT),
43-
ECF_NORETURN)
44+
ECF_COLD | ECF_LEAF | ECF_NORETURN)
4445
DEF_D_RUNTIME (UNITTEST_MSG, "_d_unittest_msg", RT(VOID),
45-
P3(STRING, STRING, UINT), ECF_NORETURN)
46+
P3(STRING, STRING, UINT), ECF_COLD | ECF_LEAF | ECF_NORETURN)
4647

4748
/* Used when an array index outside the bounds of its range. */
4849
DEF_D_RUNTIME (ARRAY_BOUNDS, "_d_arraybounds", RT(VOID), P2(STRING, UINT),
49-
ECF_NORETURN)
50+
ECF_COLD | ECF_LEAF | ECF_NORETURN)
5051

5152
/* Used when calling new on a class. */
5253
DEF_D_RUNTIME (NEWCLASS, "_d_newclass", RT(OBJECT), P1(CONST_CLASSINFO), 0)
@@ -214,7 +215,7 @@ DEF_D_RUNTIME (SWITCH_DSTRING, "_d_switch_dstring", RT(INT),
214215
/* Used when throwing an error that a switch statement has no default case,
215216
and yet none of the existing cases matched. */
216217
DEF_D_RUNTIME (SWITCH_ERROR, "_d_switch_error", RT(VOID), P2(STRING, UINT),
217-
ECF_NORETURN)
218+
ECF_COLD | ECF_LEAF | ECF_NORETURN)
218219

219220
#undef P0
220221
#undef P1

0 commit comments

Comments
 (0)