Skip to content

Commit

Permalink
[lir] add analysis structure
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingerZhu committed Feb 25, 2024
1 parent 1fceabe commit cf99844
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions rura-lir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ proc-macro2 = "1.0.78"
quote = "1.0.35"
winnow = "0.6.2"
thiserror = "1.0.57"
serde_json = "1.0.114"

[dependencies.rura-parsing]
path = "../rura-parsing"
Expand Down
18 changes: 18 additions & 0 deletions rura-lir/src/pass/analysis/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#![allow(unused)]
use std::any::Any;

use rura_parsing::QualifiedName;

pub trait AnalysisInfo {
fn from_json(json: &str) -> Self;
fn to_json(&self) -> String;
fn module_level_info(&self) -> Option<&dyn Any> {
None
}
fn function_level_info(&self, name: &QualifiedName) -> Option<&dyn Any> {
None
}
fn operand_level_info(&self, function: &QualifiedName, operand: usize) -> Option<&dyn Any> {
None
}
}
1 change: 1 addition & 0 deletions rura-lir/src/pass/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod analysis;
pub mod diagnostic;

pub trait Pass {
Expand Down

0 comments on commit cf99844

Please sign in to comment.