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

rename StacklessControlFlowGraph::is_dummmy() to is_dummy() #10501

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions third_party/move/evm/move-to-yul/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<'a> FunctionGenerator<'a> {
// Emit state machine to represent control flow.
// TODO: Eliminate the need for this, see also
// https://medium.com/leaningtech/solving-the-structured-control-flow-problem-once-and-for-all-5123117b1ee2
if cfg.successors(entry_bb).iter().all(|b| cfg.is_dummmy(*b)) {
if cfg.successors(entry_bb).iter().all(|b| cfg.is_dummy(*b)) {
// In this trivial case, we have only one block and can omit the state machine
if let BlockContent::Basic { lower, upper } = cfg.content(entry_bb) {
for offs in *lower..*upper + 1 {
Expand Down Expand Up @@ -174,7 +174,7 @@ impl<'a> FunctionGenerator<'a> {
/// Get the actual entry block, skipping trailing dummy blocks.
fn get_actual_entry_block(cfg: &StacklessControlFlowGraph) -> BlockId {
let mut entry_bb = cfg.entry_block();
while cfg.is_dummmy(entry_bb) {
while cfg.is_dummy(entry_bb) {
assert_eq!(cfg.successors(entry_bb).len(), 1);
entry_bb = *cfg.successors(entry_bb).iter().last().unwrap();
}
Expand Down
4 changes: 2 additions & 2 deletions third_party/move/move-model/bytecode/src/dataflow_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub trait TransferFunctions {
instrs: &[Bytecode],
cfg: &StacklessControlFlowGraph,
) -> Self::State {
if cfg.is_dummmy(block_id) {
if cfg.is_dummy(block_id) {
return state;
}
let instr_inds = cfg.instr_indexes(block_id).unwrap();
Expand Down Expand Up @@ -126,7 +126,7 @@ pub trait DataflowAnalysis: TransferFunctions {
let mut result = BTreeMap::new();
for (block_id, block_state) in state_map {
let mut state = block_state.pre;
if !cfg.is_dummmy(block_id) {
if !cfg.is_dummy(block_id) {
let instr_inds = cfg.instr_indexes(block_id).unwrap();
if Self::BACKWARD {
for offset in instr_inds.rev() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl StacklessControlFlowGraph {
self.blocks.len() as u16
}

pub fn is_dummmy(&self, block_id: BlockId) -> bool {
pub fn is_dummy(&self, block_id: BlockId) -> bool {
matches!(self.blocks[&block_id].content, BlockContent::Dummy)
}

Expand Down
Loading