aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl2.c4
-rw-r--r--gcc/doc/tm.texi9
-rw-r--r--gcc/target-def.h7
-rw-r--r--gcc/target.h3
6 files changed, 37 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 91d96cc..02e8412 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2e89bcc..c8f9358 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index f3ecc3e..191888e 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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);
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 5f32581..a5455b0 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -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
diff --git a/gcc/target-def.h b/gcc/target-def.h
index fbc84b6..9058794 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -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. */
diff --git a/gcc/target.h b/gcc/target.h
index 300ef57..fd58fec 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -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. */