Right now, clang generates the following definition: @_ZTVN10__cxxabiv117__class_type_infoE = external global ptr
But the size of this data is larger than 8 bytes (Itanium C++ ABI).
Indeed I can find code like: getelementptr inbounds ptr, ptr @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2
Technically, this IR is invalid because the pointer goes out of bounds, and thus the gep inbounds returns poison.
Is it possible to change the size of the definition to match the actual size? I don’t know the implications of messing around with this stuff, but it would be great to make sure that the generated IR is well-defined.
ah, I didn’t know that zero-sized arrays existed in LLVM. They do show up in LangRef though.
If the size is not known, that sounds like a good solution, thanks!