target.h (struct gcc_target): Add new field to struct cxx: import_export_class.

* target.h (struct gcc_target): Add new field to struct cxx: import_export_class.
* target-def.h (TARGET_CXX): Initialise the new field.
  (TARGET_CXX_IMPORT_EXPORT_CLASS): Provide a default value for the new field.
* doc/tm.texi: Document the new target hook.
* decl2.c (import_export_class): Invoke the import_export_class field in the
  gcc_target structure if it is not empty.

From-SVN: r83964
This commit is contained in:
Nick Clifton 2004-07-01 08:47:16 +00:00 committed by Nick Clifton
parent ed63f99a3c
commit d59c7b4bdc
6 changed files with 37 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2004-07-01 Nick Clifton <nickc@redhat.com>
* target.h (struct gcc_target): Add new field to struct cxx:
import_export_class.
* target-def.h (TARGET_CXX): Initialise the new field.
(TARGET_CXX_IMPORT_EXPORT_CLASS): Provide a default value for
the new field.
* doc/tm.texi: Document the new target hook.
2004-07-01 Paolo Bonzini <bonzini@gnu.org>
* builtins.c (fold_builtin_classify): Fix typo.

View File

@ -1,3 +1,9 @@
2004-07-01 Nick Clifton <nickc@redhat.com>
* decl2.c (import_export_class): Invoke the
import_export_class field in the gcc_target structure if it is not
empty.
2004-06-30 Richard Henderson (rth@redhat.com>
* decl.c (start_preparsed_function): Don't set immediate_size_expand.

View File

@ -1510,6 +1510,10 @@ import_export_class (tree ctype)
import_export = 0;
#endif
/* Allow backends the chance to overrule the decision. */
if (targetm.cxx.import_export_class)
import_export = targetm.cxx.import_export_class (ctype, import_export);
if (import_export)
{
SET_CLASSTYPE_INTERFACE_KNOWN (ctype);

View File

@ -8495,6 +8495,15 @@ This hook should return @code{true} if the element size should be stored in
array cookies. The default is to return @code{false}.
@end deftypefn
@deftypefn {Target Hook} int TARGET_CXX_IMPORT_EXPORT_CLASS (tree @var{type}, int @var{import_export})
If defined by a backend this hook allows the decision made to export
class @var{type} to be overruled. Upon entry @var{import_export}
will contain 1 if the class is going to be exported, -1 if it is going
to be imported and 0 otherwise. This function should return the
modified value and perform any other actions necessary to support the
backend's targeted operating system.
@end deftypefn
@node Misc
@section Miscellaneous Parameters
@cindex parameters, miscellaneous

View File

@ -410,12 +410,17 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_CXX_COOKIE_HAS_SIZE hook_bool_void_false
#endif
#ifndef TARGET_CXX_IMPORT_EXPORT_CLASS
#define TARGET_CXX_IMPORT_EXPORT_CLASS NULL
#endif
#define TARGET_CXX \
{ \
TARGET_CXX_GUARD_TYPE, \
TARGET_CXX_GUARD_MASK_BIT, \
TARGET_CXX_GET_COOKIE_SIZE, \
TARGET_CXX_COOKIE_HAS_SIZE \
TARGET_CXX_COOKIE_HAS_SIZE, \
TARGET_CXX_IMPORT_EXPORT_CLASS \
}
/* The whole shebang. */

View File

@ -487,6 +487,9 @@ struct gcc_target
/* Returns true if the element size should be stored in the
array cookie. */
bool (*cookie_has_size) (void);
/* Allows backends to perform additional processing when
deciding if a class should be exported or imported. */
int (*import_export_class) (tree, int);
} cxx;
/* Leave the boolean fields at the end. */