-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
25 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,17 @@ | ||
use crate::SymbolRef; | ||
|
||
index_vec::define_index_type! { | ||
pub struct StmtInfoId = u32; | ||
} | ||
|
||
#[derive(Default, Debug)] | ||
pub struct StmtInfo { | ||
pub stmt_idx: usize, | ||
/// The index of this statement in the module body. | ||
/// | ||
/// We will create some facade statements while bundling, and the facade statements | ||
/// don't have a corresponding statement in the original module body, which means | ||
/// `stmt_idx` will be `None`. | ||
pub stmt_idx: Option<usize>, | ||
// currently, we only store top level symbols | ||
pub declared_symbols: Vec<SymbolRef>, | ||
// We will add symbols of other modules to `referenced_symbols`, so we need `SymbolRef` | ||
// here instead of `SymbolId`. | ||
/// Top level symbols referenced by this statement. | ||
pub referenced_symbols: Vec<SymbolRef>, | ||
} | ||
|
||
// Because we want declare symbols at linker, it shouldn't mutate the original `StmtInfo`. | ||
#[derive(Default, Debug)] | ||
pub struct VirtualStmtInfo { | ||
pub declared_symbols: Vec<SymbolRef>, | ||
pub referenced_symbols: Vec<SymbolRef>, | ||
} |