Skip to content

Commit c19f8b2

Browse files
committed
Improve comments to address review []
1 parent 522fccf commit c19f8b2

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

‎src/c_gen_be.c‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10892,9 +10892,11 @@ if this routine has a body (dump nothing if it has no body).
1089210892
if (!for_inlining_only) {
1089310893
storage_class = (a_storage_class)sc_extern;
1089410894
/* "extern inline" is a definition only for inlining under the GNU
10895-
C89 rules, but an external definition under the C99 rules (the
10896-
gcc default since 5.1), so request the former with the gnu_inline
10897-
attribute. */
10895+
C89 rules, but an external definition under the C99 rules (used
10896+
by gcc in C99 modes since 4.3, and by default since 5.1), so
10897+
request the former with the gnu_inline attribute. As in
10898+
form_routine_attributes, omit it for gcc before 4.2, which does
10899+
not recognize it but always follows the GNU C89 rules. */
1089810900
need_gnu_inline_attr = TRUE;
1089910901
#if GCC_IS_GENERATED_CODE_TARGET
1090010902
if (gcc_is_generated_code_target &&
@@ -10903,7 +10905,11 @@ if this routine has a body (dump nothing if it has no body).
1090310905
} /* if */
1090410906
#endif /* GCC_IS_GENERATED_CODE_TARGET */
1090510907
#if GNU_EXTENSIONS_ALLOWED
10906-
if (rout->gnu_c89_inline) need_gnu_inline_attr = FALSE;
10908+
if (rout->gnu_c89_inline) {
10909+
/* form_routine_attributes already puts out the gnu_inline
10910+
attribute for this routine. */
10911+
need_gnu_inline_attr = FALSE;
10912+
} /* if */
1090710913
#endif /* GNU_EXTENSIONS_ALLOWED */
1090810914
} /* if */
1090910915
} /* if */
@@ -11165,12 +11171,13 @@ if this routine has a body (dump nothing if it has no body).
1116511171
#endif /* MICROSOFT_EXTENSIONS_ALLOWED */
1116611172
if (gcc_or_clang_is_generated_code_target && rout->is_inline) {
1116711173
/* gcc will be used to compile this generated code, so we know how to
11168-
indicate an inline function. gcc ignores __inline__ on functions
11169-
with ellipses, so don't mark such functions as inline. Also,
11170-
recent versions of gcc issue an error for a function marked both
11171-
inline and weak, so don't mark a weak function as inline either */
11172-
if ((!f_skip_typerefs(rout->type)->variant.routine.extra_info->
11173-
has_ellipsis ||
11174+
indicate an inline function. */
11175+
/* gcc ignores __inline__ on functions with ellipses, so don't
11176+
mark such functions as inline, except for a definition only for
11177+
inlining, which would otherwise be an external definition. Recent
11178+
versions of gcc issue an error for a function marked both inline and
11179+
weak, so don't mark a weak function as inline, either. */
11180+
if ((!rout_type_supp(f_skip_typerefs(rout->type))->has_ellipsis ||
1117411181
inline_only_defn) &&
1117511182
!is_marked_weak) {
1117611183
write_tok_str("__inline__ ");

0 commit comments

Comments
 (0)