Skip to content

Conversation

CohenArthur
Copy link
Member

First commit will obviously get dropped before submitting the PR to the main RuSTy repo. Looking for feedback on the API and implementation.

For reviewing, skip the last commit as it basically updates the testsuite snapshots which creates a huge diff.

@CohenArthur CohenArthur force-pushed the move-functions-to-sections branch 3 times, most recently from 9d96dc3 to e5afec8 Compare March 8, 2024 21:03
ghaith and others added 12 commits March 10, 2024 20:56
* feat: add a Dagnostics registry that controls severity

An Diagnostic registry is now responsible for adding a severity instead
of the diagnostic itself. The registry is the default diagnostics
assessor. Diagnostics no longer have an own severity field as a result.

* Rename error to new
* Diagnostics config option
* feat: add registry serializer

Added the option to load a diagnostics configuration
Added tests for the configuration
Added the basic api to print the configuration

* feat: add command line option to parse plc_diagnostics

A  new parameter (`--error-config`) can now be used to include a json
file with the default behaviour for errors

* feat: add an explain flag to the compiler

Error messages now show the error code in the report
At the end of the compilation a hint is shown to use the new explain
flag for more info

* feat: add the possiblity to print the error config

The error configuration can now be printe using `plc config diagnostics`

Added documentation about the new commands to the book
* Make sure windows runs on 1.75
* Reword some errors
…LC-lang#1142)

* fix: string tests no longer segfault when testing with optimization
`build_with_cc_linker` would previously always fail when running under macOS, which this PR fixes by adding a macOS triplet to the `--target` flag.
Fixes a bug for Windows where compilation would panic if the compiler was executed in another drive than where a project was located in. For example if `plc build D:/project/conf/plc.json [...]` was executed from the `C:/` drive, the pipeline would try to strip the root `C:/` from the path `D:/project/...` which panics because of the method [`strip_prefix`](https://doc.rust-lang.org/std/path/struct.Path.html#method.strip_prefix). For linux and macOS this was no problem because the root is always `/`.
delete lexer.expect(...) in favour of expect_token!() macro

refactor the parser to use the expect_token!() macro that collects
diagnostics instead of returning a result. This will allow us to
gradually improve the robustness and recovery-capabilities
of the parser.

fixes PLC-lang#196
* fix: false-positive downcast warnings

Fixes false-positive downcast warnings on integrally promoted expressions. This is achieved by checking
each element's type in the expression individually and comparing it to the resulting type rather than checking
the expression's type as a whole.
---------

Co-authored-by: Mathias Rieder <[email protected]>
Co-authored-by: Volkan Sagcan <[email protected]>
The section-mangler crate provides a simple builder for representing
StructuredText functions and variables and mangling their name.
@CohenArthur CohenArthur force-pushed the move-functions-to-sections branch from e5afec8 to 54e04a2 Compare March 18, 2024 13:14
This commit relocates generated LLVM functions to sections using the
appropriate mangled name.
@CohenArthur CohenArthur force-pushed the move-functions-to-sections branch from 54e04a2 to e1d10df Compare March 18, 2024 13:49
This enables sharing the type mangling with the variable generator
@CohenArthur
Copy link
Member Author

Submitted upstream for review: PLC-lang#1160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants