[PATCH] Fix initialization problems with PassRegistry

David Blaikie dblaikie at gmail.com
Wed Jun 11 10:29:15 PDT 2014


This still seems to be doing multiple things for possibly distinct reasons & might be clearer (to me - whether that matters is a fair question) in separate patches.

The original problem you demonstrate with the traces is due to the use of global PassRegistrationListener's that have self-deregistration, right?

So just removing self PassRegistrationListener's automatic registration/deregistration would be sufficient to fix that issue, right? No need to change the Pass registration itself, or introduce the StaticPassregistry.

We could even maintain the ability to automatically register PassRegistrationListeners if we just had a separate wrapper type that handled their registration in global contexts and wouldn't try to deregister them (since the PassRegistry is going to cleanup itself, there would be no need to deregister). That way we could preserve the existing automatic attachment/removal of PassRegistrationListeners (or not... they might need some other wrapper type to do local scope attachment and detachment)

Does any of that rambling make sense?

http://reviews.llvm.org/D3996






More information about the llvm-commits mailing list