Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add single exit node (TerminalNode) to FlowGraph #114

Merged
merged 11 commits into from
Jun 22, 2021

Commits on Jun 16, 2021

  1. Configuration menu
    Copy the full SHA
    429dbfb View commit details
    Browse the repository at this point in the history
  2. Add single exit node (TerminalNode) to FlowGraph

    Previously, any ReturnNode could be the exit of the FlowGraph, which
    complicated some of the interval/structural analysis. Adding a single
    common exit node helps reduce edge cases.
    
    Also refactored:
    
    Postdominators & loops can now be calculated on the FlowGraph at
    construction. Previously it was "postdominator within this interval"
    because there was not the common exit. This moved a lot of code out of
    `if_statements.py` and into `flow_graph.py`.
    
    `Node.emit_goto` is now only used for very special cases (certain asm
    instructions, or the user manually annotates the source). Rather than
    pre-compute which nodes need goto, we just use a goto if the node was
    already emitted while building the Body.
    
    The `emit_node()` function now contains the logic for checking if a node
    has been already been emitted and a goto should be used instead.
    
    Added `SwitchStatement` to `if_statements.py`.
    
    Indenting is now done at formatting time, instead of being determined
    while constructing `Body`s. This makes it possible to shift `Body`
    segments around after construction without recalculating the indents.
    
    Similiarly, empty return elision is done after building the `Body`s,
    instead of during the `build_*` functions. Like indenting, this is to
    accomidate re-writes.
    zbanks committed Jun 16, 2021
    Configuration menu
    Copy the full SHA
    562135e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b268f5c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b1899af View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    461fe88 View commit details
    Browse the repository at this point in the history
  6. Fix mistake in 461fe88

    zbanks committed Jun 16, 2021
    Configuration menu
    Copy the full SHA
    9012057 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2021

  1. Incorporate PR feedback from Simon

    - Add documentation/comments
    - Remove stray debugging/comments
    - Make `BaseNode` an ABC, `children()` abstract & return a list
    zbanks committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    5d5e878 View commit details
    Browse the repository at this point in the history
  2. Change check into assertion

    zbanks committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    f068c30 View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2021

  1. Incorporate PR feedback from Simon

    - Make `indent` arg to `Formatter.indent()` optional
    - Add more documentation, TODOs, and ext links
    zbanks committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    2666ca5 View commit details
    Browse the repository at this point in the history
  2. PR feedback from matt-kempster

    - Change locals from n/p/c to node/parent/child
    - Emit comment about duplicated return
    - Emit node content when skipped
    zbanks committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    17780a6 View commit details
    Browse the repository at this point in the history
  3. Update tests

    zbanks committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    885b7a6 View commit details
    Browse the repository at this point in the history