mirror of
https://github.com/yuzu-emu/sirit
synced 2024-11-22 17:43:54 +00:00
Add OpUnreachable
This commit is contained in:
parent
84fab90024
commit
f1cccfd0f3
2 changed files with 8 additions and 0 deletions
|
@ -292,6 +292,9 @@ public:
|
||||||
/// Returns with no value from a function with void return type.
|
/// Returns with no value from a function with void return type.
|
||||||
void OpReturn();
|
void OpReturn();
|
||||||
|
|
||||||
|
/// Behavior is undefined if this instruction is executed.
|
||||||
|
void OpUnreachable();
|
||||||
|
|
||||||
/// Return a value from a function.
|
/// Return a value from a function.
|
||||||
Id OpReturnValue(Id value);
|
Id OpReturnValue(Id value);
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,11 @@ void Module::OpReturn() {
|
||||||
*code << spv::Op::OpReturn << EndOp{};
|
*code << spv::Op::OpReturn << EndOp{};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Module::OpUnreachable() {
|
||||||
|
code->Reserve(1);
|
||||||
|
*code << spv::Op::OpUnreachable << EndOp{};
|
||||||
|
}
|
||||||
|
|
||||||
Id Module::OpReturnValue(Id value) {
|
Id Module::OpReturnValue(Id value) {
|
||||||
code->Reserve(2);
|
code->Reserve(2);
|
||||||
return *code << spv::Op::OpReturnValue << value << EndOp{};
|
return *code << spv::Op::OpReturnValue << value << EndOp{};
|
||||||
|
|
Loading…
Reference in a new issue