FreeBSD/contrib/gcc/c-common.c
/* Some builtin functions are placeholders for other expressions.  This
   function should be called immediately after parsing the call expression
   before surrounding code has committed to the type of the expression.

   FUNCTION is the DECL that has been invoked; it is known to be a builtin.
   PARAMS is the argument list for the call.  The return value is non-null
   when expansion is complete, and null if normal processing should
   continue.  */
Some builtin functions are placeholders for other expressions.  This
function should be called immediately after parsing the call expression
before surrounding code has committed to the type of the expression.

FUNCTION is the DECL that has been invoked; it is known to be a builtin.
PARAMS is the argument list for the call.  The return value is non-null
when expansion is complete, and null if normal processing should
continue.
Some builtin functions are placeholders for other expressions . This function should be called immediately after parsing the call expression before surrounding code has committed to the type of the expression . FUNCTION is the DECL that has been invoked ; it is known to be a builtin . PARAMS is the argument list for the call . The return value is non - null when expansion is complete and null if normal processing should continue .
tree
resolve_overloaded_builtin (tree function, tree params)
{
  enum built_in_function orig_code = DECL_FUNCTION_CODE (function);
  switch (DECL_BUILT_IN_CLASS (function))
    {
    case BUILT_IN_NORMAL:
      break;
    case BUILT_IN_MD:
      if (targetm.resolve_overloaded_builtin)
	return targetm.resolve_overloaded_builtin (function, params);
      else
	return NULL_TREE;
    default:
      return NULL_TREE;
    }
  switch (orig_code)
    {
    case BUILT_IN_FETCH_AND_ADD_N:
    case BUILT_IN_FETCH_AND_SUB_N:
    case BUILT_IN_FETCH_AND_OR_N:
    case BUILT_IN_FETCH_AND_AND_N:
    case BUILT_IN_FETCH_AND_XOR_N:
    case BUILT_IN_FETCH_AND_NAND_N:
    case BUILT_IN_ADD_AND_FETCH_N:
    case BUILT_IN_SUB_AND_FETCH_N:
    case BUILT_IN_OR_AND_FETCH_N:
    case BUILT_IN_AND_AND_FETCH_N:
    case BUILT_IN_XOR_AND_FETCH_N:
    case BUILT_IN_NAND_AND_FETCH_N:
    case BUILT_IN_BOOL_COMPARE_AND_SWAP_N:
    case BUILT_IN_VAL_COMPARE_AND_SWAP_N:
    case BUILT_IN_LOCK_TEST_AND_SET_N:
    case BUILT_IN_LOCK_RELEASE_N:
      {
	int n = sync_resolve_size (function, params);
	tree new_function, result;
	if (n == 0)
	  return error_mark_node;
	new_function = built_in_decls[orig_code + exact_log2 (n) + 1];
	if (!sync_resolve_params (function, new_function, params))
	  return error_mark_node;
	result = build_function_call (new_function, params);
	if (orig_code != BUILT_IN_BOOL_COMPARE_AND_SWAP_N
	    && orig_code != BUILT_IN_LOCK_RELEASE_N)
	  result = sync_resolve_return (params, result);
	return result;
      }
    default:
      return NULL_TREE;
    }
}
tree resolve_overloaded_builtin ( tree function , tree params ) { enum built_in_function orig_code = DECL_FUNCTION_CODE ( function ) ; switch ( DECL_BUILT_IN_CLASS ( function ) ) { case BUILT_IN_NORMAL : break ; case BUILT_IN_MD : if ( targetm . resolve_overloaded_builtin ) return targetm . resolve_overloaded_builtin ( function , params ) ; else return NULL_TREE ; default : return NULL_TREE ; } switch ( orig_code ) { case BUILT_IN_FETCH_AND_ADD_N : case BUILT_IN_FETCH_AND_SUB_N : case BUILT_IN_FETCH_AND_OR_N : case BUILT_IN_FETCH_AND_AND_N : case BUILT_IN_FETCH_AND_XOR_N : case BUILT_IN_FETCH_AND_NAND_N : case BUILT_IN_ADD_AND_FETCH_N : case BUILT_IN_SUB_AND_FETCH_N : case BUILT_IN_OR_AND_FETCH_N : case BUILT_IN_AND_AND_FETCH_N : case BUILT_IN_XOR_AND_FETCH_N : case BUILT_IN_NAND_AND_FETCH_N : case BUILT_IN_BOOL_COMPARE_AND_SWAP_N : case BUILT_IN_VAL_COMPARE_AND_SWAP_N : case BUILT_IN_LOCK_TEST_AND_SET_N : case BUILT_IN_LOCK_RELEASE_N : { int n = sync_resolve_size ( function , params ) ; tree new_function , result ; if ( n == 0 ) return error_mark_node ; new_function = built_in_decls [ orig_code + exact_log2 ( n ) + 1 ] ; if ( ! sync_resolve_params ( function , new_function , params ) ) return error_mark_node ; result = build_function_call ( new_function , params ) ; if ( orig_code != BUILT_IN_BOOL_COMPARE_AND_SWAP_N && orig_code != BUILT_IN_LOCK_RELEASE_N ) result = sync_resolve_return ( params , result ) ; return result ; } default : return NULL_TREE ; } }
Some builtin functions are placeholders for other expressions.
Some builtin functions are placeholders for other expressions .
/* Handle BUILT_IN_NORMAL here.  */