From b118451e301d734e3e783b3acdf871f3f6ea851c Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Wed, 6 Nov 2024 01:47:26 +0800 Subject: Move switch statement bodies to their own lines (#5493) * Move switch statement bodies to their own lines * format --------- Co-authored-by: Yong He --- source/slang/slang-ir-dce.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (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 9c82715d4..5e1f2eb21 100644 --- a/source/slang/slang-ir-dce.cpp +++ b/source/slang/slang-ir-dce.cpp @@ -582,8 +582,11 @@ bool shouldInstBeLiveIfParentIsLive(IRInst* inst, IRDeadCodeEliminationOptions o { switch (decor->getOp()) { - case kIROp_ExportDecoration: return true; - case kIROp_ImportDecoration: isImported = true; break; + case kIROp_ExportDecoration: + return true; + case kIROp_ImportDecoration: + isImported = true; + break; } } for (auto decor : innerInst->getDecorations()) @@ -592,7 +595,9 @@ bool shouldInstBeLiveIfParentIsLive(IRInst* inst, IRDeadCodeEliminationOptions o { case kIROp_ForwardDerivativeDecoration: case kIROp_UserDefinedBackwardDerivativeDecoration: - case kIROp_PrimalSubstituteDecoration: shouldKeptAliveIfImported = true; break; + case kIROp_PrimalSubstituteDecoration: + shouldKeptAliveIfImported = true; + break; } } if (isImported && shouldKeptAliveIfImported) @@ -643,10 +648,13 @@ bool shouldInstBeLiveIfParentIsLive(IRInst* inst, IRDeadCodeEliminationOptions o // this problem. // case kIROp_StructField: - case kIROp_WitnessTableEntry: return true; + case kIROp_WitnessTableEntry: + return true; - case kIROp_GlobalParam: return options.keepGlobalParamsAlive; - default: break; + case kIROp_GlobalParam: + return options.keepGlobalParamsAlive; + default: + break; } // If none of the explicit cases above matched, then we will consider @@ -673,7 +681,8 @@ bool isWeakReferenceOperand(IRInst* inst, UInt operandIndex) // Ignore all operands of SpecializationDictionaryItem. // This inst is used as a cache and shouldn't hold anything alive. return true; - default: break; + default: + break; } return false; } -- cgit v1.2.3