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

Improve online change flag behavior #8

Open
wants to merge 45 commits into
base: master
Choose a base branch
from

Commits on Jun 12, 2024

  1. Configuration menu
    Copy the full SHA
    54c78d9 View commit details
    Browse the repository at this point in the history
  2. refactor(AST): introduce AstVisitor trait (PLC-lang#1231)

    * refactor(AST): introduce AstVisitor trait
    
    The AST-Visitor trait allows generic visiting of AST-nodes. A default
    Walking behavior is implemented for each AstStatement but it can be
    altered by any implementor. When overriding a visit_XXX method, the
    implementation can decide to continue with the default walking behavior
    (by calling the walk function on the passed AstStatement-Struct, to skip it,
    or to continue with an alternative walking bahavior.
    
    removed unused AST element CastStatement
    riederm authored Jun 12, 2024
    Configuration menu
    Copy the full SHA
    c186d0e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b545e41 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7a29d58 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f880974 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    15b8704 View commit details
    Browse the repository at this point in the history
  7. Merge pull request PLC-lang#1198 from embecosm/move-variables-to-sect…

    …ions
    
    Move variables to ELF sections with mangled names
    ghaith authored Jun 12, 2024
    Configuration menu
    Copy the full SHA
    92e586a View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2024

  1. Configuration menu
    Copy the full SHA
    823dc54 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    28b6b41 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    06ece68 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2e628ea View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8c8f973 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    54e08eb View commit details
    Browse the repository at this point in the history
  7. Merge pull request PLC-lang#1199 from embecosm/encode-complex-types

    Encode complex types in section mangling
    ghaith authored Jun 13, 2024
    Configuration menu
    Copy the full SHA
    a9d55a1 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    07e893f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    10363b5 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9d1ef35 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a261e79 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    2df6561 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    6370241 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    48a1f00 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    10d7826 View commit details
    Browse the repository at this point in the history
  16. Merge pull request PLC-lang#1205 from embecosm/add-decoding-to-sectio…

    …n-mangler
    
    Add decoding to section mangler
    ghaith authored Jun 13, 2024
    Configuration menu
    Copy the full SHA
    5174c2c View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2024

  1. Configuration menu
    Copy the full SHA
    1a86c8a View commit details
    Browse the repository at this point in the history
  2. Merge pull request PLC-lang#1246 from PLC-lang/workflow_fixes

    Renamed the build workflow
    ghaith authored Jun 14, 2024
    Configuration menu
    Copy the full SHA
    44df0db View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2024

  1. Configuration menu
    Copy the full SHA
    8d0e9e5 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2024

  1. ci: Introduce llvm-lit for Linux (PLC-lang#1243)

    This PR introduces llvm-lit, which at some point will replace our current correctness tests. For now only the functionality was introduced as well as GitHub workflows executing example lit tests.
    volsa authored Jun 18, 2024
    Configuration menu
    Copy the full SHA
    45f487f View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2024

  1. Configuration menu
    Copy the full SHA
    c7f3d82 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2024

  1. fix: for loops no longer execute once when condition is already met (P…

    …LC-lang#1248)
    
    * fix: for loop condition
    
    This PR fixes for loops executing once when the predicate already should not be met for decrementing loops.
    I have also re-implemented the codegen logic for for-loops, resulting in fewer predecessors and hopefully more
    readable IR.
    
    Resolves PLC-lang#1207
    mhasel authored Jun 27, 2024
    Configuration menu
    Copy the full SHA
    ef09b87 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2024

  1. feat: Add --ast CLI argument to emit the AST to stdout (PLC-lang#1256)

    * add ast cli argument to print the AST to stdout
    
    * use pretty printed format
    
    Co-authored-by: Volkan <[email protected]>
    
    ---------
    
    Co-authored-by: Volkan <[email protected]>
    nturley-copia and volsa authored Jul 9, 2024
    Configuration menu
    Copy the full SHA
    4aea520 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2024

  1. feat: Introduce REF= and REFERENCE_TO (PLC-lang#1251)

    This PR introduces two new keywords, namely `REF=` and `REFERENCE TO`:
    * `REF=` is essentially syntactic sugar for an assignment where the right-hand side is wrapped in a `REF()` function call. Therefore `foo := REF(bar)` and `foo REF= bar` are equivalent.
    * `REFERENCE TO` is identical to `REF_TO` with the exception of being auto-deref by default. A variable `foo` declared as `REFERENCE TO` will therefore auto-deref on assignments, i.e. `foo := 5` is equivalent to `foo^ := 5`.
    
    More information on CodeSys' [REF=](https://help.codesys.com/api-content/2/codesys/3.5.12.0/en/_cds_ref_assignment/) and [REFERENCE TO](https://help.codesys.com/api-content/2/codesys/3.5.12.0/en/_cds_datatype_reference/) documentation pages.
    volsa authored Jul 10, 2024
    Configuration menu
    Copy the full SHA
    79abdb6 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2024

  1. chore: Enable logging in VSCode debug view (PLC-lang#1262)

    Prints any log calls in VSCodes debug console
    volsa authored Jul 17, 2024
    Configuration menu
    Copy the full SHA
    0397288 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2024

  1. chore: Bump openssl from 0.10.64 to 0.10.66 (PLC-lang#1264)

    Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.64 to 0.10.66.
    - [Release notes](https://github.com/sfackler/rust-openssl/releases)
    - [Commits](sfackler/rust-openssl@openssl-v0.10.64...openssl-v0.10.66)
    
    ---
    updated-dependencies:
    - dependency-name: openssl
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jul 23, 2024
    Configuration menu
    Copy the full SHA
    0c04d54 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. feat: Aliasing (PLC-lang#1258)

    This commit introduces aliasing, where the `AT` keyword can be used on a reference declaration to create a `REFERENCE TO` pointer. Specifically `foo AT bar : DINT` internally resolves to `foo : REFERENCE TO DINT := REF(bar)`.
    volsa authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    446f073 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2024

  1. fix: Match Option value when parsing alias variables (PLC-lang#1266)

    Fixes an issue where omitting a data-type in an alias variable would cause a panic in the parser. For example
    
    ```
    FUNCTION main
        VAR
            s AT str; // omitted data-type
        END_VAR
    END_FUNCTION
    ```
    volsa authored Jul 26, 2024
    Configuration menu
    Copy the full SHA
    1406d38 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. Configuration menu
    Copy the full SHA
    50dc477 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. feat: Generate a custom GOT array and save/load its layout

    This commit contains changes that are required to generate a global
    variable which will be used to store an array of addresses of other
    global variables in the program. The location of the globals within this
    array should be stable after a recompilation to support online change,
    so we support loading a pre-existing layout to ensure that for all
    globals that we see in both the current program and the pre-existing
    layout, their positions remain the same. Otherwise, any new globals will
    be placed in any empty spaces left by old globals, or appended on to the
    end of the array. The layout will then be saved back the the file used
    for saving and loading.
    
    Currently, to use this feature the flag `--got-layout-file=<file>` must
    be provided, which should specify the name of either a TOML or JSON file
    to use to save, and optionally load if the file already exists, the GOT
    layout. In future we will integrate this with a generic online change
    flag, whereby it will not be necessary to ask for a GOT layout file when
    we already know that we need it for online change.
    lewis-revill authored and CohenArthur committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    1ad2fc9 View commit details
    Browse the repository at this point in the history
  2. feat: Access references to globals through a custom GOT

    This commit introduces the association of GOT indices to the LLVM index,
    which then allows us to utilise that when generating references to
    variables to check if a given variable has an entry in the GOT. If so,
    we obtain its index, and generate the necessary LLVM IR to access the
    address contained within the GOT rather than accessing the variable
    directly.
    lewis-revill authored and CohenArthur committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    ac36e70 View commit details
    Browse the repository at this point in the history
  3. feat: Generate calls via the GOT

    This change involves moving the generation of the GOT from
    variable_generator.rs to codegen.rs, in order to also cover not only
    global variables but also functions and 'programs' too. Once these have
    been given an associated index in the GOT we can use that to replace
    normal direct function calls with indirect calls to a function pointer
    stored in the GOT. We don't do this for calls with external linkage
    since these won't be subject to online change.
    lewis-revill authored and CohenArthur committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    61eb9b5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c771b2a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    acdf708 View commit details
    Browse the repository at this point in the history
  6. rusty: Work around race conditions when compiling multiple modules

    This commit also adds workarounds to make the integration of the generated
    code with our online change runtime work well.
    
    wip: almost done with Mutex hashmap
    
    NOTE: Reuse got_indices member from LlvmIndex instead
    
    wip: it works?
    
    src/test_utils: wip: Make these function compile after latest changes
    
    section_mangler: Fix emitted format
    
    wip
    
    codegen custom GOT as a non-external array
    
    wip: running onlinechangexmpl almost works! crashes on signal1()
    
    more hacks
    
    cleanup
    
    cleanup
    CohenArthur committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    89b1822 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    fe43485 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d4adaee View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    3382d26 View commit details
    Browse the repository at this point in the history