On 06/17/2013 09:35 AM, Jan Hubicka wrote:
To get meaningful warnings, we need to know what decls/types are subject
to ODR. Do you think you can make C++ FE to drop a flag so middle-end know?
We can LTO ODR and non-ODR languages together.
Basically everything in C++ is subject to the ODR. There are two cases:
either there can be only one definition anywhere (e.g. normal variables
and functions, anything local to such a function) or all definitions
need to be identical.
In C, you can treat all structurally identical types as the same, right?
The common subset of those would be treating everything with the same
structure and the same name/context as identical.
Hmm, it occurs to me that you should check that your patch does the
right thing with anonymous namespaces: a class in an anonymous namespace
is not the same as a class with the same name in an anonymous namespace
in another translation unit. The C++ front end clears TREE_PUBLIC on
the TYPE_STUB_DECL (TYPE_MAIN_VARIANT of such types to indicate that
they are local to that TU.
Hmm, firefox combine C and C++ units, but I do not see how C and C++
type can get into the devirutalization machinery. I will debug this.
I suppose TYPE_NAME can be considered identical to correspodning
IDENTIFIER_NODE, tought?
Yes.
Jason