From 0b05fe33c82ee301c134f5b9a87a596aa47121c8 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 10 Nov 2022 14:19:20 -0800 Subject: Fix inlining pass. (#2506) * Fix inlining pass. * Add more check against corner cases. * Revise comments. * Fixes. * Fix premake script. * Fixes. Co-authored-by: Yong He --- source/slang/slang-ir.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index f9686ac5b..9d538a774 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -159,8 +159,9 @@ namespace Slang v->firstUse = this; } - +#ifdef SLANG_ENABLE_FULL_IR_VALIDATION debugValidate(); +#endif } void IRUse::set(IRInst* uv) @@ -172,13 +173,15 @@ namespace Slang { // This `IRUse` is part of the linked list // of uses for `usedValue`. - +#ifdef SLANG_ENABLE_FULL_IR_VALIDATION debugValidate(); +#endif if (usedValue) { +#ifdef SLANG_ENABLE_FULL_IR_VALIDATION auto uv = usedValue; - +#endif *prevLink = nextUse; if(nextUse) { @@ -190,8 +193,11 @@ namespace Slang nextUse = nullptr; prevLink = nullptr; +#ifdef SLANG_ENABLE_FULL_IR_VALIDATION if(uv->firstUse) uv->firstUse->debugValidate(); +#endif + } } -- cgit v1.2.3