summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-clone.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-clone.cpp')
-rw-r--r--source/slang/slang-ir-clone.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/slang/slang-ir-clone.cpp b/source/slang/slang-ir-clone.cpp
index 050d1e392..6ac9442ee 100644
--- a/source/slang/slang-ir-clone.cpp
+++ b/source/slang/slang-ir-clone.cpp
@@ -142,12 +142,9 @@ static void _cloneInstDecorationsAndChildren(
// If `newInst` already has non-decoration children, we want to
// insert the new children between the existing decoration and non-decoration children
// so that we maintain the invariant that all decorations are defined before non-decorations.
- if (auto lastDecor = newInst->getLastDecoration())
+ if (auto firstChild = newInst->getFirstChild())
{
- if (auto nextInstBeforeLastDecor = lastDecor->getNextInst())
- {
- builder->setInsertBefore(nextInstBeforeLastDecor);
- }
+ builder->setInsertBefore(firstChild);
}
// When applying the first phase of cloning to