Skip to content

Commit

Permalink
Revert "further cleanup"
Browse files Browse the repository at this point in the history
This reverts commit 2fa0ace.
  • Loading branch information
cos committed Dec 20, 2024
1 parent 2fa0ace commit 30cd739
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ pub struct VarInfo {
pub index: F::LocalIndex,
}

#[derive(Debug, Clone)]
pub struct SpecInfo {
pub offset: F::CodeOffset,
// Free locals that are used but not declared in the block
pub used_locals: UniqueMap<H::Var, VarInfo>,
}

#[derive(Debug, Clone)]
pub struct FunctionInfo {
pub parameters: Vec<(H::Var, VarInfo)>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ impl FilterContext for Context<'_> {
// An AST element should be removed if:
// * It is annotated #[spec_only] and verify mode is not set
fn should_remove_by_attributes(&mut self, attrs: &[P::Attributes]) -> bool {
// uncomment this condition to disable filtering out specs
// if self.env.flags().is_verifying() {
// return false;
// }

if self.env.flags().is_verifying() {
return false;
}
use known_attributes::VerificationAttribute;
let flattened_attrs: Vec<_> = attrs.iter().flat_map(verification_attributes).collect();
//
Expand Down
20 changes: 20 additions & 0 deletions external-crates/move/crates/move-compiler/src/shared/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,13 @@ pub struct Flags {
)]
test: bool,

/// Compile in verify mode
#[clap(
short = cli::VERIFY_SHORT,
long = cli::VERIFY,
)]
verify: bool,

/// If set, warnings become errors.
#[clap(
long = cli::WARNINGS_ARE_ERRORS,
Expand Down Expand Up @@ -657,6 +664,7 @@ impl Flags {
pub fn empty() -> Self {
Self {
test: false,
verify: false,
shadow: false,
bytecode_version: None,
warnings_are_errors: false,
Expand All @@ -671,6 +679,7 @@ impl Flags {
pub fn testing() -> Self {
Self {
test: true,
verify: false,
shadow: false,
bytecode_version: None,
warnings_are_errors: false,
Expand All @@ -682,6 +691,13 @@ impl Flags {
}
}

pub fn set_verify(self, value: bool) -> Self {
Self {
verify: value,
..self
}
}

pub fn set_keep_testing_functions(self, value: bool) -> Self {
Self {
keep_testing_functions: value,
Expand Down Expand Up @@ -739,6 +755,10 @@ impl Flags {
self.test
}

pub fn is_verifying(&self) -> bool {
self.verify
}

pub fn keep_testing_functions(&self) -> bool {
self.test || self.keep_testing_functions
}
Expand Down

0 comments on commit 30cd739

Please sign in to comment.