diff options
author | Per Bothner <per@bothner.com> | 2005-04-22 12:01:29 -0700 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 2005-04-22 12:01:29 -0700 |
commit | 9f12b095b1916f35ed89eaffdb5b0ac0e4074e8d (patch) | |
tree | 939b51fb7df7e567f671f08819df6dd48867553a /gcc/cp/decl.c | |
parent | 411c88a2db03f73ac8304b86bdb5ec8cadc693f0 (diff) | |
download | gcc-9f12b095b1916f35ed89eaffdb5b0ac0e4074e8d.zip gcc-9f12b095b1916f35ed89eaffdb5b0ac0e4074e8d.tar.gz gcc-9f12b095b1916f35ed89eaffdb5b0ac0e4074e8d.tar.bz2 |
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
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 2a3c30c..5d52a26 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4543,6 +4543,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) { int toplev = toplevel_bindings_p (); int defer_p; + const char *filename; /* Set the DECL_ASSEMBLER_NAME for the object. */ if (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 not emitted into the object file unnecessarily. */ + filename = input_filename; if (!DECL_VIRTUAL_P (decl) && TREE_READONLY (decl) && DECL_INITIAL (decl) != NULL_TREE && DECL_INITIAL (decl) != error_mark_node + && filename != NULL && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl)) && toplev && !TREE_PUBLIC (decl)) { /* Fool with the linkage of static consts according to #pragma 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)) { TREE_PUBLIC (decl) = 1; |