Navigation

This is a mechanism that allows IR modules to co-operatively build pointer
sets corresponding to addresses within a given set of globals. One example
of a use case for this is to allow a C++ program to efficiently verify (at
each call site) that a vtable pointer is in the set of valid vtable pointers
for the type of the class or its derived classes.

To use the mechanism, a client creates a global metadata node named
llvm.bitsets. Each element is a metadata node with three elements:
the first is a metadata string containing an identifier for the bitset,
the second is a global variable and the third is a byte offset into the
global variable.

This will cause a link-time optimization pass to generate bitsets from the
memory addresses referenced from the elements of the bitset metadata. The pass
will lay out the referenced globals consecutively, so their definitions must
be available at LTO time. The GlobalLayoutBuilder class is responsible for
laying out the globals efficiently to minimize the sizes of the underlying
bitsets. An intrinsic, llvm.bitset.test, generates code
to test whether a given pointer is a member of a bitset.