-/* We want to inline `extern inline' functions even if this would
- violate inlining limits. Some glibc and linux constructs depend on
- such functions always being inlined when optimizing. */
-
-int
-c_disregard_inline_limits (tree fn)
-{
- if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
- return 1;
-
- return (!flag_really_no_inline && DECL_DECLARED_INLINE_P (fn)
- && DECL_EXTERNAL (fn));
-}
-
-int
-c_cannot_inline_tree_fn (tree *fnp)
-{
- tree fn = *fnp;
- tree t;
- bool do_warning = (warn_inline
- && DECL_INLINE (fn)
- && DECL_DECLARED_INLINE_P (fn)
- && !DECL_IN_SYSTEM_HEADER (fn));
-
- if (flag_really_no_inline
- && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
- {
- if (do_warning)
- warning ("%Jfunction '%F' can never be inlined because it "
- "is suppressed using -fno-inline", fn, fn);
- goto cannot_inline;
- }
-
- /* Don't auto-inline anything that might not be bound within
- this unit of translation. */
- if (!DECL_DECLARED_INLINE_P (fn) && !targetm.binds_local_p (fn))
- {
- if (do_warning)
- warning ("%Jfunction '%F' can never be inlined because it might not "
- "be bound within this unit of translation", fn, fn);
- goto cannot_inline;
- }
-
- if (! function_attribute_inlinable_p (fn))
- {
- if (do_warning)
- warning ("%Jfunction '%F' can never be inlined because it uses "
- "attributes conflicting with inlining", fn, fn);
- goto cannot_inline;
- }
-
- /* If a function has pending sizes, we must not defer its
- compilation, and we can't inline it as a tree. */
- if (fn == current_function_decl)
- {
- t = get_pending_sizes ();
- put_pending_sizes (t);
-
- if (t)
- {
- if (do_warning)
- warning ("%Jfunction '%F' can never be inlined because it has "
- "pending sizes", fn, fn);
- goto cannot_inline;
- }
- }
-
- if (! DECL_FILE_SCOPE_P (fn))
- {
- /* If a nested function has pending sizes, we may have already
- saved them. */
- if (DECL_LANG_SPECIFIC (fn)->pending_sizes)
- {
- if (do_warning)
- warning ("%Jnested function '%F' can never be inlined because it "
- "has possibly saved pending sizes", fn, fn);
- goto cannot_inline;
- }
- }
-
- return 0;
-
- cannot_inline:
- DECL_UNINLINABLE (fn) = 1;
- return 1;
-}
-