class.c (push_lang_context): Turn off DECL_IGNORED_P for primitive Java types, if...
authorPer Bothner <bothner@gcc.gnu.org>
Thu, 13 May 1999 15:42:53 +0000 (08:42 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Thu, 13 May 1999 15:42:53 +0000 (08:42 -0700)
h
* class.c (push_lang_context):  Turn off DECL_IGNORED_P for
primitive Java types, if we actually see `extern "C"'.

From-SVN: r26927

gcc/cp/class.c
gcc/cp/decl.c

index b546f577716dc581207e51030daef0bd29a55fce..1466e94977172d6d98c896f4a101310b78460e22 100644 (file)
@@ -4618,11 +4618,28 @@ push_lang_context (name)
       current_lang_stacksize += 10;
     }
 
-  if (name == lang_name_cplusplus || name == lang_name_java)
+  if (name == lang_name_cplusplus)
     {
       strict_prototype = strict_prototypes_lang_cplusplus;
       current_lang_name = name;
     }
+  else if (name == lang_name_java)
+    {
+      strict_prototype = strict_prototypes_lang_cplusplus;
+      current_lang_name = name;
+      /* DECL_IGNORED_P is initially set for these types, to avoid clutter.
+        (See record_builtin_java_type in decl.c.)  However, that causes
+        incorrect debug entries if these types are actually used.
+        So we re-enable debug output after extern "Java". */
+      DECL_IGNORED_P (java_byte_type_node) = 0;
+      DECL_IGNORED_P (java_short_type_node) = 0;
+      DECL_IGNORED_P (java_int_type_node) = 0;
+      DECL_IGNORED_P (java_long_type_node) = 0;
+      DECL_IGNORED_P (java_float_type_node) = 0;
+      DECL_IGNORED_P (java_double_type_node) = 0;
+      DECL_IGNORED_P (java_char_type_node) = 0;
+      DECL_IGNORED_P (java_boolean_type_node) = 0;
+    }
   else if (name == lang_name_c)
     {
       strict_prototype = strict_prototypes_lang_c;
index 921fd8322eeac63f2e5f02f2bc27e3d962c1f087..74d734383b4db0027e0887dbd3a5131377fc9cf4 100644 (file)
@@ -6136,7 +6136,12 @@ record_builtin_java_type (name, size)
     }
   record_builtin_type (RID_MAX, name, type);
   decl = TYPE_NAME (type);
+
+  /* Suppress generate debug symbol entries for these types,
+     since for normal C++ they are just clutter.
+     However, push_lang_context undoes this if extern "Java" is seen. */
   DECL_IGNORED_P (decl) = 1;
+
   TYPE_FOR_JAVA (type) = 1;
   return type;
 }