Closed gbalats closed 8 years ago
Also relevant of course is the Empty Base Optimization.
Allows the size of an empty base subobject to be zero. ... However, base class subobjects are not so constrained, and can be completely optimized out from the object layout
Right now, whenever a class inherits from at least two other classes and one of them has zero size (e.g., a facade class, or the base case of a variadic data structure such as a tuple), the fact-import step fails with a functional dependency violation.
The reason is that these two superclasses would both be mapped to zero bit offset for their corresponding fields in
pred::struct_type::field_name
.We must somehow detect such zero-size supertypes and produce the correct mapping either at the front-end (during dwarf debug info parsing), or at the Datalog level by comparing with the known types of the
Type
entity at bit offset 0.