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

Go to the source code of this file.

Data Structures

class  predefined_function_abi
 
class  function_abi
 
class  function_abi_aggregator
 
struct  target_function_abi_info
 

Macros

#define this_target_function_abi_info   (&default_target_function_abi_info)
 
#define function_abis    (this_target_function_abi_info->x_function_abis)
 
#define default_function_abi    (this_target_function_abi_info->x_function_abis[0])
 
#define eh_edge_abi   default_function_abi
 

Functions

HARD_REG_SET call_clobbers_in_region (unsigned int, const_hard_reg_set, machine_mode mode)
 
bool call_clobbered_in_region_p (unsigned int abis, const_hard_reg_set mask, machine_mode mode, unsigned int regno)
 
const predefined_function_abifntype_abi (const_tree)
 
function_abi fndecl_abi (const_tree)
 
function_abi insn_callee_abi (const rtx_insn *)
 
function_abi expr_callee_abi (const_tree)
 

Variables

const size_t NUM_ABI_IDS = 8
 
target_function_abi_info default_target_function_abi_info
 

Macro Definition Documentation

◆ default_function_abi

◆ eh_edge_abi

◆ function_abis

#define function_abis    (this_target_function_abi_info->x_function_abis)
See the comment above x_function_abis for when these macros should be used.
At present, eh_edge_abi is always the default ABI, but that could change
in future if a target needs it to.   

Referenced by call_clobbers_in_region(), function_abi_aggregator::caller_save_regs(), and globalize_reg().

◆ this_target_function_abi_info

#define this_target_function_abi_info   (&default_target_function_abi_info)

Function Documentation

◆ call_clobbered_in_region_p()

bool call_clobbered_in_region_p ( unsigned int abis,
const_hard_reg_set mask,
machine_mode mode,
unsigned int regno )
inline
Return true if (reg:MODE REGNO) might be clobbered by one of the
calls in a region described by ABIS and MASK, where:

* Bit ID of ABIS is set if the region contains a call with
  function_abi identifier ID.

* MASK contains all the registers that are fully or partially
  clobbered by calls in the region.

This is not quite as accurate as testing each individual call,
but it's a close and conservatively-correct approximation.
It's much better for some targets than:

  overlaps_hard_reg_set_p (MASK, MODE, REGNO).   

References call_clobbers_in_region(), ggc_alloc(), and overlaps_hard_reg_set_p().

Referenced by call_clobbered_in_chain_p(), ira_need_caller_save_p(), and need_for_call_save_p().

◆ call_clobbers_in_region()

HARD_REG_SET call_clobbers_in_region ( unsigned int abis,
const_hard_reg_set mask,
machine_mode mode )
extern
Return the set of registers that cannot be used to hold a value of
mode MODE across the calls in a region described by ABIS and MASK, where:

* Bit ID of ABIS is set if the region contains a call with
  function_abi identifier ID.

* MASK contains all the registers that are fully or partially
  clobbered by calls in the region.

This is not quite as accurate as testing each individual call,
but it's a close and conservatively-correct approximation.
It's much better for some targets than just using MASK.   

References CLEAR_HARD_REG_SET, function_abis, and ggc_alloc().

Referenced by call_clobbered_in_region_p(), and ira_need_caller_save_regs().

◆ expr_callee_abi()

function_abi expr_callee_abi ( const_tree exp)
extern
Return the ABI of the function called by CALL_EXPR EXP.  Return the
default ABI for erroneous calls.   

References CALL_EXPR_FN, default_function_abi, error_mark_node, exp(), fndecl_abi(), fntype_abi(), gcc_assert, get_callee_fndecl(), ggc_alloc(), POINTER_TYPE_P, TREE_CODE, and TREE_TYPE.

◆ fndecl_abi()

◆ fntype_abi()

const predefined_function_abi & fntype_abi ( const_tree type)
extern
Return the predefined ABI used by functions with type TYPE.   

References default_function_abi, FUNC_OR_METHOD_TYPE_P, gcc_assert, and targetm.

Referenced by aggregate_value_p(), expr_callee_abi(), and fndecl_abi().

◆ insn_callee_abi()

Variable Documentation

◆ default_target_function_abi_info

target_function_abi_info default_target_function_abi_info
extern
Information about fuunction binary interfaces.
   Copyright (C) 2019-2024 Free Software Foundation, Inc.

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/>.   

◆ NUM_ABI_IDS

const size_t NUM_ABI_IDS = 8
Information about function binary interfaces.
   Copyright (C) 2019-2024 Free Software Foundation, Inc.

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/>.   
Most targets use the same ABI for all functions in a translation
unit, but some targets support interoperability between several ABIs.
Each such ABI has a unique 0-based identifier, with 0 always being
the default choice of ABI.

NUM_ABI_IDS is the maximum number of such ABIs that GCC can handle at once.
A bitfield with this number of bits can represent any combinaion of the
supported ABIs.   

Referenced by function_abi_aggregator::caller_save_regs(), globalize_reg(), inherit_in_ebb(), and need_for_call_save_p().