In a separate patch, I'm working on re-working clang and lld's lit config's to call a common use_clang and use_lld functions, respectively. Making this work and be generic enough that it also supports debuginfo-test's use case requires a little bit more power in how we specify a tool substitution. For example, lld doesn't prefix its tool substitutions with %, but clang does. And debuginfo-tests shouldn't fail if lld can't be found, but obviously lld should.
This patch adds the necessary bits to make this possible.
It also renames ToolFilter to ToolSubst, and moves it to its own file, to avoid a cyclic dependency between __init__.py and the other files in the same module.
These new lines seem unnecessary, the comment is associated with this def.