Skip to content

Replace -O none/less/default/aggressive with standard -O0 -O1 -O2 -O3 -Os -Oz flags (fixes #534)#1857

Open
Sukuna0007Abhi wants to merge 1 commit intohyperledger-solang:mainfrom
Sukuna0007Abhi:fix/534-optimization-flags
Open

Replace -O none/less/default/aggressive with standard -O0 -O1 -O2 -O3 -Os -Oz flags (fixes #534)#1857
Sukuna0007Abhi wants to merge 1 commit intohyperledger-solang:mainfrom
Sukuna0007Abhi:fix/534-optimization-flags

Conversation

@Sukuna0007Abhi
Copy link
Copy Markdown

Fixes #534

Replaces the non-standard -O none/less/default/aggressive flags with standard GCC/Clang-style -O0, -O1, -O2, -O3, -Os, -Oz. Old values still work for backward compatibility.

Key change from the previous attempt (PR #850): the Options struct now tracks both opt_level (speed) and opt_size_level (size) separately, so -Os and -Oz can properly communicate size optimization intent to LLVM.

Mapping:

  • -O0 → no optimization
  • -O1 → basic optimization
  • -O2 → default (same as before)
  • -O3 → aggressive optimization
  • -Os → optimize for size
  • -Oz → aggressively optimize for size

…2 -O3 -Os -Oz flags (fixes hyperledger-solang#534)

Signed-off-by: Sukuna0007Abhi <appsonly310@gmail.com>
@Sukuna0007Abhi
Copy link
Copy Markdown
Author

Pls review @seanyoung @salaheldinsoliman

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.

Replace -O less command line option with -O0, -O3, -Oz, and -OZ

1 participant