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

Go to the source code of this file.

Functions

tree convert_to_integer (tree, tree)
 
tree convert_to_integer_maybe_fold (tree, tree, bool)
 
tree convert_to_pointer (tree, tree)
 
tree convert_to_pointer_maybe_fold (tree, tree, bool)
 
tree convert_to_real (tree, tree)
 
tree convert_to_real_maybe_fold (tree, tree, bool)
 
tree convert_to_fixed (tree, tree)
 
tree convert_to_complex (tree, tree)
 
tree convert_to_complex_maybe_fold (tree, tree, bool)
 
tree convert_to_vector (tree, tree)
 
tree convert_to_integer_nofold (tree t, tree x)
 
tree convert_to_pointer_nofold (tree t, tree x)
 
tree convert_to_real_nofold (tree t, tree x)
 
tree convert_to_complex_nofold (tree t, tree x)
 
tree preserve_any_location_wrapper (tree result, tree orig_expr)
 

Function Documentation

◆ convert_to_complex()

tree convert_to_complex ( tree type,
tree expr )
extern
A wrapper around convert_to_complex_1 that always folds the
expression.   

References convert_to_complex_1().

◆ convert_to_complex_maybe_fold()

tree convert_to_complex_maybe_fold ( tree type,
tree expr,
bool dofold )
extern
A wrapper around convert_to_complex_1 that only folds the
expression if DOFOLD, or if it is CONSTANT_CLASS_OR_WRAPPER_P.   

References CONSTANT_CLASS_OR_WRAPPER_P, convert_to_complex_1(), and preserve_any_location_wrapper().

Referenced by convert_to_complex_nofold().

◆ convert_to_complex_nofold()

tree convert_to_complex_nofold ( tree t,
tree x )
externinline

◆ convert_to_fixed()

tree convert_to_fixed ( tree type,
tree expr )
extern
Convert EXPR to some fixed-point type TYPE.

EXPR must be fixed-point, float, integer, or enumeral;
in other cases error is called.   

References ALL_SCALAR_ACCUM_MODE_P, build1(), build_fixed(), convert(), error(), error_mark_node, FCONST0, FCONST1, fold_build1, integer_onep(), integer_zerop(), TREE_CODE, TREE_TYPE, and TYPE_MODE.

◆ convert_to_integer()

tree convert_to_integer ( tree type,
tree expr )
extern
Definition of functions in convert.cc.
   Copyright (C) 1993-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/>.   
Convert EXPR to some integer (or enum) type TYPE.

EXPR must be pointer, integer, discrete (enum, char, or bool), float,
fixed-point or vector; in other cases error is called.

The result of this is always supposed to be a newly created tree node
not in use in any existing structure.   

References convert_to_integer_1().

◆ convert_to_integer_maybe_fold()

tree convert_to_integer_maybe_fold ( tree type,
tree expr,
bool dofold )
extern
A wrapper around convert_to_complex_1 that only folds the
expression if DOFOLD, or if it is CONSTANT_CLASS_OR_WRAPPER_P.   

References CONSTANT_CLASS_OR_WRAPPER_P, convert_to_integer_1(), and preserve_any_location_wrapper().

Referenced by convert_to_integer_nofold().

◆ convert_to_integer_nofold()

tree convert_to_integer_nofold ( tree t,
tree x )
externinline

◆ convert_to_pointer()

tree convert_to_pointer ( tree type,
tree expr )
extern
A wrapper around convert_to_pointer_1 that always folds the
expression.   

References convert_to_pointer_1().

Referenced by oacc_rewrite_var_decl().

◆ convert_to_pointer_maybe_fold()

tree convert_to_pointer_maybe_fold ( tree type,
tree expr,
bool dofold )
extern
A wrapper around convert_to_pointer_1 that only folds the
expression if DOFOLD, or if it is CONSTANT_CLASS_OR_WRAPPER_P.   

References CONSTANT_CLASS_OR_WRAPPER_P, convert_to_pointer_1(), and preserve_any_location_wrapper().

Referenced by convert_to_pointer_nofold().

◆ convert_to_pointer_nofold()

tree convert_to_pointer_nofold ( tree t,
tree x )
externinline

◆ convert_to_real()

tree convert_to_real ( tree type,
tree expr )
extern
A wrapper around convert_to_real_1 that always folds the
expression.   

References convert_to_real_1().

◆ convert_to_real_maybe_fold()

tree convert_to_real_maybe_fold ( tree type,
tree expr,
bool dofold )
extern
A wrapper around convert_to_real_1 that only folds the
expression if DOFOLD, or if it is CONSTANT_CLASS_OR_WRAPPER_P.   

References CONSTANT_CLASS_OR_WRAPPER_P, convert_to_real_1(), and preserve_any_location_wrapper().

Referenced by convert_to_real_nofold().

◆ convert_to_real_nofold()

tree convert_to_real_nofold ( tree t,
tree x )
externinline

◆ convert_to_vector()

tree convert_to_vector ( tree type,
tree expr )
extern
Convert EXPR to the vector type TYPE in the usual ways.   

References build1(), error(), error_mark_node, TREE_CODE, tree_int_cst_equal(), TREE_TYPE, and TYPE_SIZE.

◆ preserve_any_location_wrapper()

tree preserve_any_location_wrapper ( tree result,
tree orig_expr )
extern
Subroutine of the various convert_to_*_maybe_fold routines.

If a location wrapper has been folded to a constant (presumably of
a different type), re-wrap the new constant with a location wrapper.   

References CONSTANT_CLASS_P, EXPR_LOCATION, location_wrapper_p(), maybe_wrap_with_location(), and TREE_OPERAND.

Referenced by convert_to_complex_maybe_fold(), convert_to_integer_maybe_fold(), convert_to_pointer_maybe_fold(), and convert_to_real_maybe_fold().