diff options
Diffstat (limited to 'source/slang/ir.cpp')
| -rw-r--r-- | source/slang/ir.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/source/slang/ir.cpp b/source/slang/ir.cpp index 313fd258b..92bcb6707 100644 --- a/source/slang/ir.cpp +++ b/source/slang/ir.cpp @@ -168,6 +168,7 @@ namespace Slang case kIROp_loopTest: case kIROp_discard: case kIROp_switch: + case kIROp_unreachable: return true; } } @@ -1152,6 +1153,16 @@ namespace Slang return inst; } + IRInst* IRBuilder::emitUnreachable() + { + auto inst = createInst<IRUnreachable>( + this, + kIROp_unreachable, + nullptr); + addInst(inst); + return inst; + } + IRInst* IRBuilder::emitDiscard() { auto inst = createInst<IRDiscard>( @@ -3457,6 +3468,14 @@ namespace Slang return clonedFunc; } + IRFunc* cloneSimpleFuncWithoutRegistering(IRSpecContextBase* context, IRFunc* originalFunc) + { + auto clonedFunc = context->builder->createFunc(); + cloneFunctionCommon(context, clonedFunc, originalFunc); + return clonedFunc; + } + + IRFunc* cloneSimpleFunc(IRSpecContextBase* context, IRFunc* originalFunc) { auto clonedFunc = context->builder->createFunc(); @@ -4017,7 +4036,7 @@ namespace Slang // TODO: other initialization is needed here... - auto specFunc = cloneSimpleFunc(&context, genericFunc); + auto specFunc = cloneSimpleFuncWithoutRegistering(&context, genericFunc); // Set up the clone to recognize that it is no longer generic specFunc->mangledName = specMangledName; |
