Existing print-before/after options are using PassNameParser which has only been able to parse legacy pass names,
rejecting everything else.
Majority of this fix is an enhancement for PassNameParser to
allow -print-before/after to take arbitrary strings, not just those
corresponding to legacy pass option names.
PassNameParser was converted to a template that takes boolean argument
'AllowArbitraryNames' that allows to just accept names that do not
match legacy passes.
As soon as these names are accepted by parser everything else works since
new-pm IR printing does already call llvm::shouldPrintBeforePass/shouldPrintAfterPass.
One important consequence of this implementation change is that there
is no more checking for errors in legacy pass names in -print-before/-print-after.
Other options that use PassNameParser do not set AllowArbitraryNames to true
and thus continue to check its values for errors.