diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-02-24 16:25:19 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-24 16:25:19 -0800 |
| commit | f90a7631a10d7dcc1427bfda85f66c539c50af5d (patch) | |
| tree | e5bda5e3a58a8619eeab73f9a99c628a701e4767 /source | |
| parent | 73a8d74bdf2849ce3290d8bf8aaf7e1c59f7bc5b (diff) | |
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 <yonghe@outlook.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-ir-ssa.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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; } |
