Bug 22692 - Consider Java as a language that supports the ODR
While comparing libgcj.so, it turned out that we are trying to
canonicalize a DW_TAG_class_type DIE expressing a Java type.
Right now, we don't canonicalize DW_TAG_class_type yet because
languages that emit those DIEs (like C++) do respect the One
Definition Rule. So in theory, we do not need to canonicalize the
DW_TAG_class_type by using structural comparison. We only perform DIE
canonicalization of DIEs originating from the C language as that
language does not respect the ODR.
We were assuming that only C++ actually respects the ODR. In
practise, Java does also, so this patch now assumes that C++ and Java
respect the ODR. So when facing DIEs originating from those
languages, we don't try (yet) to canonicalize their DIEs.
In the future though, we need to canonicalize all DIEs, irrespective
of the language they originated from. And for that, we need to
support structural comparison of DW_TAG_class_type DIEs, among others.
* include/abg-ir.h (is_java_language): Declare new function.
* src/abg-dwarf-reader.cc (odr_is_relevant): Adjust to consider
that Java also respects the ODR.
* src/abg-ir.cc (is_java_language): Define new function.
(odr_is_relevant): Adjust to consider that Java also respects the
ODR.