On 05/10/2015 11:33 AM, Jan Hubicka wrote:
What I'm struggling with here is how do you know the stub decl is public? I realize these things are a bit special, but I don't see the C++ front-end doing anything similar. What am I missing?Hi, TREE_PUBLIC of TYPE_DECL is defined to say if the type is public: /* In a VAR_DECL, FUNCTION_DECL, NAMESPACE_DECL or TYPE_DECL, nonzero means name is to be accessible from outside this translation unit. In an IDENTIFIER_NODE, nonzero means an external declaration accessible from outside this translation unit was previously seen for this name in an inner scope. */ #define TREE_PUBLIC(NODE) ((NODE)->base.public_flag)This is properly honored by C++ FE but other FEs are bit random, which in turn confuses type_in_anonymous_namespace_p predicate that leads to flase poistives on type mismatch warnings. I used to be able to get around by checking only C++ types at LTO time, but with type checking in lto-symtab I can not, because I do want to compare type compatibility cross translation units and cross languages and we have no reliable way to say what type originated as C++ and what did not. This fixed TYPE_STUB_DECl construction in C frontend. I will check other FEs separately. I can also add way to recognize C++ types, but I think it is good idea to make type representation consistent across FEs. Bootstrapped/regtested x86_64-linux, OK? Honza * c-decl.c (pushtag): Declare type as public.
jeff
