Commit 1d2c2b96 by Nathan Froyd Committed by Nathan Froyd

dwarf2out.c (gen_compile_unit_die): Use IS_ABSOLUTE_PATH.

        * dwarf2out.c (gen_compile_unit_die): Use IS_ABSOLUTE_PATH.
        (file_table_relative_p): Likewise.
        (dwarf2out_finish): Likewise.
        (file_name_acquire): Use DIR_SEPARATOR and DIR_SEPARATOR_2.

From-SVN: r118033
parent 80ba9432
2006-10-24 Nathan Froyd <froydnj@codesourcery.com>
* dwarf2out.c (gen_compile_unit_die): Use IS_ABSOLUTE_PATH.
(file_table_relative_p): Likewise.
(dwarf2out_finish): Likewise.
(file_name_acquire): Use DIR_SEPARATOR and DIR_SEPARATOR_2.
2006-10-25 Daniel Berlin <dberlin@dberlin.org> 2006-10-25 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-structalias.c (intra_create_variable_infos): * tree-ssa-structalias.c (intra_create_variable_infos):
......
...@@ -7657,7 +7657,7 @@ file_name_acquire (void ** slot, void *data) ...@@ -7657,7 +7657,7 @@ file_name_acquire (void ** slot, void *data)
/* Skip all leading "./". */ /* Skip all leading "./". */
f = d->filename; f = d->filename;
while (f[0] == '.' && f[1] == '/') while (f[0] == '.' && IS_DIR_SEPARATOR (f[1]))
f += 2; f += 2;
/* Create a new array entry. */ /* Create a new array entry. */
...@@ -7666,7 +7666,19 @@ file_name_acquire (void ** slot, void *data) ...@@ -7666,7 +7666,19 @@ file_name_acquire (void ** slot, void *data)
fi->file_idx = d; fi->file_idx = d;
/* Search for the file name part. */ /* Search for the file name part. */
f = strrchr (f, '/'); f = strrchr (f, DIR_SEPARATOR);
#if defined (DIR_SEPARATOR_2)
{
char *g = strrchr (files[i].path, DIR_SEPARATOR_2);
if (g != NULL)
{
if (f == NULL || f < g)
f = g;
}
}
#endif
fi->fname = f == NULL ? fi->path : f + 1; fi->fname = f == NULL ? fi->path : f + 1;
return 1; return 1;
} }
...@@ -12288,7 +12300,7 @@ gen_compile_unit_die (const char *filename) ...@@ -12288,7 +12300,7 @@ gen_compile_unit_die (const char *filename)
{ {
add_name_attribute (die, filename); add_name_attribute (die, filename);
/* Don't add cwd for <built-in>. */ /* Don't add cwd for <built-in>. */
if (filename[0] != DIR_SEPARATOR && filename[0] != '<') if (!IS_ABSOLUTE_PATH (filename) && filename[0] != '<')
add_comp_dir_attribute (die); add_comp_dir_attribute (die);
} }
...@@ -14188,7 +14200,7 @@ file_table_relative_p (void ** slot, void *param) ...@@ -14188,7 +14200,7 @@ file_table_relative_p (void ** slot, void *param)
{ {
bool *p = param; bool *p = param;
struct dwarf_file_data *d = *slot; struct dwarf_file_data *d = *slot;
if (d->emitted_number && d->filename[0] != DIR_SEPARATOR) if (d->emitted_number && !IS_ABSOLUTE_PATH (d->filename))
{ {
*p = true; *p = true;
return 0; return 0;
...@@ -14208,7 +14220,7 @@ dwarf2out_finish (const char *filename) ...@@ -14208,7 +14220,7 @@ dwarf2out_finish (const char *filename)
/* Add the name for the main input file now. We delayed this from /* Add the name for the main input file now. We delayed this from
dwarf2out_init to avoid complications with PCH. */ dwarf2out_init to avoid complications with PCH. */
add_name_attribute (comp_unit_die, filename); add_name_attribute (comp_unit_die, filename);
if (filename[0] != DIR_SEPARATOR) if (!IS_ABSOLUTE_PATH (filename))
add_comp_dir_attribute (comp_unit_die); add_comp_dir_attribute (comp_unit_die);
else if (get_AT (comp_unit_die, DW_AT_comp_dir) == NULL) else if (get_AT (comp_unit_die, DW_AT_comp_dir) == NULL)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment