-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make terminator different to a triple value
- Loading branch information
Showing
8 changed files
with
72 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
use index_vec::IndexVec; | ||
|
||
use super::{Triple, TripleIdx}; | ||
use super::{terminator::Terminator, Triple, TripleIdx}; | ||
|
||
#[derive(Default, Clone, Debug)] | ||
#[derive(Clone, Debug)] | ||
pub struct BasicBlock { | ||
pub triples: IndexVec<TripleIdx, Triple>, | ||
pub terminator: Terminator, | ||
} |
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,9 +1,11 @@ | ||
mod basic_block; | ||
mod function; | ||
mod terminator; | ||
mod triple; | ||
mod value; | ||
|
||
pub use basic_block::*; | ||
pub use function::*; | ||
pub use terminator::*; | ||
pub use triple::*; | ||
pub use value::*; |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use super::*; | ||
|
||
#[derive(Clone, Debug)] | ||
pub enum Terminator { | ||
/// Jump to the corresponding basic block. | ||
Jump(BasicBlockIdx), | ||
/// Return with the provided value. | ||
Return(Value), | ||
Switch { | ||
value: Value, | ||
default: BasicBlockIdx, | ||
branches: Vec<(Value, BasicBlockIdx)>, | ||
}, | ||
} |
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