summaryrefslogtreecommitdiffstats
path: root/gcc/cp/mangle.c
diff options
context:
space:
mode:
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-10 19:20:52 +0000
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-10 19:20:52 +0000
commit47fc235697c58f12cfe164e449d61001c7e0ade5 (patch)
tree1dae871d7397de2419ccb90ff86a10f59790e08e /gcc/cp/mangle.c
parent8a5256dc408001f522e6c6d3782a486e80aad205 (diff)
downloadppe42-gcc-47fc235697c58f12cfe164e449d61001c7e0ade5.tar.gz
ppe42-gcc-47fc235697c58f12cfe164e449d61001c7e0ade5.zip
2001-01-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
* decl2.c (acceptable_java_type): Allow references too. * init.c (build_java_class_ref): When using the new ABI, search `class$' and have it mangled with `mangle_decl.' * mangle.c (write_java_integer_type_codes): New function. (write_builtin_type): Detect and mangle Java integer and real types. (http://gcc.gnu.org/ml/gcc-patches/2001-01/msg00756.html) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38875 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r--gcc/cp/mangle.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 001a9e8f36f..b4bb686d79f 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -189,6 +189,10 @@ static inline void start_mangling PARAMS ((void));
static inline const char *finish_mangling PARAMS ((void));
static tree mangle_special_for_type PARAMS ((tree, const char *));
+/* Foreign language functions. */
+
+static void write_java_integer_type_codes PARAMS ((tree));
+
/* Append a single character to the end of the mangled
representation. */
#define write_char(CHAR) \
@@ -1446,6 +1450,8 @@ write_builtin_type (type)
integer_type_nodes. */
if (type == wchar_type_node)
write_char ('w');
+ if (TYPE_FOR_JAVA (type))
+ write_java_integer_type_codes (type);
else
{
size_t itk;
@@ -1473,9 +1479,11 @@ write_builtin_type (type)
break;
case REAL_TYPE:
- if (type == float_type_node)
+ if (type == float_type_node
+ || type == java_float_type_node)
write_char ('f');
- else if (type == double_type_node)
+ else if (type == double_type_node
+ || type == java_double_type_node)
write_char ('d');
else if (type == long_double_type_node)
write_char ('e');
@@ -2280,3 +2288,30 @@ mangle_guard_variable (variable)
write_name (variable, /*ignore_local_scope=*/0);
return get_identifier (finish_mangling ());
}
+
+
+
+/* Foreign language type mangling section. */
+
+/* How to write the type codes for the integer Java type. */
+
+static void
+write_java_integer_type_codes (type)
+ tree type;
+{
+ if (type == java_int_type_node)
+ write_char ('i');
+ else if (type == java_short_type_node)
+ write_char ('s');
+ else if (type == java_byte_type_node)
+ write_char ('c');
+ else if (type == java_char_type_node)
+ write_char ('w');
+ else if (type == java_long_type_node)
+ write_char ('x');
+ else if (type == java_boolean_type_node)
+ write_char ('b');
+ else
+ my_friendly_abort (20001207);
+}
+
OpenPOWER on IntegriCloud