Skip to content

Commit

Permalink
feat(vyper): add experimental codegen to settings (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr authored Aug 14, 2024
1 parent 9af04b2 commit 850de50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/artifacts/vyper/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ pub struct VyperSettings {
pub output_selection: OutputSelection,
#[serde(rename = "search_paths", skip_serializing_if = "Option::is_none")]
pub search_paths: Option<BTreeSet<PathBuf>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub experimental_codegen: Option<bool>,
}

impl VyperSettings {
Expand Down
11 changes: 9 additions & 2 deletions crates/compilers/src/compilers/vyper/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ impl CompilerSettings for VyperSettings {
}

fn can_use_cached(&self, other: &Self) -> bool {
let Self { evm_version, optimize, bytecode_metadata, output_selection, search_paths } =
self;
let Self {
evm_version,
optimize,
bytecode_metadata,
output_selection,
search_paths,
experimental_codegen,
} = self;
evm_version == &other.evm_version
&& optimize == &other.optimize
&& bytecode_metadata == &other.bytecode_metadata
&& output_selection.is_subset_of(&other.output_selection)
&& search_paths == &other.search_paths
&& experimental_codegen == &other.experimental_codegen
}

fn with_include_paths(mut self, include_paths: &BTreeSet<PathBuf>) -> Self {
Expand Down

0 comments on commit 850de50

Please sign in to comment.