It appears that library(prolog_xref) doesn’t do term expansion (at least when I ran it, it didn’t find any of the predicates that had been created by term expansion). Is there a way to do cross-referencing of term-expanded files?
If not, I could use current_predicate/1 and listing/1 to output the predicates (or read_term/2 and expand_term/2) because I want to find dead code:
xref_defined(_, Pred, _), \+ xref_called(_, Pred, _). But it’d be nice if there’s a better way of doing this.