dwarf2out.c (dwarf2out_finish): Add AT_comp_dir attribute even if input file name...
authorJakub Jelinek <jakub@redhat.com>
Tue, 4 Feb 2003 13:30:02 +0000 (14:30 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 4 Feb 2003 13:30:02 +0000 (14:30 +0100)
* dwarf2out.c (dwarf2out_finish): Add AT_comp_dir
attribute even if input file name is absolute, but one of the
includes is relative.

From-SVN: r62377

gcc/ChangeLog
gcc/dwarf2out.c

index 007c4dcee10d0648dc4c420c358c1d7115e73c7e..936a7620a92eccecb7e0751226042120a70509ed 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-04  Jakub Jelinek  <jakub@redhat.com>
+
+       * dwarf2out.c (dwarf2out_finish): Add AT_comp_dir
+       attribute even if input file name is absolute, but one of the
+       includes is relative.
+
 2003-02-04  Joseph S. Myers  <jsm@polyomino.org.uk>
 
        * doc/gcc.texi, doc/gccint.texi, doc/gcov.texi,
index 64aac19c6eb807b07f0c20916b42a4cf31baec3c..7f1418de52254b3ff02d03ad580ba87208801451 100644 (file)
@@ -12663,6 +12663,16 @@ dwarf2out_finish (input_filename)
   add_name_attribute (comp_unit_die, input_filename);
   if (input_filename[0] != DIR_SEPARATOR)
     add_comp_dir_attribute (comp_unit_die);
+  else if (get_AT (comp_unit_die, DW_AT_comp_dir) == NULL)
+    {
+      size_t i;
+      for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++)
+       if (VARRAY_CHAR_PTR (file_table, i)[0] != DIR_SEPARATOR)
+         {
+           add_comp_dir_attribute (comp_unit_die);
+           break;
+         }
+    }
 
   /* Traverse the limbo die list, and add parent/child links.  The only
      dies without parents that should be here are concrete instances of