• C
    Using declaration lowering rewrite (#31674) · a22a1e0a
    Chris Sienkiewicz 提交于
    * Fix data flow pass to not report using declarations as unused:
     - Report using declaration variables as read
     - Add test
    
    * Refactor LocalUsingVarRewriter:
    - Delete LocalUsingVarRewriter
    - Split UsingStatement lowering into visit + make methods
    - Split LabelStatement lowering into visit + make methods
    - Correctly lower using declarations with instrumentation
    - Add tests
    
    * Recursively lower using declarations:
    Visit a 'sublist' of statements in a block:
    - For each statement in the sublist, visit with the set of statements after it:
        - If the statement is a label, recursively visit the body with the same set of following statements
        - If the statement is a using declaration, recursively visit the following statements and use those as the body of the using
        - Other statements are visited as normal
    - If we saw a using during the statement visit, we've finished lowering. If not, continue down the list
    
    * Disallow goto's across using declarations as per LDM decisions:
    - Note the using variables in a block, and currently in scope
    - When visiting a goto, check the location of the branch and error if it crosses illegally
    - Add an extra error to distinguish between forward and backward goto errors
    - Add tests
    
    
    a22a1e0a
MethodCompiler.cs 94.5 KB