mirror of
https://git.suyu.dev/suyu/sirit.git
synced 2025-12-24 00:06:22 +01:00
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:
parent
8cf3d225db
commit
42248408a9
5 changed files with 48 additions and 32 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue