Skip to content

Commit 7fccbad

Browse files
authored
[AutoDiff] NFC: Reimplement PullbackCloner using pimpl pattern. (swiftlang#32778)
Reimplement `PullbackCloner` using the pointer-to-implementation pattern. `PullbackCloner.h` is now tiny: `PullbackCloner` exposes only a `bool run()` entry point. All of the implementation is moved to `PullbackCloner::Implementation` in `PullbackCloner.cpp`. Benefits of this approach: - A main benefit is that methods can be defined directly in `PullbackCloner.cpp` without needing to separately declare them in `PullbackCloner.h`. - There is now no code duplication between `PullbackCloner.h` and `PullbackCloner.cpp`. - Consequently, method documentation is easier to read because it appears directly on method definitions, instead of on method declarations in a separate file. This is important for documentation of `PullbackCloner` instruction visitor methods, which explain pullback transformation rules. - Incremental recompilation may be faster since `PullbackCloner.h` changes less often. Partially resolves SR-13182.
1 parent 40104ba commit 7fccbad

File tree

2 files changed

+1847
-1969
lines changed

2 files changed

+1847
-1969
lines changed

0 commit comments

Comments
 (0)