mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
To add a module pass in `Passes.def` use the new `SWIFT_MODULE_PASS` macro. On the swift side, create a `ModulePass`. It’s run function receives a `ModulePassContext`, which provides access to all functions of a module. But it doesn't provide any APIs to modify functions. In order to modify a function, a module pass must use `ModulePassContext.transform(function:)`.
1.8 KiB
1.8 KiB