Starting compiler work. Adding pass TODOs.
This commit is contained in:
@@ -9,5 +9,41 @@
|
||||
|
||||
#include <alloy/hir/instr.h>
|
||||
|
||||
#include <alloy/hir/block.h>
|
||||
|
||||
using namespace alloy;
|
||||
using namespace alloy::hir;
|
||||
|
||||
|
||||
void Instr::set_src1(Value* value) {
|
||||
if (src1.value == value) {
|
||||
return;
|
||||
}
|
||||
if (src1.value) {
|
||||
src1.value->RemoveUse(src1_use);
|
||||
}
|
||||
src1.value = value;
|
||||
src1_use = value ? value->AddUse(block->arena, this) : NULL;
|
||||
}
|
||||
|
||||
void Instr::set_src2(Value* value) {
|
||||
if (src2.value == value) {
|
||||
return;
|
||||
}
|
||||
if (src2.value) {
|
||||
src2.value->RemoveUse(src2_use);
|
||||
}
|
||||
src2.value = value;
|
||||
src2_use = value ? value->AddUse(block->arena, this) : NULL;
|
||||
}
|
||||
|
||||
void Instr::set_src3(Value* value) {
|
||||
if (src3.value == value) {
|
||||
return;
|
||||
}
|
||||
if (src3.value) {
|
||||
src3.value->RemoveUse(src3_use);
|
||||
}
|
||||
src3.value = value;
|
||||
src3_use = value ? value->AddUse(block->arena, this) : NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user