Remove Emit entry in favor of auto-emitting code

All instructions but OpVariable and OpLabel are automatically emitted.
These functions have to call AddLocalVariable/AddGlobalVariable or
AddLabel respectively.
This commit is contained in:
ReinUsesLisp 2019-10-18 04:25:57 -03:00
parent 8cf3d225db
commit 42248408a9
5 changed files with 48 additions and 32 deletions

View file

@ -70,12 +70,26 @@ public:
}
/**
* Adds an instruction to module's code
* @param op Instruction to insert into code. Types and constants must not
* be emitted.
* @return Returns op.
* Adds an existing label to the code
* @param label Label to insert into code.
* @return Returns label.
*/
Id Emit(Id op);
Id AddLabel(Id label);
/**
* Adds a label to the code
* @return Returns the created label.
*/
Id AddLabel() {
return AddLabel(OpLabel());
}
/**
* Adds a local variable to the code
* @param variable Variable to insert into code.
* @return Returns variable.
*/
Id AddLocalVariable(Id label);
/**
* Adds a global variable