From f90a7631a10d7dcc1427bfda85f66c539c50af5d Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Mon, 24 Feb 2025 16:25:19 -0800 Subject: Clone name hint decoration when emiting Undefined (#6415) * Clone name hint decoration when emiting Undefined When emiting "Undefined", we lost the information of where it was synthasized from. This prevents us from providing more helpful error messages. The issue was the when we handle "IRLoop", the inputs parameters to the Phi didn't clone the name hint decoration. This commit clones them when emiting "Undefined". * Adding more test case --------- Co-authored-by: Yong He --- source/slang/slang-ir-ssa.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/slang/slang-ir-ssa.cpp b/source/slang/slang-ir-ssa.cpp index d57d8548e..789ca4796 100644 --- a/source/slang/slang-ir-ssa.cpp +++ b/source/slang/slang-ir-ssa.cpp @@ -694,6 +694,7 @@ IRInst* readVarRec(ConstructSSAContext* context, SSABlockInfo* blockInfo, IRVar* auto type = var->getDataType()->getValueType(); val = blockInfo->builder.emitUndefined(type); + cloneRelevantDecorations(var, val); } else if (!multiplePreds) { @@ -776,6 +777,7 @@ IRInst* readVar(ConstructSSAContext* context, SSABlockInfo* blockInfo, IRVar* va // auto type = var->getDataType()->getValueType(); val = blockInfo->builder.emitUndefined(type); + cloneRelevantDecorations(var, val); writeVar(context, blockInfo, var, val); return val; } -- cgit v1.2.3