diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-11-06 01:47:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-05 09:47:26 -0800 |
| commit | b118451e301d734e3e783b3acdf871f3f6ea851c (patch) | |
| tree | 277f160d31e2c442f724bc6a2d3c09fabff403ca /source/slang/slang-ir-dce.cpp | |
| parent | 53dd5928c35d5a5cb1f7d2a563348fd1fa87d672 (diff) | |
Move switch statement bodies to their own lines (#5493)
* Move switch statement bodies to their own lines
* format
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-ir-dce.cpp')
| -rw-r--r-- | source/slang/slang-ir-dce.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
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; } |
