Commit 9f12b095 by Per Bothner Committed by Per Bothner

decl.c (make_rtl_for_nonlocal_decl): Don't try get_fileinfo if input_filename is NULL...


	* decl.c (make_rtl_for_nonlocal_decl): Don't try get_fileinfo if
        input_filename is NULL, as it is for (say) __PRETTY_FUNCTION__.

From-SVN: r98582
parent 411c88a2
2005-04-22 Per Bothner <per@bothner.com>
* decl.c (make_rtl_for_nonlocal_decl): Don't try get_fileinfo if
input_filename is NULL, as it is for (say) __PRETTY_FUNCTION__.
2005-04-22 Alexandre Oliva <aoliva@redhat.com> 2005-04-22 Alexandre Oliva <aoliva@redhat.com>
PR c++/21087 PR c++/21087
......
...@@ -4543,6 +4543,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) ...@@ -4543,6 +4543,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
{ {
int toplev = toplevel_bindings_p (); int toplev = toplevel_bindings_p ();
int defer_p; int defer_p;
const char *filename;
/* Set the DECL_ASSEMBLER_NAME for the object. */ /* Set the DECL_ASSEMBLER_NAME for the object. */
if (asmspec) if (asmspec)
...@@ -4592,17 +4593,19 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) ...@@ -4592,17 +4593,19 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
/* We try to defer namespace-scope static constants so that they are /* We try to defer namespace-scope static constants so that they are
not emitted into the object file unnecessarily. */ not emitted into the object file unnecessarily. */
filename = input_filename;
if (!DECL_VIRTUAL_P (decl) if (!DECL_VIRTUAL_P (decl)
&& TREE_READONLY (decl) && TREE_READONLY (decl)
&& DECL_INITIAL (decl) != NULL_TREE && DECL_INITIAL (decl) != NULL_TREE
&& DECL_INITIAL (decl) != error_mark_node && DECL_INITIAL (decl) != error_mark_node
&& filename != NULL
&& ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl)) && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl))
&& toplev && toplev
&& !TREE_PUBLIC (decl)) && !TREE_PUBLIC (decl))
{ {
/* Fool with the linkage of static consts according to #pragma /* Fool with the linkage of static consts according to #pragma
interface. */ interface. */
struct c_fileinfo *finfo = get_fileinfo (lbasename (input_filename)); struct c_fileinfo *finfo = get_fileinfo (lbasename (filename));
if (!finfo->interface_unknown && !TREE_PUBLIC (decl)) if (!finfo->interface_unknown && !TREE_PUBLIC (decl))
{ {
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
......
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