mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-13 18:51:05 +00:00
apply size optimizations by default (#298)
So far if no optimization level was specified, optimizations for execution time were applied. However, we currently are a bit limited on code size. Add to that, this setting is not available in solc and people generally ignore the docs, generating a lot of support requests. Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -6,9 +6,16 @@ This is a development pre-release.
|
|||||||
|
|
||||||
Supported `polkadot-sdk` rev:`c29e72a8628835e34deb6aa7db9a78a2e4eabcee`
|
Supported `polkadot-sdk` rev:`c29e72a8628835e34deb6aa7db9a78a2e4eabcee`
|
||||||
|
|
||||||
|
## v0.1.0
|
||||||
|
|
||||||
|
This is a development pre-release.
|
||||||
|
|
||||||
|
Supported `polkadot-sdk` rev:`c29e72a8628835e34deb6aa7db9a78a2e4eabcee`
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
- By default, heavy size optimizations are applied.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ impl TryFrom<&SolcStandardJsonInputSettingsOptimizer> for Settings {
|
|||||||
fn try_from(value: &SolcStandardJsonInputSettingsOptimizer) -> Result<Self, Self::Error> {
|
fn try_from(value: &SolcStandardJsonInputSettingsOptimizer) -> Result<Self, Self::Error> {
|
||||||
let mut result = match value.mode {
|
let mut result = match value.mode {
|
||||||
Some(mode) => Self::try_from_cli(mode)?,
|
Some(mode) => Self::try_from_cli(mode)?,
|
||||||
None => Self::cycles(),
|
None => Self::size(),
|
||||||
};
|
};
|
||||||
if value.fallback_to_optimizing_for_size.unwrap_or_default() {
|
if value.fallback_to_optimizing_for_size.unwrap_or_default() {
|
||||||
result.enable_fallback_to_size();
|
result.enable_fallback_to_size();
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ fn main_inner() -> anyhow::Result<()> {
|
|||||||
|
|
||||||
let mut optimizer_settings = match arguments.optimization {
|
let mut optimizer_settings = match arguments.optimization {
|
||||||
Some(mode) => revive_llvm_context::OptimizerSettings::try_from_cli(mode)?,
|
Some(mode) => revive_llvm_context::OptimizerSettings::try_from_cli(mode)?,
|
||||||
None => revive_llvm_context::OptimizerSettings::cycles(),
|
None => revive_llvm_context::OptimizerSettings::size(),
|
||||||
};
|
};
|
||||||
if arguments.fallback_to_optimizing_for_size {
|
if arguments.fallback_to_optimizing_for_size {
|
||||||
optimizer_settings.enable_fallback_to_size();
|
optimizer_settings.enable_fallback_to_size();
|
||||||
|
|||||||
Reference in New Issue
Block a user