Commit c533e34d by Zak Kipling Committed by Jason Merrill

re PR c++/26195 (pragma interface no longer handles explicit names)

        PR c++/26195
        * decl.c (make_rtl_for_nonlocal_decl),
        (start_preparsed_function): Don't use lbasename on
        input_filename when calling get_fileinfo.
        * semantics.c (begin_class_definition): Likewise.
        * lex.c (cxx_make_type): Likewise.
        (handle_pragma_interface): Call get_fileinfo on input_filename,
        not on the parameter to the directive.

From-SVN: r116740
parent b5b84a7f
2006-09-06 Zak Kipling <zak@transversal.com>
PR c++/26195
* decl.c (make_rtl_for_nonlocal_decl),
(start_preparsed_function): Don't use lbasename on
input_filename when calling get_fileinfo.
* semantics.c (begin_class_definition): Likewise.
* lex.c (cxx_make_type): Likewise.
(handle_pragma_interface): Call get_fileinfo on input_filename,
not on the parameter to the directive.
2006-09-06 Mark Mitchell <mark@codesourcery.com> 2006-09-06 Mark Mitchell <mark@codesourcery.com>
PR c++/28903 PR c++/28903
......
...@@ -4908,7 +4908,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) ...@@ -4908,7 +4908,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
{ {
/* 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 (filename)); struct c_fileinfo *finfo = get_fileinfo (filename);
if (!finfo->interface_unknown && !TREE_PUBLIC (decl)) if (!finfo->interface_unknown && !TREE_PUBLIC (decl))
{ {
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
...@@ -10357,7 +10357,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -10357,7 +10357,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
struct cp_binding_level *bl; struct cp_binding_level *bl;
tree current_function_parms; tree current_function_parms;
struct c_fileinfo *finfo struct c_fileinfo *finfo
= get_fileinfo (lbasename (LOCATION_FILE (DECL_SOURCE_LOCATION (decl1)))); = get_fileinfo (LOCATION_FILE (DECL_SOURCE_LOCATION (decl1)));
bool honor_interface; bool honor_interface;
/* Sanity check. */ /* Sanity check. */
......
...@@ -503,7 +503,7 @@ handle_pragma_interface (cpp_reader* dfile ATTRIBUTE_UNUSED ) ...@@ -503,7 +503,7 @@ handle_pragma_interface (cpp_reader* dfile ATTRIBUTE_UNUSED )
else else
filename = ggc_strdup (TREE_STRING_POINTER (fname)); filename = ggc_strdup (TREE_STRING_POINTER (fname));
finfo = get_fileinfo (filename); finfo = get_fileinfo (input_filename);
if (impl_file_chain == 0) if (impl_file_chain == 0)
{ {
...@@ -809,7 +809,7 @@ cxx_make_type (enum tree_code code) ...@@ -809,7 +809,7 @@ cxx_make_type (enum tree_code code)
/* Set up some flags that give proper default behavior. */ /* Set up some flags that give proper default behavior. */
if (IS_AGGR_TYPE_CODE (code)) if (IS_AGGR_TYPE_CODE (code))
{ {
struct c_fileinfo *finfo = get_fileinfo (lbasename (input_filename)); struct c_fileinfo *finfo = get_fileinfo (input_filename);
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, finfo->interface_unknown); SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, finfo->interface_unknown);
CLASSTYPE_INTERFACE_ONLY (t) = finfo->interface_only; CLASSTYPE_INTERFACE_ONLY (t) = finfo->interface_only;
} }
......
...@@ -2174,7 +2174,7 @@ begin_class_definition (tree t, tree attributes) ...@@ -2174,7 +2174,7 @@ begin_class_definition (tree t, tree attributes)
before. */ before. */
if (! TYPE_ANONYMOUS_P (t)) if (! TYPE_ANONYMOUS_P (t))
{ {
struct c_fileinfo *finfo = get_fileinfo (lbasename (input_filename)); struct c_fileinfo *finfo = get_fileinfo (input_filename);
CLASSTYPE_INTERFACE_ONLY (t) = finfo->interface_only; CLASSTYPE_INTERFACE_ONLY (t) = finfo->interface_only;
SET_CLASSTYPE_INTERFACE_UNKNOWN_X SET_CLASSTYPE_INTERFACE_UNKNOWN_X
(t, finfo->interface_unknown); (t, finfo->interface_unknown);
......
// PR c++/26195
// { dg-do link }
// { dg-additional-sources "interface2b.cc" }
// { dg-options "-fno-inline" }
#pragma implementation "interface2-imaginary.h"
#include "interface2a.h"
// PR c++/26195
#pragma interface "interface2-imaginary.h"
inline void foo1() { }
inline void foo2() { }
// PR c++/26195
extern void foo1();
extern void foo2();
int main()
{
foo1();
foo2();
}
// PR c++/26195
#pragma interface "dir1/interface3.h"
#include "../dir2/interface3.h"
inline void f1() { }
inline void f2() { }
// PR c++/26195
#pragma interface "dir2/interface3.h"
inline void g1() { }
inline void g2() { }
// PR c++/26195
// { dg-do link }
// { dg-additional-sources "interface3a2.cc" }
// { dg-options "-I. -fno-inline" }
#pragma implementation "dir1/interface3.cc"
#include "dir1/interface3.h"
// PR c++/26195
extern void f1();
extern void f2();
int main()
{
f1();
f2();
}
// PR c++/26195
// { dg-do link }
// { dg-additional-sources "interface3b2.cc" }
// { dg-options "-fno-inline" }
#pragma implementation "dir2/interface3.cc"
#include "dir1/interface3.h"
// PR c++/26195
extern void g1();
extern void g2();
int main()
{
g1();
g2();
}
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