/* Compares two array specifications. They must be constant or deferred
shape. */
-int
+bool
gfc_compare_array_spec (gfc_array_spec *as1, gfc_array_spec *as2)
{
int i;
use the symbol as an implied-DO iterator. Returns nonzero if a
duplicate was found. */
-static int
+static bool
check_duplicate_iterator (gfc_constructor_base base, gfc_symbol *master)
{
gfc_constructor *c;
i=1,100000000) /) will take a while as* opposed to a more clever
function that traverses the expression tree. FIXME. */
-int
+bool
gfc_constant_ac (gfc_expr *e)
{
expand_info expand_save;
/* Returns nonzero if an array constructor has been completely
expanded (no iterators) and zero if iterators are present. */
-int
+bool
gfc_expanded_ac (gfc_expr *e)
{
gfc_constructor *c;
dimension bi, returning 0 if they are known not to be identical,
and 1 if they are identical, or if this cannot be determined. */
-static int
+static bool
identical_dimen_shape (gfc_expr *a, int ai, gfc_expr *b, int bi)
{
mpz_t a_size, b_size;
- int ret;
+ bool ret;
gcc_assert (a->rank > ai);
gcc_assert (b->rank > bi);
- ret = 1;
+ ret = true;
if (gfc_array_dimen_size (a, ai, &a_size))
{
if (gfc_array_dimen_size (b, bi, &b_size))
{
if (mpz_cmp (a_size, b_size) != 0)
- ret = 0;
+ ret = false;
mpz_clear (b_size);
}
gfc_cpp_option.deferred_opt_count = 0;
}
-int
+bool
gfc_cpp_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
{
- int result = 1;
+ bool result = true;
enum opt_code code = (enum opt_code) scode;
switch (code)
{
default:
- result = 0;
+ result = false;
break;
case OPT_cpp_:
static void scan_translation_unit_trad (cpp_reader *);
static void account_for_newlines (const unsigned char *, size_t);
-static int dump_macro (cpp_reader *, cpp_hashnode *, void *);
static void print_line (location_t, const char *);
static void maybe_print_line (location_t);
void gfc_cpp_init_options (unsigned int decoded_options_count,
struct cl_decoded_option *decoded_options);
-int gfc_cpp_handle_option(size_t scode, const char *arg, int value);
+bool gfc_cpp_handle_option(size_t scode, const char *arg, int value);
void gfc_cpp_post_options (bool);
}
-static int
+static bool
gfc_is_data_pointer (gfc_expr *e)
{
gfc_ref *ref;
/* Like gfc_check_argument_dependency, but check all the arguments in ACTUAL.
FNSYM is the function being called, or NULL if not known. */
-int
+bool
gfc_check_fncall_dependency (gfc_expr *other, sym_intent intent,
gfc_symbol *fnsym, gfc_actual_arglist *actual,
gfc_dep_check elemental)
e1->ref and e2->ref to determine whether the actually accessed
portions of these variables/arrays potentially overlap. */
-int
+bool
gfc_are_equivalenced_arrays (gfc_expr *e1, gfc_expr *e2)
{
gfc_equiv_list *l;
/* Finds if two array references are overlapping or not.
Return value
- 2 : array references are overlapping but reversal of one or
- more dimensions will clear the dependency.
1 : array references are overlapping, or identical is true and
there is some kind of overlap.
0 : array references are identical or not overlapping. */
-int
+bool
gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse,
bool identical)
{
bool gfc_ref_needs_temporary_p (gfc_ref *);
bool gfc_full_array_ref_p (gfc_ref *, bool *);
gfc_expr *gfc_get_noncopying_intrinsic_argument (gfc_expr *);
-int gfc_check_fncall_dependency (gfc_expr *, sym_intent, gfc_symbol *,
+bool gfc_check_fncall_dependency (gfc_expr *, sym_intent, gfc_symbol *,
gfc_actual_arglist *, gfc_dep_check);
int gfc_check_dependency (gfc_expr *, gfc_expr *, bool);
int gfc_expr_is_one (gfc_expr *, int);
-int gfc_dep_resolver (gfc_ref *, gfc_ref *, gfc_reverse *,
+bool gfc_dep_resolver (gfc_ref *, gfc_ref *, gfc_reverse *,
bool identical = false);
-int gfc_are_equivalenced_arrays (gfc_expr *, gfc_expr *);
+bool gfc_are_equivalenced_arrays (gfc_expr *, gfc_expr *);
gfc_expr * gfc_discard_nops (gfc_expr *);
/* Detect whether an expression has any vector index array references. */
-int
+bool
gfc_has_vector_index (gfc_expr *e)
{
gfc_ref *ref;
/* Returns nonzero if the type is numeric, zero otherwise. */
-static int
+static bool
numeric_type (bt type)
{
return type == BT_COMPLEX || type == BT_REAL || type == BT_INTEGER;
/* Returns nonzero if the typespec is a numeric type, zero otherwise. */
-int
+bool
gfc_numeric_ts (gfc_typespec *ts)
{
return numeric_type (ts->type);
void gfc_check_include_dirs (bool);
FILE *gfc_open_included_file (const char *, bool, bool);
-int gfc_at_end (void);
-int gfc_at_eof (void);
-int gfc_at_bol (void);
-int gfc_at_eol (void);
+bool gfc_at_end (void);
+bool gfc_at_eof (void);
+bool gfc_at_bol (void);
+bool gfc_at_eol (void);
void gfc_advance_line (void);
-int gfc_define_undef_line (void);
+bool gfc_define_undef_line (void);
-int gfc_wide_is_printable (gfc_char_t);
-int gfc_wide_is_digit (gfc_char_t);
-int gfc_wide_fits_in_byte (gfc_char_t);
+bool gfc_wide_is_printable (gfc_char_t);
+bool gfc_wide_is_digit (gfc_char_t);
+bool gfc_wide_fits_in_byte (gfc_char_t);
gfc_char_t gfc_wide_tolower (gfc_char_t);
gfc_char_t gfc_wide_toupper (gfc_char_t);
size_t gfc_wide_strlen (const gfc_char_t *);
gfc_symbol *gfc_new_symbol (const char *, gfc_namespace *);
gfc_symtree* gfc_find_symtree_in_proc (const char *, gfc_namespace *);
int gfc_find_symbol (const char *, gfc_namespace *, int, gfc_symbol **);
-int gfc_find_sym_tree (const char *, gfc_namespace *, int, gfc_symtree **);
+bool gfc_find_sym_tree (const char *, gfc_namespace *, int, gfc_symtree **);
int gfc_get_symbol (const char *, gfc_namespace *, gfc_symbol **);
bool gfc_verify_c_interop (gfc_typespec *);
bool gfc_verify_c_interop_param (gfc_symbol *);
bool gfc_convert_type_warn (gfc_expr *, gfc_typespec *, int, int,
bool array = false);
bool gfc_convert_chartype (gfc_expr *, gfc_typespec *);
-int gfc_generic_intrinsic (const char *);
-int gfc_specific_intrinsic (const char *);
+bool gfc_generic_intrinsic (const char *);
+bool gfc_specific_intrinsic (const char *);
bool gfc_is_intrinsic (gfc_symbol*, int, locus);
-int gfc_intrinsic_actual_ok (const char *, const bool);
+bool gfc_intrinsic_actual_ok (const char *, const bool);
gfc_intrinsic_sym *gfc_find_function (const char *);
gfc_intrinsic_sym *gfc_find_subroutine (const char *);
gfc_intrinsic_sym *gfc_intrinsic_function_by_id (gfc_isym_id);
bool gfc_is_constant_expr (gfc_expr *);
bool gfc_simplify_expr (gfc_expr *, int);
bool gfc_try_simplify_expr (gfc_expr *, int);
-int gfc_has_vector_index (gfc_expr *);
+bool gfc_has_vector_index (gfc_expr *);
gfc_expr *gfc_get_expr (void);
gfc_expr *gfc_get_array_expr (bt type, int kind, locus *);
bool gfc_specification_expr (gfc_expr *);
-int gfc_numeric_ts (gfc_typespec *);
+bool gfc_numeric_ts (gfc_typespec *);
int gfc_kind_max (gfc_expr *, gfc_expr *);
bool gfc_check_conformance (gfc_expr *, gfc_expr *, const char *, ...) ATTRIBUTE_PRINTF_3;
void gfc_resolve_code (gfc_code *, gfc_namespace *);
void gfc_resolve_blocks (gfc_code *, gfc_namespace *);
void gfc_resolve_formal_arglist (gfc_symbol *);
-int gfc_impure_variable (gfc_symbol *);
-int gfc_pure (gfc_symbol *);
-int gfc_implicit_pure (gfc_symbol *);
+bool gfc_impure_variable (gfc_symbol *);
+bool gfc_pure (gfc_symbol *);
+bool gfc_implicit_pure (gfc_symbol *);
void gfc_unset_implicit_pure (gfc_symbol *);
-int gfc_elemental (gfc_symbol *);
+bool gfc_elemental (gfc_symbol *);
bool gfc_resolve_iterator (gfc_iterator *, bool, bool);
bool find_forall_index (gfc_expr *, gfc_symbol *, int);
bool gfc_resolve_index (gfc_expr *, int);
bool gfc_explicit_interface_required (gfc_symbol *, char *, int);
extern int gfc_do_concurrent_flag;
const char* gfc_lookup_function_fuzzy (const char *, gfc_symtree *);
-int gfc_pure_function (gfc_expr *e, const char **name);
-int gfc_implicit_pure_function (gfc_expr *e);
+bool gfc_pure_function (gfc_expr *e, const char **name);
+bool gfc_implicit_pure_function (gfc_expr *e);
/* array.cc */
gfc_array_spec *gfc_copy_array_spec (gfc_array_spec *);
bool gfc_resolve_array_spec (gfc_array_spec *, int);
-int gfc_compare_array_spec (gfc_array_spec *, gfc_array_spec *);
+bool gfc_compare_array_spec (gfc_array_spec *, gfc_array_spec *);
void gfc_simplify_iterator_var (gfc_expr *);
bool gfc_expand_constructor (gfc_expr *, bool);
-int gfc_constant_ac (gfc_expr *);
-int gfc_expanded_ac (gfc_expr *);
+bool gfc_constant_ac (gfc_expr *);
+bool gfc_expanded_ac (gfc_expr *);
bool gfc_resolve_character_array_constructor (gfc_expr *);
bool gfc_resolve_array_constructor (gfc_expr *);
bool gfc_check_constructor_type (gfc_expr *);
symbol_attribute gfc_caf_attr (gfc_expr *, bool i = false, bool *r = NULL);
match gfc_match_rvalue (gfc_expr **);
match gfc_match_varspec (gfc_expr*, int, bool, bool);
-int gfc_check_digit (char, int);
+bool gfc_check_digit (char, int);
bool gfc_is_function_return_value (gfc_symbol *, gfc_namespace *);
bool gfc_convert_to_structure_constructor (gfc_expr *, gfc_symbol *,
gfc_expr **,
/* Given a string, figure out if it is the name of a generic intrinsic
function or not. */
-int
+bool
gfc_generic_intrinsic (const char *name)
{
gfc_intrinsic_sym *sym;
/* Given a string, figure out if it is the name of a specific
intrinsic function or not. */
-int
+bool
gfc_specific_intrinsic (const char *name)
{
gfc_intrinsic_sym *sym;
/* Given a string, figure out if it is the name of an intrinsic function
or subroutine allowed as an actual argument or not. */
-int
+bool
gfc_intrinsic_actual_ok (const char *name, const bool subroutine_flag)
{
gfc_intrinsic_sym *sym;
free (open);
}
-
-static int
-compare_to_allowed_values (const char *specifier, const char *allowed[],
- const char *allowed_f2003[],
- const char *allowed_gnu[], gfc_char_t *value,
- const char *statement, bool warn, locus *where,
- int *num = NULL);
-
-
static bool
check_open_constraints (gfc_open *open, locus *where);
value if it is not allowed. */
-static int
+static bool
compare_to_allowed_values (const char *specifier, const char *allowed[],
const char *allowed_f2003[],
const char *allowed_gnu[], gfc_char_t *value,
const char *statement, bool warn, locus *where,
- int *num)
+ int *num = NULL)
{
int i;
unsigned int len;
context that causes it to become redefined. If the symbol is an
iterator, we generate an error message and return nonzero. */
-int
+bool
gfc_check_do_variable (gfc_symtree *st)
{
gfc_state_data *s;
#define gfc_comp_struct(s) \
((s) == COMP_DERIVED || (s) == COMP_STRUCTURE || (s) == COMP_MAP)
-int gfc_check_do_variable (gfc_symtree *);
+bool gfc_check_do_variable (gfc_symtree *);
bool gfc_find_state (gfc_compile_state);
gfc_state_data *gfc_enclosing_unit (gfc_compile_state *);
const char *gfc_ascii_statement (gfc_statement, bool strip_sentinel = false) ;
/* Given a character and a radix, see if the character is a valid
digit in that radix. */
-int
+bool
gfc_check_digit (char c, int radix)
{
- int r;
+ bool r;
switch (radix)
{
/* Returns 0 if a symbol was not declared with a type or
attribute declaration statement, nonzero otherwise. */
-static int
+static bool
was_declared (gfc_symbol *sym)
{
symbol_attribute a;
/* Figure out if a function reference is pure or not. Also set the name
of the function for a potential error message. Return nonzero if the
function is PURE, zero if not. */
-static int
+static bool
pure_stmt_function (gfc_expr *, gfc_symbol *);
-int
+bool
gfc_pure_function (gfc_expr *e, const char **name)
{
- int pure;
+ bool pure;
gfc_component *comp;
*name = NULL;
/* Check if the expression is a reference to an implicitly pure function. */
-int
+bool
gfc_implicit_pure_function (gfc_expr *e)
{
gfc_component *comp = gfc_get_proc_ptr_comp (e);
}
-static int
+static bool
pure_stmt_function (gfc_expr *e, gfc_symbol *sym)
{
return gfc_traverse_expr (e, sym, impure_stmt_fcn, 0) ? 0 : 1;
PRIVATE. The search is recursive if necessary. Returns zero if no
inaccessible components are found, nonzero otherwise. */
-static int
+static bool
derived_inaccessible (gfc_symbol *sym)
{
gfc_component *c;
/* Determines if a variable is not 'pure', i.e., not assignable within a pure
procedure. Returns zero if assignment is OK, nonzero if there is a
problem. */
-int
+bool
gfc_impure_variable (gfc_symbol *sym)
{
gfc_symbol *proc;
/* Test whether a symbol is pure or not. For a NULL pointer, checks if the
current namespace is inside a pure procedure. */
-int
+bool
gfc_pure (gfc_symbol *sym)
{
symbol_attribute attr;
checks if the current namespace is implicitly pure. Note that this
function returns false for a PURE procedure. */
-int
+bool
gfc_implicit_pure (gfc_symbol *sym)
{
gfc_namespace *ns;
/* Test whether the current procedure is elemental or not. */
-int
+bool
gfc_elemental (gfc_symbol *sym)
{
symbol_attribute attr;
static gfc_file *file_head, *current_file;
-static int continue_flag, end_flag, gcc_attribute_flag;
+static bool continue_flag, end_flag, gcc_attribute_flag;
/* If !$omp/!$acc occurred in current comment line. */
static int openmp_flag, openacc_flag;
static int continue_count, continue_line;
/* Functions dealing with our wide characters (gfc_char_t) and
sequences of such characters. */
-int
+bool
gfc_wide_fits_in_byte (gfc_char_t c)
{
return (c <= UCHAR_MAX);
return (gfc_wide_fits_in_byte (c) && ((unsigned char) c & ~0x7f) == 0);
}
-int
+bool
gfc_wide_is_printable (gfc_char_t c)
{
return (gfc_wide_fits_in_byte (c) && ISPRINT ((unsigned char) c));
return (wide_is_ascii (c) ? (gfc_char_t) TOUPPER((unsigned char) c) : c);
}
-int
+bool
gfc_wide_is_digit (gfc_char_t c)
{
return (c >= '0' && c <= '9');
/* Test to see if we're at the end of the main source file. */
-int
+bool
gfc_at_end (void)
{
return end_flag;
/* Test to see if we're at the end of the current file. */
-int
+bool
gfc_at_eof (void)
{
if (gfc_at_end ())
/* Test to see if we're at the beginning of a new line. */
-int
+bool
gfc_at_bol (void)
{
if (gfc_at_eof ())
/* Test to see if we're at the end of a line. */
-int
+bool
gfc_at_eol (void)
{
if (gfc_at_eof ())
}
-int
+bool
gfc_define_undef_line (void)
{
char *tmp;
easily report line and column numbers consistent with other
parts of gfortran. */
-static int
+static bool
load_line (FILE *input, gfc_char_t **pbuf, int *pbuflen, const int *first_char)
{
int c, maxlen, i, preprocessor_flag, buflen = *pbuflen;
/* Search for a symtree starting in the current namespace, resorting to
any parent namespaces if requested by a nonzero parent_flag.
- Returns nonzero if the name is ambiguous. */
+ Returns true if the name is ambiguous. */
-int
+bool
gfc_find_sym_tree (const char *name, gfc_namespace *ns, int parent_flag,
gfc_symtree **result)
{
if (st->ambiguous && !st->n.sym->attr.generic)
{
ambiguous_symbol (name, st);
- return 1;
+ return true;
}
- return 0;
+ return false;
}
if (!parent_flag)
}
}
*result = st;
- return 0;
+ return false;
}
*result = NULL;
- return 0;
+ return false;
}
/* Return true if both symbols could refer to the same data object. Does
not take account of aliasing due to equivalence statements. */
-static int
+static bool
symbols_could_alias (gfc_symbol *lsym, gfc_symbol *rsym, bool lsym_pointer,
bool lsym_target, bool rsym_pointer, bool rsym_target)
{
/* Returns true if a variable of specified size should go on the stack. */
-int
+bool
gfc_can_put_var_on_stack (tree size)
{
unsigned HOST_WIDE_INT low;
/* Returns true if the array sym does not require a descriptor. */
-int
+bool
gfc_is_nodesc_array (gfc_symbol * sym)
{
symbol_attribute *array_attr;
the two derived type symbols are "equal", as described
in 4.4.2 and resolved by gfc_compare_derived_types. */
-int
+bool
gfc_copy_dt_decls_ifequal (gfc_symbol *from, gfc_symbol *to,
bool from_gsym)
{
}
-int
+bool
gfc_return_by_reference (gfc_symbol * sym)
{
if (!sym->attr.function)
tree gfc_sym_type (gfc_symbol *, bool is_bind_c_arg = false);
tree gfc_get_cfi_type (int dimen, bool restricted);
tree gfc_typenode_for_spec (gfc_typespec *, int c = 0);
-int gfc_copy_dt_decls_ifequal (gfc_symbol *, gfc_symbol *, bool);
+bool gfc_copy_dt_decls_ifequal (gfc_symbol *, gfc_symbol *, bool);
tree gfc_get_function_type (gfc_symbol *, gfc_actual_arglist *args = NULL,
const char *fnspec = NULL);
void gfc_finish_type (tree);
/* Some functions have an extra parameter for the return value. */
-int gfc_return_by_reference (gfc_symbol *);
+bool gfc_return_by_reference (gfc_symbol *);
/* Returns true if the array sym does not require a descriptor. */
-int gfc_is_nodesc_array (gfc_symbol *);
+bool gfc_is_nodesc_array (gfc_symbol *);
/* Return the DTYPE for an array. */
tree gfc_get_dtype_rank_type (int, tree);
void gfc_set_decl_assembler_name (tree, tree);
/* Returns true if a variable of specified size should go on the stack. */
-int gfc_can_put_var_on_stack (tree);
+bool gfc_can_put_var_on_stack (tree);
/* Set GFC_DECL_SCALAR_* on decl from sym if needed. */
void gfc_finish_decl_attrs (tree, symbol_attribute *);