GCC Middle and Back End API Reference
ipa-strub.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool strub_inlinable_to_p (cgraph_node *callee, cgraph_node *caller)
 
bool strub_splittable_p (cgraph_node *node)
 
tree strub_watermark_parm (tree fndecl)
 
void strub_make_callable (tree fndecl)
 
int strub_validate_fn_attr_parm (tree id)
 
int strub_comptypes (tree t1, tree t2)
 

Function Documentation

◆ strub_comptypes()

int strub_comptypes ( tree t1,
tree t2 )
extern
Like comptypes, return 0 if t1 and t2 are not compatible, 1 if they are
compatible, and 2 if they are nearly compatible.  Same strub mode is
compatible, interface-compatible strub modes are nearly compatible.   
Check that types T1 and T2 are strub-compatible.  Return 1 if the strub modes
are the same, 2 if they are interchangeable, and 0 otherwise.   

References FUNC_OR_METHOD_TYPE_P, get_strub_mode_from_type(), STRUB_AT_CALLS, STRUB_INTERNAL, and TREE_CODE.

Referenced by comp_type_attributes().

◆ strub_inlinable_to_p()

bool strub_inlinable_to_p ( cgraph_node * callee,
cgraph_node * caller )
extern
strub (stack scrubbing) infrastructure.
   Copyright (C) 2021-2024 Free Software Foundation, Inc.
   Contributed by Alexandre Oliva <oliva@adacore.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Return TRUE if CALLEE can be inlined into CALLER, as far as stack scrubbing
constraints are concerned.  CALLEE doesn't have to be called directly by
CALLER, but the returned value says nothing about intervening functions.   
Return TRUE iff CALLEE can be inlined into CALLER.  We wish to avoid inlining
WRAPPED functions back into their WRAPPERs.  More generally, we wish to avoid
inlining strubbed functions into non-strubbed ones.  CALLER doesn't have to
be an immediate caller of CALLEE: the immediate caller may have already been
cloned for inlining, and then CALLER may be further up the original call
chain.  ???  It would be nice if our own caller would retry inlining callee
if caller gets inlined.   

References gcc_unreachable, get_strub_mode(), STRUB_AT_CALLS, STRUB_AT_CALLS_OPT, STRUB_CALLABLE, STRUB_DISABLED, STRUB_INLINABLE, STRUB_INTERNAL, STRUB_WRAPPED, and STRUB_WRAPPER.

Referenced by can_inline_edge_p().

◆ strub_make_callable()

void strub_make_callable ( tree fndt)
extern
Make a function type or declaration callable.   
Set FNDT's strub mode to callable.
FNDT may be a function decl or a function type.   

References STRUB_CALLABLE, and strub_set_fndt_mode_to().

◆ strub_splittable_p()

bool strub_splittable_p ( cgraph_node * node)
extern

◆ strub_validate_fn_attr_parm()

int strub_validate_fn_attr_parm ( tree id)
extern
Return zero iff ID is NOT an acceptable parameter for a user-supplied strub
attribute for a function.  Otherwise, return >0 if it enables strub, <0 if it
does not.  Return +/-1 if the attribute-modified type is compatible with the
type without the attribute, or +/-2 if it is not compatible.   
Determine whether ID is a well-formed strub mode-specifying attribute
parameter for a function (type).  Only user-visible modes are accepted, and
ID must be non-NULL.

For unacceptable parms, return 0, otherwise a nonzero value as below.

If the parm enables strub, return positive, otherwise negative.

If the affected type must be a distinct, incompatible type,return an integer
of absolute value 2, otherwise 1.   

References get_strub_mode_attr_parm(), IDENTIFIER_LENGTH, IDENTIFIER_POINTER, NULL, STRUB_AT_CALLS, STRUB_CALLABLE, STRUB_DISABLED, STRUB_INTERNAL, TREE_CODE, TREE_STRING_LENGTH, and TREE_STRING_POINTER.

◆ strub_watermark_parm()

tree strub_watermark_parm ( tree fndecl)
extern
Locate and return the watermark_ptr parameter for FNDECL.  If FNDECL is not a
strub context, return NULL.   
Return the PARM_DECL of the incoming watermark pointer, if there is one.   

References DECL_ARGUMENTS, DECL_CHAIN, DECL_NAME, gcc_unreachable, get_strub_mode_from_fndecl(), NULL_TREE, STRUB_AT_CALLS, STRUB_AT_CALLS_OPT, STRUB_CALLABLE, STRUB_DISABLED, STRUB_INLINABLE, STRUB_INTERNAL, STRUB_WRAPPED, STRUB_WRAPPER, and TREE_TYPE.

Referenced by expand_builtin_strub_leave(), and expand_builtin_strub_update().