A method for implementing virtual bases with fixed offsets in a class
hierarchy graph, having nodes representing object classes and edges
representing immediate inheritance therebetween, corresponding to an
object oriented program includes determining whether a set N including
all nodes is empty. A node x is removed from N, when N is not empty. It
is determined whether a set Y is empty, Y including nodes that directly
and virtually inherit from x. When Y is empty, return to determining
whether N is empty, otherwise a node y is removed from Y. It is
determined whether y is duplicated. When y is duplicated, return to
determining whether Y is empty, otherwise an edge e, representing that y
virtually inherits from x, is replaced with an edge e', representing that
x has a fixed offset with respect to y. Upon replacing e, return to
determining whether N is empty.