> > On 08/12/2013 08:16 AM, Jan Hubicka wrote: > > >With multiple inheritance I need to adjust offsets. > > > > It's not clear to me that you need to worry about that in your > > search. A call through a particular vptr can only call overrides > > that go into a vtable that vptr can point to, and you can look up > > any thunk adjustments from the vtable. > > What I think I need to worry about is the case, where I have > type A with a virtual method FOO. I have call of FOO. > Now I have type B that inherits A with non-zero offset and overwrites > method FOO to FOO2. > > Now call to FOO can be either FOO or FOO2, since someone can make > object of type B and cast it back to A. > How can look it up in B's representation? > > > > >+ /* First skip wrappers that C++ FE puts randomly into types. */ > > >+ while (TREE_CODE (t) == TYPE_DECL > > >+ && DECL_ORIGINAL_TYPE (t)) > > > > How can you get a decl in your types array? > > Hmm, I am not sure if I can ;) I just copied the ODR code from tree.c.
OK, I don't visit TYPE_DECLs, at least for Mozilla's javascript shell. I will remove the code and keep sanity check. Perhaps it can be dropped from tree.c' ODR handling too, then. > > One thing I noticed is that I get multiple instances of same type in my > hash in LTO. It seems to be because TYPE_CANONICAL differs. I wonder > what of LTO type merging of TYPE_CANONICAl can mismatch with C++ style > ODR. And this was a stupid bug. Always initialize your initial hash value when you hash everything incrementally ;)) Honza > > Honza > > > > Jason