From 18ac073413a532926518342bfa6ba3144fb42291 Mon Sep 17 00:00:00 2001 From: slangbot <186143334+slangbot@users.noreply.github.com> Date: Thu, 5 Dec 2024 09:08:41 +0000 Subject: [PATCH] format code --- source/slang/slang-ir-legalize-global-values.cpp | 5 ++++- source/slang/slang-ir-legalize-global-values.h | 10 +++++----- source/slang/slang-ir-spirv-legalize.cpp | 12 ++++++------ source/slang/slang-ir-wgsl-legalize.cpp | 4 ++-- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/source/slang/slang-ir-legalize-global-values.cpp b/source/slang/slang-ir-legalize-global-values.cpp index 45f0cdd89c..332bde33b4 100644 --- a/source/slang/slang-ir-legalize-global-values.cpp +++ b/source/slang/slang-ir-legalize-global-values.cpp @@ -158,7 +158,10 @@ bool GlobalInstInliningContextGeneric::shouldInlineInst(IRInst* inst) return result; } -IRInst* GlobalInstInliningContextGeneric::inlineInst(IRBuilder& builder, IRCloneEnv& cloneEnv, IRInst* inst) +IRInst* GlobalInstInliningContextGeneric::inlineInst( + IRBuilder& builder, + IRCloneEnv& cloneEnv, + IRInst* inst) { IRInst* result; if (cloneEnv.mapOldValToNew.tryGetValue(inst, result)) diff --git a/source/slang/slang-ir-legalize-global-values.h b/source/slang/slang-ir-legalize-global-values.h index 8dbafc0c0f..c563b02c9c 100644 --- a/source/slang/slang-ir-legalize-global-values.h +++ b/source/slang/slang-ir-legalize-global-values.h @@ -14,14 +14,14 @@ struct GlobalInstInliningContextGeneric Dictionary m_mapGlobalInstToShouldInline; // Target-specific control over how inlining happens - virtual bool isLegalGlobalInstForTarget(IRInst* inst) =0; - virtual bool isInlinableGlobalInstForTarget(IRInst* inst) =0; - virtual bool shouldBeInlinedForTarget(IRInst* user) =0; - virtual IRInst* getOutsideASM(IRInst* beforeInst) =0; + virtual bool isLegalGlobalInstForTarget(IRInst* inst) = 0; + virtual bool isInlinableGlobalInstForTarget(IRInst* inst) = 0; + virtual bool shouldBeInlinedForTarget(IRInst* user) = 0; + virtual IRInst* getOutsideASM(IRInst* beforeInst) = 0; // Inline global values that can't represented by the target to their use sites. // If this leaves any global unused, then remove it. - void inlineGlobalValuesAndRemoveIfUnused(IRModule * module); + void inlineGlobalValuesAndRemoveIfUnused(IRModule* module); // Opcodes that can exist in global scope, as long as the operands are. bool isLegalGlobalInst(IRInst* inst); diff --git a/source/slang/slang-ir-spirv-legalize.cpp b/source/slang/slang-ir-spirv-legalize.cpp index 1618b639aa..c9764b2032 100644 --- a/source/slang/slang-ir-spirv-legalize.cpp +++ b/source/slang/slang-ir-spirv-legalize.cpp @@ -11,8 +11,8 @@ #include "slang-ir-glsl-legalize.h" #include "slang-ir-insts.h" #include "slang-ir-layout.h" -#include "slang-ir-legalize-mesh-outputs.h" #include "slang-ir-legalize-global-values.h" +#include "slang-ir-legalize-mesh-outputs.h" #include "slang-ir-loop-unroll.h" #include "slang-ir-lower-buffer-element-type.h" #include "slang-ir-peephole.h" @@ -1591,7 +1591,7 @@ struct SPIRVLegalizationContext : public SourceEmitterBase } } - struct GlobalInstInliningContext: public GlobalInstInliningContextGeneric + struct GlobalInstInliningContext : public GlobalInstInliningContextGeneric { bool isLegalGlobalInstForTarget(IRInst* inst) override { @@ -1602,10 +1602,10 @@ struct SPIRVLegalizationContext : public SourceEmitterBase { switch (inst->getOp()) { - case kIROp_SPIRVAsm: - return true; - default: - break; + case kIROp_SPIRVAsm: + return true; + default: + break; } if (as(inst)) diff --git a/source/slang/slang-ir-wgsl-legalize.cpp b/source/slang/slang-ir-wgsl-legalize.cpp index 6b89b45025..afdf412b13 100644 --- a/source/slang/slang-ir-wgsl-legalize.cpp +++ b/source/slang/slang-ir-wgsl-legalize.cpp @@ -1,8 +1,8 @@ #include "slang-ir-wgsl-legalize.h" #include "slang-ir-insts.h" -#include "slang-ir-legalize-varying-params.h" #include "slang-ir-legalize-global-values.h" +#include "slang-ir-legalize-varying-params.h" #include "slang-ir-util.h" #include "slang-ir.h" #include "slang-parameter-binding.h" @@ -1588,7 +1588,7 @@ struct LegalizeWGSLEntryPointContext } }; -struct GlobalInstInliningContext: public GlobalInstInliningContextGeneric +struct GlobalInstInliningContext : public GlobalInstInliningContextGeneric { bool isLegalGlobalInstForTarget(IRInst* /* inst */) override {