* java-tree.h (TYPE_STRICTFP): New macro.
(struct lang_type) [strictfp]: New field.
(CLASS_STRICTFP): New macro.
(METHOD_STRICTFP): New macro.
(struct lang_decl) [strictfp]: New field.
* parse.y (method_header): Disallow strictfp constructor or
abstract method.
(STRICT_TK): Move before MODIFIER_TK.
* parse.h (CLASS_MODIFIERS): Added ACC_STRICT.
(METHOD_MODIFIERS): Likewise.
(INTERFACE_MODIFIERS): Likewise.
* jcf-write.c (get_access_flags): Likewise.
* class.c (set_class_decl_access_flags): Recognize ACC_STRICT.
(add_method_1): Likewise.
(get_access_flags_from_decl): Likewise.
* jcf-dump.c (print_access_flags): Print in standard order. Also,
recognize strictfp flag.
* jcf.h (ACC_STRICT): New define.
From-SVN: r49834
+2002-02-17 Tom Tromey <tromey@redhat.com>
+
+ * java-tree.h (TYPE_STRICTFP): New macro.
+ (struct lang_type) [strictfp]: New field.
+ (CLASS_STRICTFP): New macro.
+ (METHOD_STRICTFP): New macro.
+ (struct lang_decl) [strictfp]: New field.
+ * parse.y (method_header): Disallow strictfp constructor or
+ abstract method.
+ (STRICT_TK): Move before MODIFIER_TK.
+ * parse.h (CLASS_MODIFIERS): Added ACC_STRICT.
+ (METHOD_MODIFIERS): Likewise.
+ (INTERFACE_MODIFIERS): Likewise.
+ * jcf-write.c (get_access_flags): Likewise.
+ * class.c (set_class_decl_access_flags): Recognize ACC_STRICT.
+ (add_method_1): Likewise.
+ (get_access_flags_from_decl): Likewise.
+ * jcf-dump.c (print_access_flags): Print in standard order. Also,
+ recognize strictfp flag.
+ * jcf.h (ACC_STRICT): New define.
+
2002-02-12 David Billinghurst <Davod.Billinghurst@riotinto.com>
* class.c(build_utf8_ref): Move declaration of decl_size
if (access_flags & ACC_STATIC) CLASS_STATIC (class_decl) = 1;
if (access_flags & ACC_PRIVATE) CLASS_PRIVATE (class_decl) = 1;
if (access_flags & ACC_PROTECTED) CLASS_PROTECTED (class_decl) = 1;
+ if (access_flags & ACC_STRICT) CLASS_STRICTFP (class_decl) = 1;
}
/* Return length of inheritance chain of CLAS, where java.lang.Object is 0,
if (access_flags & ACC_SYNCHRONIZED) METHOD_SYNCHRONIZED (fndecl) = 1;
if (access_flags & ACC_ABSTRACT) METHOD_ABSTRACT (fndecl) = 1;
if (access_flags & ACC_TRANSIENT) METHOD_TRANSIENT (fndecl) = 1;
+ if (access_flags & ACC_STRICT) METHOD_STRICTFP (fndecl) = 1;
return fndecl;
}
access_flags |= ACC_PRIVATE;
if (CLASS_PROTECTED (decl))
access_flags |= ACC_PROTECTED;
+ if (CLASS_STRICTFP (decl))
+ access_flags |= ACC_STRICT;
return access_flags;
}
if (TREE_CODE (decl) == FUNCTION_DECL)
access_flags |= ACC_ABSTRACT;
if (METHOD_TRANSIENT (decl))
access_flags |= ACC_TRANSIENT;
+ if (METHOD_STRICTFP (decl))
+ access_flags |= ACC_STRICT;
return access_flags;
}
abort ();
unsigned int init_final : 1; /* Nonzero all finals are initialized */
unsigned int fixed_ctor : 1;
unsigned int init_calls_this : 1;
+ unsigned int strictfp : 1;
};
/* init_test_table hash table entry structure. */
#define TYPE_IMPORT_DEMAND_LIST(T) (TYPE_LANG_SPECIFIC(T)->import_demand_list)
#define TYPE_PRIVATE_INNER_CLASS(T) (TYPE_LANG_SPECIFIC(T)->pic)
#define TYPE_PROTECTED_INNER_CLASS(T) (TYPE_LANG_SPECIFIC(T)->poic)
+#define TYPE_STRICTFP(T) (TYPE_LANG_SPECIFIC(T)->strictfp)
struct lang_type
{
tree import_demand_list; /* Imported types, in the CU of this class */
unsigned pic:1; /* Private Inner Class. */
unsigned poic:1; /* Protected Inner Class. */
+ unsigned strictfp:1; /* `strictfp' class. */
};
#ifdef JAVA_USE_HANDLES
#define METHOD_NATIVE(DECL) (DECL_LANG_SPECIFIC(DECL)->native)
#define METHOD_ABSTRACT(DECL) DECL_LANG_FLAG_5 (DECL)
#define METHOD_TRANSIENT(DECL) DECL_LANG_FLAG_6 (DECL)
+#define METHOD_STRICTFP(DECL) (DECL_LANG_SPECIFIC (DECL)->strictfp)
#define JAVA_FILE_P(NODE) TREE_LANG_FLAG_2 (NODE)
#define CLASS_FILE_P(NODE) TREE_LANG_FLAG_3 (NODE)
#define CLASS_STATIC(DECL) DECL_LANG_FLAG_7 (DECL)
#define CLASS_PRIVATE(DECL) (TYPE_PRIVATE_INNER_CLASS (TREE_TYPE (DECL)))
#define CLASS_PROTECTED(DECL) (TYPE_PROTECTED_INNER_CLASS (TREE_TYPE (DECL)))
+#define CLASS_STRICTFP(DECL) (TYPE_STRICTFP (TREE_TYPE (DECL)))
/* @deprecated marker flag on methods, fields and classes */
if (flags & ACC_PUBLIC) fprintf (stream, " public");
if (flags & ACC_PRIVATE) fprintf (stream, " private");
if (flags & ACC_PROTECTED) fprintf (stream, " protected");
+ if (flags & ACC_ABSTRACT) fprintf (stream, " abstract");
if (flags & ACC_STATIC) fprintf (stream, " static");
if (flags & ACC_FINAL) fprintf (stream, " final");
+ if (flags & ACC_TRANSIENT) fprintf (stream, " transient");
+ if (flags & ACC_VOLATILE) fprintf (stream, " volatile");
+ if (flags & ACC_NATIVE) fprintf (stream, " native");
if (flags & ACC_SYNCHRONIZED)
{
if (context == 'c')
else
fprintf (stream, " synchronized");
}
- if (flags & ACC_VOLATILE) fprintf (stream, " volatile");
- if (flags & ACC_TRANSIENT) fprintf (stream, " transient");
- if (flags & ACC_NATIVE) fprintf (stream, " native");
if (flags & ACC_INTERFACE) fprintf (stream, " interface");
- if (flags & ACC_ABSTRACT) fprintf (stream, " abstract");
+ if (flags & ACC_STRICT) fprintf (stream, " strictfp");
}
/* Write out a Java(TM) class file.
- Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
if (ANONYMOUS_CLASS_P (TREE_TYPE (decl))
|| LOCAL_CLASS_P (TREE_TYPE (decl)))
flags |= ACC_PRIVATE;
+ if (CLASS_STRICTFP (decl))
+ flags |= ACC_STRICT;
}
else
abort ();
flags |= ACC_SYNCHRONIZED;
if (METHOD_ABSTRACT (decl))
flags |= ACC_ABSTRACT;
+ if (METHOD_STRICTFP (decl))
+ flags |= ACC_STRICT;
}
if (isfield)
{
/* Utility macros to read Java(TM) .class files and byte codes.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#define ACC_NATIVE 0x0100
#define ACC_INTERFACE 0x0200
#define ACC_ABSTRACT 0x0400
+#define ACC_STRICT 0x0800
#define ACC_VISIBILITY (ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED)
/* Language parser definitions for the GNU compiler for the Java(TM) language.
- Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
This file is part of GNU CC.
#define YYNOT_TWICE if (ctxp->prevent_ese != lineno)
/* Accepted modifiers */
-#define CLASS_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT|ACC_FINAL
+#define CLASS_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT|ACC_FINAL|ACC_STRICT
#define FIELD_MODIFIERS ACC_PUBLIC|ACC_PROTECTED|ACC_PRIVATE|ACC_FINAL| \
ACC_STATIC|ACC_TRANSIENT|ACC_VOLATILE
#define METHOD_MODIFIERS ACC_PUBLIC|ACC_PROTECTED|ACC_PRIVATE|ACC_ABSTRACT| \
- ACC_STATIC|ACC_FINAL|ACC_SYNCHRONIZED|ACC_NATIVE
-#define INTERFACE_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT
+ ACC_STATIC|ACC_FINAL|ACC_SYNCHRONIZED|ACC_NATIVE| \
+ ACC_STRICT
+#define INTERFACE_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT|ACC_STRICT
#define INTERFACE_INNER_MODIFIERS ACC_PUBLIC|ACC_PROTECTED|ACC_ABSTRACT|ACC_STATIC
#define INTERFACE_METHOD_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT
#define INTERFACE_FIELD_MODIFIERS ACC_PUBLIC|ACC_STATIC|ACC_FINAL
%token PUBLIC_TK PRIVATE_TK PROTECTED_TK
%token STATIC_TK FINAL_TK SYNCHRONIZED_TK
%token VOLATILE_TK TRANSIENT_TK NATIVE_TK
-%token PAD_TK ABSTRACT_TK MODIFIER_TK
-%token STRICT_TK
+%token PAD_TK ABSTRACT_TK STRICT_TK
+%token MODIFIER_TK
/* Keep those two in order, too */
%token DECR_TK INCR_TK
ABSTRACT_CHECK (flags, ACC_STATIC, id, "Static");
ABSTRACT_CHECK (flags, ACC_FINAL, id, "Final");
ABSTRACT_CHECK (flags, ACC_NATIVE, id, "Native");
- ABSTRACT_CHECK (flags, ACC_SYNCHRONIZED,id, "Synchronized");
+ ABSTRACT_CHECK (flags, ACC_SYNCHRONIZED, id, "Synchronized");
+ ABSTRACT_CHECK (flags, ACC_STRICT, id, "Strictfp");
if (!CLASS_ABSTRACT (TYPE_NAME (this_class))
&& !CLASS_INTERFACE (TYPE_NAME (this_class)))
parse_error_context
JCONSTRUCTOR_CHECK (flags, ACC_FINAL, id, "final");
JCONSTRUCTOR_CHECK (flags, ACC_NATIVE, id, "native");
JCONSTRUCTOR_CHECK (flags, ACC_SYNCHRONIZED, id, "synchronized");
+ JCONSTRUCTOR_CHECK (flags, ACC_STRICT, id, "strictfp");
}
/* If we found error here, we don't consider it's OK to tread
the method definition as a constructor, for the rest of this