summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir.cpp')
-rw-r--r--source/slang/slang-ir.cpp52
1 files changed, 50 insertions, 2 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp
index 98c0fa471..fb7d752d5 100644
--- a/source/slang/slang-ir.cpp
+++ b/source/slang/slang-ir.cpp
@@ -3411,6 +3411,53 @@ IRInst* IRBuilder::emitDebugValue(IRInst* debugVar, IRInst* debugValue)
args.getBuffer());
}
+IRInst* IRBuilder::emitDebugInlinedAt(
+ IRInst* line,
+ IRInst* col,
+ IRInst* file,
+ IRInst* debugFunc,
+ IRInst* outerInlinedAt)
+{
+ if (outerInlinedAt)
+ {
+ IRInst* args[] = {line, col, file, debugFunc, outerInlinedAt};
+ return emitIntrinsicInst(getVoidType(), kIROp_DebugInlinedAt, 5, args);
+ }
+ else
+ {
+ IRInst* args[] = {line, col, file, debugFunc};
+ return emitIntrinsicInst(getVoidType(), kIROp_DebugInlinedAt, 4, args);
+ }
+}
+
+IRInst* IRBuilder::emitDebugFunction(
+ IRInst* name,
+ IRInst* line,
+ IRInst* col,
+ IRInst* file,
+ IRInst* debugType)
+{
+ IRInst* args[] = {name, line, col, file, debugType};
+ return emitIntrinsicInst(getVoidType(), kIROp_DebugFunction, 5, args);
+}
+
+IRInst* IRBuilder::emitDebugInlinedVariable(IRInst* variable, IRInst* inlinedAt)
+{
+ IRInst* args[] = {variable, inlinedAt};
+ return emitIntrinsicInst(getVoidType(), kIROp_DebugInlinedVariable, 2, args);
+}
+
+IRInst* IRBuilder::emitDebugScope(IRInst* scope, IRInst* inlinedAt)
+{
+ IRInst* args[] = {scope, inlinedAt};
+ return emitIntrinsicInst(getVoidType(), kIROp_DebugScope, 2, args);
+}
+
+IRInst* IRBuilder::emitDebugNoScope()
+{
+ return emitIntrinsicInst(getVoidType(), kIROp_DebugNoScope, 0, nullptr);
+}
+
IRLiveRangeStart* IRBuilder::emitLiveRangeStart(IRInst* referenced)
{
// This instruction doesn't produce any result,
@@ -7941,8 +7988,8 @@ IRInstList<IRDecoration> IRInst::getDecorations()
IRInst* IRInst::getFirstChild()
{
// The children come after any decorations,
- // so if there are any decorations, then the
- // first child is right after the last decoration.
+ // so if there are any decorations, then
+ // the first child is right after the last decoration.
//
if (auto lastDecoration = getLastDecoration())
return lastDecoration->getNextInst();
@@ -8462,6 +8509,7 @@ bool IRInst::mightHaveSideEffects(SideEffectAnalysisOptions options)
case kIROp_RTTIObject:
case kIROp_RTTIType:
case kIROp_Func:
+ case kIROp_DebugFunction:
case kIROp_Generic:
case kIROp_Var:
case kIROp_Param: