Pass.h #includes PassSupport.h and PassAnalysisSupport.h. Each of those #includes Pass.h. This makes the modules build unhappy when local submodule visibility is enabled.
The approach taken here is:
- Move the definition of the Pass base class and related types to PassBase.h
- Change the other two headers to include PassBase.h instead of Pass.h
This way including Pass.h gets the full Pass interface, and PassBase.h gets just the base Pass classes. One functional difference is that including PassSupport does *not* provide PassAnalysisSupport and vice versa. I'm doing a build right now to see if I need to add includes of those two anywhere as a result.
Can you sink this into llvm/IR/ and call it LegacyPass.h?
And sink the other files' actual content into llvm/IR/LegacyFoo.h files?
And then these will all be pure forwarding headers?