# define assert(e) do { if (! (e)) abort (); } while (0)
#endif
-extern char *getpwd ();
+extern char *getpwd PROTO((void));
/* IMPORTANT NOTE: Please see the file README.DWARF for important details
regarding the GNU implementation of Dwarf. */
static inline void body_end_attribute PROTO((char *));
static inline void language_attribute PROTO((unsigned));
static inline void member_attribute PROTO((tree));
+#if 0
static inline void string_length_attribute PROTO((tree));
+#endif
static inline void comp_dir_attribute PROTO((char *));
static inline void sf_names_attribute PROTO((char *));
static inline void src_info_attribute PROTO((char *));
static unsigned lookup_filename PROTO((char *));
static void generate_srcinfo_entry PROTO((unsigned, unsigned));
static void generate_macinfo_entry PROTO((char *, char *));
+static int is_pseudo_reg PROTO((rtx));
+static tree type_main_variant PROTO((tree));
+static int is_tagged_type PROTO((tree));
+static int is_redundant_typedef PROTO((tree));
\f
/* Definitions of defaults for assembler-dependent names of various
pseudo-ops and section names.
} while (0)
#endif
+/* ASM_OUTPUT_DWARF_STRING is defined to output an ascii string, but to
+ NOT issue a trailing newline. We define ASM_OUTPUT_DWARF_STRING_NEWLINE
+ based on whether ASM_OUTPUT_DWARF_STRING is defined or not. If it is
+ defined, we call it, then issue the line feed. If not, we supply a
+ default defintion of calling ASM_OUTPUT_ASCII */
+
#ifndef ASM_OUTPUT_DWARF_STRING
-#define ASM_OUTPUT_DWARF_STRING(FILE,P) \
+#define ASM_OUTPUT_DWARF_STRING_NEWLINE(FILE,P) \
ASM_OUTPUT_ASCII ((FILE), P, strlen (P)+1)
+#else
+#define ASM_OUTPUT_DWARF_STRING_NEWLINE(FILE,P) \
+ ASM_OUTPUT_DWARF_STRING (FILE,P), ASM_OUTPUT_DWARF_STRING (FILE,"\n")
#endif
+
\f
/************************ general utility functions **************************/
-inline int
+inline static int
is_pseudo_reg (rtl)
register rtx rtl;
{
&& (REGNO (XEXP (rtl, 0)) >= FIRST_PSEUDO_REGISTER)));
}
-inline tree
+inline static tree
type_main_variant (type)
register tree type;
{
/* Return non-zero if the given type node represents a tagged type. */
-inline int
+inline static int
is_tagged_type (type)
register tree type;
{
decl_ultimate_origin (decl)
register tree decl;
{
- register tree immediate_origin = DECL_ABSTRACT_ORIGIN (decl);
-
- if (immediate_origin == NULL)
- return NULL;
- else
- {
- register tree ret_val;
- register tree lookahead = immediate_origin;
+#ifdef ENABLE_CHECKING
+ if (DECL_FROM_INLINE (DECL_ORIGIN (decl)))
+ /* Since the DECL_ABSTRACT_ORIGIN for a DECL is supposed to be the
+ most distant ancestor, this should never happen. */
+ abort ();
+#endif
- do
- {
- ret_val = lookahead;
- lookahead = DECL_ABSTRACT_ORIGIN (ret_val);
- }
- while (lookahead != NULL && lookahead != ret_val);
- return ret_val;
- }
+ return DECL_ABSTRACT_ORIGIN (decl);
}
/* Determine the "ultimate origin" of a block. The block may be an
}
if (TYPE_PRECISION (type) == DOUBLE_TYPE_SIZE)
- return FT_dbl_prec_float;
+ {
+ /* On the SH, when compiling with -m3e or -m4-single-only, both
+ float and double are 32 bits. But since the debugger doesn't
+ know about the subtarget, it always thinks double is 64 bits.
+ So we have to tell the debugger that the type is float to
+ make the output of the 'print' command etc. readable. */
+ if (DOUBLE_TYPE_SIZE == FLOAT_TYPE_SIZE && FLOAT_TYPE_SIZE == 32)
+ return FT_float;
+ return FT_dbl_prec_float;
+ }
if (TYPE_PRECISION (type) == FLOAT_TYPE_SIZE)
return FT_float;
output_enumeral_list (TREE_CHAIN (link));
ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
(unsigned) TREE_INT_CST_LOW (TREE_VALUE (link)));
- ASM_OUTPUT_DWARF_STRING (asm_out_file,
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file,
IDENTIFIER_POINTER (TREE_PURPOSE (link)));
}
}
break;
case CONST_STRING:
- ASM_OUTPUT_DWARF_STRING (asm_out_file, XSTR (rtl, 0));
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, XSTR (rtl, 0));
break;
case SYMBOL_REF:
if (name_string && *name_string)
{
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_name);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, name_string);
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, name_string);
}
}
}
}
+#if 0
static inline void
string_length_attribute (upper_bound)
register tree upper_bound;
output_bound_representation (upper_bound, 0, 'u');
ASM_OUTPUT_LABEL (asm_out_file, end_label);
}
+#endif
static inline void
comp_dir_attribute (dirname)
register char *dirname;
{
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_comp_dir);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, dirname);
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, dirname);
}
static inline void
&& (TYPE_ARG_TYPES (func_type) != NULL))
{
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_prototyped);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, "");
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
}
}
register char *producer;
{
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_producer);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, producer);
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, producer);
}
static inline void
if (DECL_INLINE (decl))
{
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_inline);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, "");
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
}
}
else
#endif
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_virtual);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, "");
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
}
}
if (TREE_VIA_VIRTUAL (binfo))
{
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_virtual);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, "");
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
}
if (TREE_VIA_PUBLIC (binfo))
{
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_public);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, "");
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
}
else if (TREE_VIA_PROTECTED (binfo))
{
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_protected);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, "");
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
}
}
/* Is this a typedef we can avoid emitting? */
-inline int
+inline static int
is_redundant_typedef (decl)
register tree decl;
{
function. */
{
- register void (*func) ();
+ register void (*func) PROTO((void *));
register tree origin = decl_ultimate_origin (decl);
if (origin != NULL && TREE_CODE (origin) == PARM_DECL)
ASM_OUTPUT_PUSH_SECTION (asm_out_file, PUBNAMES_SECTION);
sprintf (label, PUB_DIE_LABEL_FMT, next_pubname_number);
ASM_OUTPUT_DWARF_ADDR (asm_out_file, label);
- ASM_OUTPUT_DWARF_STRING (asm_out_file,
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file,
IDENTIFIER_POINTER (DECL_NAME (decl)));
ASM_OUTPUT_POP_SECTION (asm_out_file);
}
ASM_OUTPUT_PUSH_SECTION (asm_out_file, PUBNAMES_SECTION);
sprintf (label, PUB_DIE_LABEL_FMT, next_pubname_number);
ASM_OUTPUT_DWARF_ADDR (asm_out_file, label);
- ASM_OUTPUT_DWARF_STRING (asm_out_file,
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file,
IDENTIFIER_POINTER (DECL_NAME (decl)));
ASM_OUTPUT_POP_SECTION (asm_out_file);
}
output_pending_types_for_scope (NULL_TREE);
- /* The above call should have totally emptied the pending_types_list. */
-
- if (pending_types != 0)
- abort ();
+ /* The above call should have totally emptied the pending_types_list
+ if this is not a nested function or class. If this is a nested type,
+ then the remaining pending_types will be emitted when the containing type
+ is handled. */
+
+ if (! DECL_CONTEXT (decl))
+ {
+ if (pending_types != 0)
+ abort ();
+ }
ASM_OUTPUT_POP_SECTION (asm_out_file);
ASM_OUTPUT_PUSH_SECTION (asm_out_file, SFNAMES_SECTION);
sprintf (label, SFNAMES_ENTRY_LABEL_FMT, filename_table[0].number);
ASM_OUTPUT_LABEL (asm_out_file, label);
- ASM_OUTPUT_DWARF_STRING (asm_out_file,
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file,
filename_table[0].name
? filename_table[0].name
: "");
fputc ('\n', asm_out_file);
ASM_OUTPUT_PUSH_SECTION (asm_out_file, MACINFO_SECTION);
fprintf (asm_out_file, "\t%s\t%s\n", UNALIGNED_INT_ASM_OP, type_and_offset);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, string);
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, string);
ASM_OUTPUT_POP_SECTION (asm_out_file);
}
strcpy (dirname, pwd);
strcpy (dirname + len, "/");
- ASM_OUTPUT_DWARF_STRING (asm_out_file, dirname);
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, dirname);
free (dirname);
}
ASM_OUTPUT_POP_SECTION (asm_out_file);
fputc ('\n', asm_out_file);
ASM_OUTPUT_PUSH_SECTION (asm_out_file, MACINFO_SECTION);
ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, "");
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
ASM_OUTPUT_POP_SECTION (asm_out_file);
}
fputc ('\n', asm_out_file);
ASM_OUTPUT_PUSH_SECTION (asm_out_file, PUBNAMES_SECTION);
ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
- ASM_OUTPUT_DWARF_STRING (asm_out_file, "");
+ ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
ASM_OUTPUT_POP_SECTION (asm_out_file);
/* Generate the terminating entries for the .debug_aranges section.
ASM_OUTPUT_POP_SECTION (asm_out_file);
}
+
+ /* There should not be any pending types left at the end. We need
+ this now because it may not have been checked on the last call to
+ dwarfout_file_scope_decl. */
+ if (pending_types != 0)
+ abort ();
}
#endif /* DWARF_DEBUGGING_INFO */