OSDN Git Service

* dwarf2out.c (dwarf2out_vms_debug_main_pointer): New function.
authorrupp <rupp@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 25 Jun 2010 18:49:36 +0000 (18:49 +0000)
committerrupp <rupp@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 25 Jun 2010 18:49:36 +0000 (18:49 +0000)
* dwarf2out.h (dwarf2out_vms_debug_main_pointer): Declare new function.
* config/ia64/ia64-protos.h (ia64_start_function): Declare.
* config/ia64/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Move contents
to ia64_start_function. Invoke it.
* config/ia64/ia64.c (ia64_start_function): Call new function
dwarf2out_vms_debug_main_pointer.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161402 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/ia64/ia64-protos.h
gcc/config/ia64/ia64.c
gcc/config/ia64/sysv4.h
gcc/dwarf2out.c
gcc/dwarf2out.h

index 34afcc1..2ce7507 100644 (file)
@@ -1,3 +1,13 @@
+2010-06-25  Douglas B Rupp  <rupp@gnat.com>
+
+       * dwarf2out.c (dwarf2out_vms_debug_main_pointer): New function.
+       * dwarf2out.h (dwarf2out_vms_debug_main_pointer): Declare new function.
+       * config/ia64/ia64-protos.h (ia64_start_function): Declare.
+       * config/ia64/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Move contents
+       to ia64_start_function. Invoke it.
+       * config/ia64/ia64.c (ia64_start_function): Call new function
+       dwarf2out_vms_debug_main_pointer.
+
 2010-06-25  Sebastian Pop  <sebastian.pop@amd.com>
 
        * tree-if-conv.c (insert_gimplified_predicates): Do not insert
index 43d5864..cd89e7c 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions of target machine for GNU compiler for IA-64.
-   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2007
+   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2007, 2010
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -79,6 +79,7 @@ extern void ia64_vms_output_aligned_decl_common (FILE *, tree, const char *,
                                                 unsigned HOST_WIDE_INT,
                                                 unsigned int);
 extern void ia64_vms_elf_asm_named_section (const char *, unsigned int, tree);
+extern void ia64_start_function (FILE *, const char *, tree);
 #endif /* TREE_CODE */
 
 extern int ia64_register_move_cost (enum machine_mode, enum reg_class,
index 9e2aa7a..4d6dbde 100644 (file)
@@ -3423,6 +3423,29 @@ ia64_expand_prologue (void)
   finish_spill_pointers ();
 }
 
+/* Output the textual info surrounding the prologue.  */
+
+void
+ia64_start_function (FILE *file, const char *fnname,
+                    tree decl ATTRIBUTE_UNUSED)
+{
+#if VMS_DEBUGGING_INFO
+  if (vms_debug_main
+      && strncmp (vms_debug_main, fnname, strlen (vms_debug_main)) == 0)
+    {
+      targetm.asm_out.globalize_label (asm_out_file, VMS_DEBUG_MAIN_POINTER);
+      ASM_OUTPUT_DEF (asm_out_file, VMS_DEBUG_MAIN_POINTER, fnname);
+      dwarf2out_vms_debug_main_pointer ();
+      vms_debug_main = 0;
+    }
+#endif
+
+  fputs ("\t.proc ", file);
+  assemble_name (file, fnname);
+  fputc ('\n', file);
+  ASM_OUTPUT_LABEL (file, fnname);
+}
+
 /* Called after register allocation to add any instructions needed for the
    epilogue.  Using an epilogue insn is favored compared to putting all of the
    instructions in output_function_prologue(), since it allows the scheduler
index 678a81e..0d76073 100644 (file)
@@ -1,7 +1,7 @@
 /* Override definitions in elfos.h/svr4.h to be correct for IA64.
 
 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
-2007 Free Software Foundation, Inc.
+2007, 2010 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -127,12 +127,7 @@ do {                                               \
 
 #undef ASM_DECLARE_FUNCTION_NAME
 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
-do {                                                                   \
-  fputs ("\t.proc ", FILE);                                            \
-  assemble_name (FILE, NAME);                                          \
-  fputc ('\n', FILE);                                                  \
-  ASM_OUTPUT_LABEL (FILE, NAME);                                       \
-} while (0)
+  ia64_start_function(FILE,NAME,DECL)
 
 /* We redefine this to use the ia64 .endp pseudo-op.  */
 
index 5c4999d..ecfb37e 100644 (file)
@@ -17414,6 +17414,39 @@ add_name_and_src_coords_attributes (dw_die_ref die, tree decl)
 #endif
 }
 
+#ifdef VMS_DEBUGGING_INFO
+
+/* Output the debug main pointer die for VMS */
+
+void
+dwarf2out_vms_debug_main_pointer (void)
+{
+  char label[MAX_ARTIFICIAL_LABEL_BYTES];
+  dw_die_ref die;
+
+  /* Allocate the VMS debug main subprogram die.  */
+  die = ggc_alloc_cleared_die_node ();
+  die->die_tag = DW_TAG_subprogram;
+  add_name_attribute (die, VMS_DEBUG_MAIN_POINTER);
+  ASM_GENERATE_INTERNAL_LABEL (label, PROLOGUE_END_LABEL,
+                              current_function_funcdef_no);
+  add_AT_lbl_id (die, DW_AT_entry_pc, label);
+
+  /* Make it the first child of comp_unit_die.  */
+  die->die_parent = comp_unit_die;
+  if (comp_unit_die->die_child)
+    {
+      die->die_sib = comp_unit_die->die_child->die_sib;
+      comp_unit_die->die_child->die_sib = die;
+    }
+  else
+    {
+      die->die_sib = die;
+      comp_unit_die->die_child = die;
+    }
+}
+#endif
+
 /* Push a new declaration scope.  */
 
 static void
index 21d87cb..d70b26f 100644 (file)
@@ -27,6 +27,9 @@ extern void debug_dwarf (void);
 struct die_struct;
 extern void debug_dwarf_die (struct die_struct *);
 extern void dwarf2out_set_demangle_name_func (const char *(*) (const char *));
+#ifdef VMS_DEBUGGING_INFO
+extern void dwarf2out_vms_debug_main_pointer (void);
+#endif
 
 struct array_descr_info
 {