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-use-uninitialized-values.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-use-uninitialized-values.cpp')
| -rw-r--r-- | source/slang/slang-ir-use-uninitialized-values.cpp | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/source/slang/slang-ir-use-uninitialized-values.cpp b/source/slang/slang-ir-use-uninitialized-values.cpp index 390d1a9fc..da88463d6 100644 --- a/source/slang/slang-ir-use-uninitialized-values.cpp +++ b/source/slang/slang-ir-use-uninitialized-values.cpp @@ -21,8 +21,10 @@ static bool isMetaOp(IRInst* inst) case kIROp_IsFloat: case kIROp_IsVector: case kIROp_GetNaturalStride: - case kIROp_TypeEquals: return true; - default: break; + case kIROp_TypeEquals: + return true; + default: + break; } return false; @@ -65,8 +67,10 @@ static ParameterCheckType isPotentiallyUnintended(IRParam* param, Stage stage, i { case kIROp_VerticesType: case kIROp_IndicesType: - case kIROp_PrimitivesType: return Never; - default: break; + case kIROp_PrimitivesType: + return Never; + default: + break; } return AsOut; @@ -87,7 +91,8 @@ static ParameterCheckType isPotentiallyUnintended(IRParam* param, Stage stage, i case Stage::Geometry: // Second parameter is the triangle stream return (index == 1) ? Never : AsInOut; - default: break; + default: + break; } return AsInOut; @@ -105,8 +110,10 @@ static bool isAliasable(IRInst* inst) case kIROp_FieldAddress: case kIROp_GetElement: case kIROp_GetElementPtr: - case kIROp_InOutImplicitCast: return true; - default: break; + case kIROp_InOutImplicitCast: + return true; + default: + break; } return false; @@ -122,8 +129,10 @@ static bool isDifferentiableFunc(IRInst* func) case kIROp_ForwardDifferentiableDecoration: case kIROp_BackwardDerivativeDecoration: case kIROp_BackwardDifferentiableDecoration: - case kIROp_UserDefinedBackwardDerivativeDecoration: return true; - default: break; + case kIROp_UserDefinedBackwardDerivativeDecoration: + return true; + default: + break; } } @@ -288,7 +297,8 @@ static InstructionUsageType getInstructionUsageType(IRInst* user, IRInst* inst) case kIROp_Store: case kIROp_SwizzledStore: case kIROp_SPIRVAsm: - case kIROp_AtomicStore: return Store; + case kIROp_AtomicStore: + return Store; case kIROp_SPIRVAsmOperandInst: // For SPIRV asm instructions, need to check out the entire @@ -302,7 +312,8 @@ static InstructionUsageType getInstructionUsageType(IRInst* user, IRInst* inst) // Miscellaenous cases case kIROp_ManagedPtrAttach: - case kIROp_Unmodified: return Store; + case kIROp_Unmodified: + return Store; default: // Default case is that if the instruction is a pointer, it @@ -331,9 +342,12 @@ static void collectInstructionByUsage( InstructionUsageType usage = getInstructionUsageType(user, inst); switch (usage) { - case Load: return loads.add(user); - case Store: return stores.add(user); - case StoreParent: return stores.add(user->getParent()); + case Load: + return loads.add(user); + case Store: + return stores.add(user); + case StoreParent: + return stores.add(user->getParent()); } } |
