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-check-differentiability.cpp | 33 +++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'source/slang/slang-ir-check-differentiability.cpp') diff --git a/source/slang/slang-ir-check-differentiability.cpp b/source/slang/slang-ir-check-differentiability.cpp index 2a1194ebe..d18c47689 100644 --- a/source/slang/slang-ir-check-differentiability.cpp +++ b/source/slang/slang-ir-check-differentiability.cpp @@ -34,7 +34,8 @@ public: switch (decorations->getOp()) { case kIROp_ForwardDifferentiableDecoration: - case kIROp_BackwardDifferentiableDecoration: return true; + case kIROp_BackwardDifferentiableDecoration: + return true; } } return false; @@ -63,8 +64,10 @@ public: break; case kIROp_UserDefinedBackwardDerivativeDecoration: case kIROp_BackwardDerivativeDecoration: - case kIROp_BackwardDifferentiableDecoration: return true; - default: break; + case kIROp_BackwardDifferentiableDecoration: + return true; + default: + break; } } return false; @@ -94,7 +97,8 @@ public: ->findDecoration()) return isDifferentiableFunc(bwdDerivative->getBackwardDerivativeFunc(), level); return isDifferentiableFunc(func->getOperand(0), level); - default: break; + default: + break; } func = getResolvedInstForDecorations(func); @@ -175,7 +179,8 @@ public: switch (addr->getOp()) { case kIROp_Var: - case kIROp_Param: return isDifferentiableType(diffTypeContext, addr->getDataType()); + case kIROp_Param: + return isDifferentiableType(diffTypeContext, addr->getDataType()); case kIROp_FieldAddress: if (!as(addr)->getField() || as(addr) @@ -191,7 +196,8 @@ public: return false; addr = as(addr)->getBase(); break; - default: return false; + default: + return false; } } return false; @@ -203,7 +209,8 @@ public: { switch (inst->getOp()) { - case kIROp_DetachDerivative: return false; + case kIROp_DetachDerivative: + return false; case kIROp_Call: { auto call = as(inst); @@ -211,7 +218,8 @@ public: call->getCallee(), CheckDifferentiabilityPassContext::DifferentiableLevel::Forward); } - default: return isDifferentiableType(diffTypeContext, inst->getDataType()); + default: + return isDifferentiableType(diffTypeContext, inst->getDataType()); } } @@ -308,7 +316,8 @@ public: { switch (inst->getOp()) { - case kIROp_FloatLit: return true; + case kIROp_FloatLit: + return true; case kIROp_Call: return shouldTreatCallAsDifferentiable(inst) || isDifferentiableFunc(as(inst)->getCallee(), requiredDiffLevel) && @@ -340,7 +349,8 @@ public: { switch (inst->getOp()) { - case kIROp_DetachDerivative: return false; + case kIROp_DetachDerivative: + return false; case kIROp_Call: if (shouldTreatCallAsDifferentiable(inst)) return false; @@ -449,7 +459,8 @@ public: } } break; - default: break; + default: + break; } } } -- cgit v1.2.3