Unused EpAnn across compiler phases
@alanz mentioned elsewhere that the exact printing annotations weren't used when renaming, however, the TTG instances of many many AST constructors carry exact printing annotations thorough all phases (Ps, Rn, Tc).
I am wondering if it would be better to have 3 distinct instances (Ps, Rn, Tc) instead of one instance with GhcPass _
.
This would make the instances in the code larger, but it would save passing around ep annotations.
I am also wondering whether not carrying around the annotations would improve the compiler performance.
RE: "we're just using noAnn everywhere to instance EpAnn in other phases" -- even if removing all EpAnn doesn't better compiler performance, I still want to argue that having NoExtField instead of EpAnn is better semantically.
There is a considerably bigger "code cost" when pattern matching on methods that are polymorphic in the phase because we must pattern match against all phases individually (the extension is different for each...)
(for example in pprSplice :: forall p. (OutputableBndrId p) => HsSplice (GhcPass p) -> SDoc
)
Let me know your thoughts on this, ~romes