MATE icon indicating copy to clipboard operation
MATE copied to clipboard

DWARF nodes: APIs for common type derivations

Open langston-barrett opened this issue 1 year ago • 0 comments

Right now, if you have a DWARFType foo and you want to get some of its common derivations (e.g. foo *, const foo *), you need to jump through some hoops:

next(typ for typ in foo.deriving_types if typ.is_pointer)
next(typ for typ in foo.deriving_types if typ.is_const)

This becomes especially annoying when you want multiple levels of derivation. Instead, we should support APIs like these:

# foo -> const foo *
foo.const_of.pointer_of

langston-barrett avatar Aug 24 '22 17:08 langston-barrett