The reachability pass will return all possibly user-facing functions, which should be what you need here. For example, we use the results of reachability to determine what symbols should be visible in the object file (others can link to), which is, in essence, the public ABI.