Explanation: Cache parsed syntax tree in macro plugins. The compiler may send the same syntax to the plugins multiple times. For example, memberAttribute macro request contains parent nominal decl syntax, and the compiler sends a request for each members. Parsing it multiple times is a waste.
Scope: Macro plugins
Risk: Low. The change is local, and the implementation is straightforward.
Testing: Added unit test cases for newly introduced LRU cache.
Cherry-pick https://github.com/apple/swift-syntax/pull/2682 into release/6.0
memberAttribute
macro request contains parent nominal decl syntax, and the compiler sends a request for each members. Parsing it multiple times is a waste.