From 801aa3b44254341018a1acbe754f2ce3b0900e2a Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 16 Nov 2022 12:17:49 -0800 Subject: Clean up type checking of higher order expressions. (#2519) * Clean up type checking of higher order expressions. * Replace `goto` with `break` to pacify clang. * Fix. * Fixes. * Fix more tests. * Fix lowerWitnessTable parameter error. * Exclude attributes from ast printing. Co-authored-by: Yong He --- source/slang/slang-ir-dce.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/slang/slang-ir-dce.cpp') diff --git a/source/slang/slang-ir-dce.cpp b/source/slang/slang-ir-dce.cpp index d58e307da..14edf21d7 100644 --- a/source/slang/slang-ir-dce.cpp +++ b/source/slang/slang-ir-dce.cpp @@ -305,6 +305,17 @@ bool shouldInstBeLiveIfParentIsLive(IRInst* inst, IRDeadCodeEliminationOptions o { return true; } + if (inst->findDecoration()) + { + if (inst->findDecoration()) + return true; + if (auto genInst = as(inst)) + { + auto inner = findInnerMostGenericReturnVal(genInst); + if (inner->findDecoration()) + return true; + } + } } if (options.keepLayoutsAlive && inst->findDecoration()) -- cgit v1.2.3