summaryrefslogtreecommitdiff
path: root/gcc/fortran/arith.c
diff options
context:
space:
mode:
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-12 21:14:42 +0000
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-12 21:14:42 +0000
commitfe1328da42d69dc04d95784b2b8d4c922382c67c (patch)
treeb5c34c448cef8a8161bd6d57e5fbde7d823aa8a6 /gcc/fortran/arith.c
parent13e80622068673bdce93bd9048e026e1f20e3317 (diff)
downloadgcc-fe1328da42d69dc04d95784b2b8d4c922382c67c.tar.gz
2009-06-12 Steven G. Kargl <kargls@comcast.net>
* arith.c (gfc_enum_initializer): Move function ... * decl.c: ... here. Remove gfc_ prefix and make static. (enumerator_decl): Update function call. * gfortran.h: Remove gfc_enum_initializer prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148441 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r--gcc/fortran/arith.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 070e2bfca73..9aaf1bc03a9 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -2627,48 +2627,3 @@ gfc_hollerith2logical (gfc_expr *src, int kind)
return result;
}
-
-
-/* Returns an initializer whose value is one higher than the value of the
- LAST_INITIALIZER argument. If the argument is NULL, the
- initializers value will be set to zero. The initializer's kind
- will be set to gfc_c_int_kind.
-
- If -fshort-enums is given, the appropriate kind will be selected
- later after all enumerators have been parsed. A warning is issued
- here if an initializer exceeds gfc_c_int_kind. */
-
-gfc_expr *
-gfc_enum_initializer (gfc_expr *last_initializer, locus where)
-{
- gfc_expr *result;
-
- result = gfc_get_expr ();
- result->expr_type = EXPR_CONSTANT;
- result->ts.type = BT_INTEGER;
- result->ts.kind = gfc_c_int_kind;
- result->where = where;
-
- mpz_init (result->value.integer);
-
- if (last_initializer != NULL)
- {
- mpz_add_ui (result->value.integer, last_initializer->value.integer, 1);
- result->where = last_initializer->where;
-
- if (gfc_check_integer_range (result->value.integer,
- gfc_c_int_kind) != ARITH_OK)
- {
- gfc_error ("Enumerator exceeds the C integer type at %C");
- return NULL;
- }
- }
- else
- {
- /* Control comes here, if it's the very first enumerator and no
- initializer has been given. It will be initialized to zero. */
- mpz_set_si (result->value.integer, 0);
- }
-
- return result;
-}