Using the NewPM requires a whole bunch of magic incantations -- you need to declare all the different pass managers, register all analysis passes and cross-register the proxies. This boilerplate always looks the same.
This patch adds a PassBuilderContext, which stores both the PassBuilder and the various analysis managers, and exposes a method to perform the analysis registration. This is more convenient for most uses of PassBuilder that aren't doing anything complicated.
Not entirely sure whether PassInstrumentationCallbacks should be part of this or not. This is mostly used in conjunction with StandardInstrumentations, so maybe it doesn't belong here.