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

Impl pass block::NonEmpty #78

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add FuncRef to verification context
  • Loading branch information
emhane committed Oct 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit a90ae0da5accd9c4553293f9f9f3376ebd43d61a
6 changes: 4 additions & 2 deletions crates/verifier/src/ctx.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
//! Verification context

use sonatina_ir::{ControlFlowGraph, Function};
use sonatina_ir::{module::FuncRef, ControlFlowGraph, Function};

use crate::{error::ErrorData, ErrorStack};

pub struct VerificationCtx<'a> {
pub func_ref: FuncRef,
pub func: &'a Function,
pub cfg: ControlFlowGraph,
pub error_stack: ErrorStack,
}

impl<'a> VerificationCtx<'a> {
pub fn new(func: &'a Function) -> Self {
pub fn new(func_ref: FuncRef, func: &'a Function) -> Self {
let mut cfg = ControlFlowGraph::new();
cfg.compute(func);

Self {
func_ref,
func,
cfg,
error_stack: ErrorStack::default(),