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

@@ -16,7 +16,7 @@ Id Module::OpVariable(Id result_type, spv::StorageClass storage_class, Id initia
if (initializer) {
op->Add(initializer);
}
return AddCode(std::move(op));
return code_store.emplace_back(std::move(op)).get();
}
Id Module::OpLoad(Id result_type, Id pointer, std::optional<spv::MemoryAccessMask> memory_access) {