Add some comments to the frontend code.

This commit is contained in:
Sean Stangl
2019-07-22 12:50:22 -06:00
parent 5d1deecbb4
commit ffa9d315e6
2 changed files with 12 additions and 2 deletions

View File

@@ -41,8 +41,17 @@ pub struct FunctionBuilder<'a> {
#[derive(Clone, Default)] #[derive(Clone, Default)]
struct EbbData { struct EbbData {
filled: bool, /// An Ebb is "pristine" iff no instructions have been added since the last
/// call to `switch_to_block()`.
pristine: bool, pristine: bool,
/// An Ebb is "filled" iff a terminator instruction has been inserted since
/// the last call to `switch_to_block()`.
///
/// A filled block cannot be pristine.
filled: bool,
/// Count of parameters not supplied implicitly by the SSABuilder.
user_param_count: usize, user_param_count: usize,
} }

View File

@@ -89,7 +89,8 @@ impl FuncTranslator {
let entry_block = builder.create_ebb(); let entry_block = builder.create_ebb();
builder.append_ebb_params_for_function_params(entry_block); builder.append_ebb_params_for_function_params(entry_block);
builder.switch_to_block(entry_block); // This also creates values for the arguments. builder.switch_to_block(entry_block); // This also creates values for the arguments.
builder.seal_block(entry_block); builder.seal_block(entry_block); // Declare all predecessors known.
// Make sure the entry block is inserted in the layout before we make any callbacks to // Make sure the entry block is inserted in the layout before we make any callbacks to
// `environ`. The callback functions may need to insert things in the entry block. // `environ`. The callback functions may need to insert things in the entry block.
builder.ensure_inserted_ebb(); builder.ensure_inserted_ebb();