While specific PassGate can already be associated with LLVMContext it is simply ignored by the callback. As a result global one is always used. So the "meat" of that change is at StandardInstrumentations.cpp:771. All other changes are consequences of this change. In particular:
- Changed type of the first parameter of 'shouldRunPass' from "Pass *" to "StringRef". The problem is that "Pass" exists for legacy pass manager only. Thus we are unable to call it from new pass manager (via intstrumentation callbacks mechanism).
- LLVMContext has to be passed to registerCallbacks now
- OptBisect is just a customization of OptPassGate abstraction. Thus getGlobalPassGate has OptPassGate return type, while still returns an instance OptBisect (which is current default pass gate)
clang-format?