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

Correctly export the main fn in the json abi #5707

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

xunilrj
Copy link
Contributor

@xunilrj xunilrj commented Mar 7, 2024

Description

This fixes a bug introduced by #5427, where the ABI was exporting the "__entry" function instead of the "main".

When parsing and type checking I now mark function as "main" an only later decide if the compilation will call the main or the entry.

I also moved the is_entrypoint method from the TyAstNode to the DCE pass, because it is super specific to that pass.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

Copy link

github-actions bot commented Mar 7, 2024

Benchmark for fa4f096

Click to view benchmark
Test Base PR %
code_action 5.4±0.04ms 5.4±0.18ms 0.00%
code_lens 292.4±25.80ns 289.3±13.15ns -1.06%
compile 5.9±0.11s 5.9±0.05s 0.00%
completion 5.0±0.20ms 4.9±0.08ms -2.00%
did_change_with_caching 5.4±0.07s 5.3±0.04s -1.85%
document_symbol 979.2±20.51µs 1033.5±17.53µs +5.55%
format 70.4±1.59ms 70.9±2.25ms +0.71%
goto_definition 358.3±4.76µs 355.7±5.74µs -0.73%
highlight 9.1±0.15ms 9.1±0.11ms 0.00%
hover 592.1±6.47µs 581.7±7.77µs -1.76%
idents_at_position 122.8±0.51µs 122.6±1.05µs -0.16%
inlay_hints 666.8±22.31µs 677.2±27.62µs +1.56%
on_enter 503.4±17.65ns 487.9±14.70ns -3.08%
parent_decl_at_position 3.7±0.03ms 3.8±0.06ms +2.70%
prepare_rename 372.8±11.86µs 358.0±5.69µs -3.97%
rename 9.6±0.06ms 9.5±0.12ms -1.04%
semantic_tokens 1055.9±6.67µs 1060.5±35.13µs +0.44%
token_at_position 364.5±2.55µs 355.6±4.77µs -2.44%
tokens_at_position 3.7±0.05ms 3.7±0.04ms 0.00%
tokens_for_file 416.3±2.76µs 416.7±5.53µs +0.10%
traverse 44.6±1.52ms 44.1±1.22ms -1.12%

@xunilrj xunilrj requested review from hal3e and a team March 7, 2024 18:17
@IGI-111 IGI-111 requested a review from a team March 7, 2024 18:19
@xunilrj xunilrj merged commit a0b8062 into master Mar 7, 2024
35 checks passed
@xunilrj xunilrj deleted the xunilrj/fix-new-encoding-abi branch March 7, 2024 19:16
@hal3e hal3e restored the xunilrj/fix-new-encoding-abi branch March 8, 2024 08:03
@hal3e hal3e deleted the xunilrj/fix-new-encoding-abi branch March 14, 2024 08:34
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.

3 participants