After https://reviews.llvm.org/D46665 / rC332028, we now emit linkonce_odr definitions of type info names for incomplete class types. This results in formal violations of LLVM's linkage rules (which, for example, cause ASan's ODR violation checker to complain) if the type info name is declared with external linkage in another IR module. To solve this, downgrade any type info names that we would give external linkage to instead have weak_odr linkage. Exception: if we would emit a non-unique type_info name anyway, leave the linkage alone.
This required a bit of rearrangement: the uniqueness of the name can no longer depend on the linkage of the name, because the linkage of the name now depends on the uniqueness of the name! Fortunately, the uniqueness doesn't *really* depend on the linkage of the name, it only depends on the uniqueness of the type. I've split out the type uniqueness / name uniqueness / type_info uniqueness calculations to try to make this a bit clearer.
The way the Darwin ARM64 ABI handles non-unique RTTI is by setting a flag indicating that clients should do string comparisons/hashes; it does not rely on the type name symbols being uniqued. So this should stay external and the _ZTI definition should change to set the bit.