Simplify Ebb parameter creation.
Ebb parameters are appended explicitly by whoever calls create_block, so they don't need to also be inferred from branches. This makes the frontend code more flexible for producers that want to create things in a different order, and it eliminates more temporary allocations. FunctionBuilder no longer maintains its own list of the function parameter values; these can be obtained from the ebb parameter list on the entry block.
This commit is contained in:
@@ -75,11 +75,12 @@
|
||||
//! builder.declare_var(x, I32);
|
||||
//! builder.declare_var(y, I32);
|
||||
//! builder.declare_var(z, I32);
|
||||
//! builder.append_ebb_params_for_function_params(block0);
|
||||
//!
|
||||
//! builder.switch_to_block(block0);
|
||||
//! builder.seal_block(block0);
|
||||
//! {
|
||||
//! let tmp = builder.param_value(0);
|
||||
//! let tmp = builder.ebb_params(block0)[0]; // the first function parameter
|
||||
//! builder.def_var(x, tmp);
|
||||
//! }
|
||||
//! {
|
||||
|
||||
Reference in New Issue
Block a user