diff options
| -rw-r--r-- | source/slang/slang-capability.cpp | 4 | ||||
| -rw-r--r-- | source/slang/slang-check-conformance.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-compiler.cpp | 1 | ||||
| -rw-r--r-- | source/slang/slang-ir-autodiff-unzip.h | 2 | ||||
| -rw-r--r-- | source/slang/slang-ir-insert-debug-value-store.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-ir-lower-buffer-element-type.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-ir-metal-legalize.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-ir-pytorch-cpp-binding.cpp | 8 | ||||
| -rw-r--r-- | source/slang/slang-ir-uniformity.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 12 | ||||
| -rw-r--r-- | source/slang/slang-parser.cpp | 1 | ||||
| -rw-r--r-- | source/slang/slang-type-layout.cpp | 4 | ||||
| -rw-r--r-- | tools/gfx/vulkan/vk-device.cpp | 2 | ||||
| -rw-r--r-- | tools/slang-capability-generator/capability-generator-main.cpp | 2 |
14 files changed, 25 insertions, 21 deletions
diff --git a/source/slang/slang-capability.cpp b/source/slang/slang-capability.cpp index 5cd46f631..eae04f277 100644 --- a/source/slang/slang-capability.cpp +++ b/source/slang/slang-capability.cpp @@ -627,8 +627,10 @@ bool CapabilitySet::hasSameTargets(const CapabilitySet& other) const // MSVC incorrectly throws warning +#if defined(_MSC_VER) #pragma warning(push) #pragma warning(disable:4702) +#endif /// returns true if 'this' is a better target for 'targetCaps' than 'that' /// isEqual: is `this` and `that` equal /// isIncompatible: is `this` and `that` incompatible @@ -743,7 +745,9 @@ bool CapabilitySet::isBetterForTarget(CapabilitySet const& that, CapabilitySet c } return true; } +#if defined(_MSC_VER) #pragma warning(pop) +#endif CapabilitySet::AtomSets::Iterator CapabilitySet::getAtomSets() const { diff --git a/source/slang/slang-check-conformance.cpp b/source/slang/slang-check-conformance.cpp index 394d0693f..59547ef0a 100644 --- a/source/slang/slang-check-conformance.cpp +++ b/source/slang/slang-check-conformance.cpp @@ -272,7 +272,7 @@ namespace Slang sized = true; } } - else if (auto intVal = arrayType->getElementCount()) + else if (arrayType->getElementCount()) { sized = true; typeTag = (TypeTag)((int)typeTag | (int)TypeTag::LinkTimeSized); diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 5ef9a50b1..7211a1f6e 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -1669,6 +1669,7 @@ namespace Slang SLANG_UNEXPECTED("unhandled code generation target"); break; } + return SLANG_FAIL; } void EndToEndCompileRequest::writeArtifactToStandardOutput(IArtifact* artifact, DiagnosticSink* sink) diff --git a/source/slang/slang-ir-autodiff-unzip.h b/source/slang/slang-ir-autodiff-unzip.h index 771a3977e..9f18db6e0 100644 --- a/source/slang/slang-ir-autodiff-unzip.h +++ b/source/slang/slang-ir-autodiff-unzip.h @@ -372,7 +372,7 @@ struct DiffUnzipPass } else { - if (auto inOutType = as<IRInOutType>(resolvedPrimalFuncType->getParamType(ii))) + if (as<IRInOutType>(resolvedPrimalFuncType->getParamType(ii))) { // For 'inout' parameter we need to create a temp var to hold the value // before the primal call. This logic is similar to the 'inout' case for differentiable params diff --git a/source/slang/slang-ir-insert-debug-value-store.cpp b/source/slang/slang-ir-insert-debug-value-store.cpp index 46116d660..ee343b263 100644 --- a/source/slang/slang-ir-insert-debug-value-store.cpp +++ b/source/slang/slang-ir-insert-debug-value-store.cpp @@ -180,7 +180,7 @@ namespace Slang Index i = 0; for (; i < accessChain.getCount(); i++) { - if (auto key = as<IRStructKey>(accessChain[i])) + if (as<IRStructKey>(accessChain[i])) { continue; } diff --git a/source/slang/slang-ir-lower-buffer-element-type.cpp b/source/slang/slang-ir-lower-buffer-element-type.cpp index 360596741..981e29697 100644 --- a/source/slang/slang-ir-lower-buffer-element-type.cpp +++ b/source/slang/slang-ir-lower-buffer-element-type.cpp @@ -515,7 +515,7 @@ namespace Slang { // If `type` is already a lowered type, no more lowering is required. LoweredElementTypeInfo info; - if (auto pInfo = mapLoweredTypeToInfo->tryGetValue(type)) + if (mapLoweredTypeToInfo->tryGetValue(type)) { info.originalType = type; info.loweredType = type; diff --git a/source/slang/slang-ir-metal-legalize.cpp b/source/slang/slang-ir-metal-legalize.cpp index f81608316..ae91fd069 100644 --- a/source/slang/slang-ir-metal-legalize.cpp +++ b/source/slang/slang-ir-metal-legalize.cpp @@ -36,7 +36,7 @@ namespace Slang List<IRParam*> paramsToProcess; for (auto param : func->getParams()) { - if (auto structType = as<IRStructType>(param->getDataType())) + if (as<IRStructType>(param->getDataType())) { paramsToProcess.add(param); } diff --git a/source/slang/slang-ir-pytorch-cpp-binding.cpp b/source/slang/slang-ir-pytorch-cpp-binding.cpp index fd885dae7..5105b2e81 100644 --- a/source/slang/slang-ir-pytorch-cpp-binding.cpp +++ b/source/slang/slang-ir-pytorch-cpp-binding.cpp @@ -82,7 +82,7 @@ static IRType* translateToTupleType( } return builder.getTargetTupleType((UInt)elementTypes.getCount(), elementTypes.getBuffer()); } - else if (auto targetTupleType = as<IRTargetTupleType>(type)) + else if (as<IRTargetTupleType>(type)) { return type; } @@ -192,7 +192,7 @@ static IRInst* makeTargetTuple(IRBuilder& builder, IRInst* val) auto resultType = builder.getTargetTupleType((UInt)elementTypes.getCount(), elementTypes.getBuffer()); return builder.emitMakeTargetTuple(resultType, (UInt)resultElements.getCount(), resultElements.getBuffer()); } - else if (auto targetTupleType = as<IRTargetTupleType>(type)) + else if (as<IRTargetTupleType>(type)) { return val; } @@ -284,7 +284,7 @@ static IRInst* makeValueFromTargetTuple(IRBuilder& builder, IRType* type, IRInst } return builder.emitMakeStruct(type, (UInt)resultElements.getCount(), resultElements.getBuffer()); } - else if (auto targetTupleType = as<IRTargetTupleType>(type)) + else if (as<IRTargetTupleType>(type)) { return val; } @@ -1021,7 +1021,7 @@ void lowerBuiltinTypesForKernelEntryPoints(IRModule* module, DiagnosticSink*) // Rebuild the call/dispatch inst. IRInst* newCall = nullptr; - if (auto callInst = as<IRCall>(user)) + if (as<IRCall>(user)) newCall = callBuilder.emitCallInst(user->getFullType(), func, convertedArgs); else if (auto dispatchInst = as<IRDispatchKernel>(user)) newCall = callBuilder.emitDispatchKernelInst( diff --git a/source/slang/slang-ir-uniformity.cpp b/source/slang/slang-ir-uniformity.cpp index d29c0735a..e09b6d89c 100644 --- a/source/slang/slang-ir-uniformity.cpp +++ b/source/slang/slang-ir-uniformity.cpp @@ -97,7 +97,7 @@ namespace Slang // will use the fallback behavior (result is non-uniform if any of its arguments are non-uniform). for (auto block : key.func->getBlocks()) { - if (auto genAsm = as<IRGenericAsm>(block->getTerminator())) + if (as<IRGenericAsm>(block->getTerminator())) { return nullptr; } diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index f2a31a8da..f92ecc92a 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -2224,7 +2224,7 @@ void addVarDecorations( { builder->addSemanticDecoration(inst, hlslSemantic->name.getContent()); } - else if (auto dynamicUniform = as<DynamicUniformModifier>(mod)) + else if (as<DynamicUniformModifier>(mod)) { builder->addDynamicUniformDecoration(inst); } @@ -8629,7 +8629,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> { lowerPackOffsetModifier(fieldKey, packOffsetModifier); } - else if (auto dynamicUniformModifer = as<DynamicUniformModifier>(mod)) + else if (as<DynamicUniformModifier>(mod)) { subBuilder->addDynamicUniformDecoration(fieldKey); } @@ -9774,15 +9774,15 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> { getBuilder()->addSimpleDecoration<IRNoInlineDecoration>(irFunc); } - else if (auto derivativeGroupQuadMod = as<DerivativeGroupQuadAttribute>(modifier)) + else if (as<DerivativeGroupQuadAttribute>(modifier)) { derivativeGroupQuadDecor = getBuilder()->addSimpleDecoration<IRDerivativeGroupQuadDecoration>(irFunc); } - else if (auto derivativeGroupLinearMod = as<DerivativeGroupLinearAttribute>(modifier)) + else if (as<DerivativeGroupLinearAttribute>(modifier)) { derivativeGroupLinearDecor = getBuilder()->addSimpleDecoration<IRDerivativeGroupLinearDecoration>(irFunc); } - else if (auto noRefInlineAttribute = as<NoRefInlineAttribute>(modifier)) + else if (as<NoRefInlineAttribute>(modifier)) { getBuilder()->addSimpleDecoration<IRNoRefInlineDecoration>(irFunc); } @@ -9954,7 +9954,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> getBuilder()->addRequireSPIRVVersionDecoration(irFunc, spvVersion->version); else if (auto cudasmVersion = as<RequiredCUDASMVersionModifier>(modifier)) getBuilder()->addRequireCUDASMVersionDecoration(irFunc, cudasmVersion->version); - else if (auto nonUniform= as<NonDynamicUniformAttribute>(modifier)) + else if (as<NonDynamicUniformAttribute>(modifier)) getBuilder()->addDecoration(irFunc, kIROp_NonDynamicUniformReturnDecoration); } diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index 6f7b0b991..ed579e96d 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -4536,7 +4536,6 @@ namespace Slang parser->pendingModifiers = &modifiers; auto loc = parser->tokenReader.peekLoc(); - auto ptoken = parser->tokenReader.peekToken(); switch (peekTokenType(parser)) { case TokenType::Identifier: diff --git a/source/slang/slang-type-layout.cpp b/source/slang/slang-type-layout.cpp index 83901ecc4..bc7e4608f 100644 --- a/source/slang/slang-type-layout.cpp +++ b/source/slang/slang-type-layout.cpp @@ -4131,7 +4131,7 @@ static TypeLayoutResult _createTypeLayout( type, rules); } - else if (auto subpassType = as<SubpassInputType>(type)) + else if (as<SubpassInputType>(type)) { ShaderParameterKind kind = ShaderParameterKind::SubpassInput; return createSimpleTypeLayout( @@ -4139,7 +4139,7 @@ static TypeLayoutResult _createTypeLayout( type, rules); } - else if (auto atomicType = as<GLSLAtomicUintType>(type)) + else if (as<GLSLAtomicUintType>(type)) { ShaderParameterKind kind = ShaderParameterKind::AtomicUint; return createSimpleTypeLayout( diff --git a/tools/gfx/vulkan/vk-device.cpp b/tools/gfx/vulkan/vk-device.cpp index 03165f606..8ad941ead 100644 --- a/tools/gfx/vulkan/vk-device.cpp +++ b/tools/gfx/vulkan/vk-device.cpp @@ -1678,7 +1678,7 @@ Result DeviceImpl::createTextureResource( break; case SLANG_SCALAR_TYPE_UINT32: for(int i = 0; i < 4; i++) - clearColor.uint32[i] = *reinterpret_cast<uint32_t*>(const_cast<void*>(initData->data)); break; + clearColor.uint32[i] = *reinterpret_cast<uint32_t*>(const_cast<void*>(initData->data)); break; case SLANG_SCALAR_TYPE_INT64: { diff --git a/tools/slang-capability-generator/capability-generator-main.cpp b/tools/slang-capability-generator/capability-generator-main.cpp index f62f7ce20..c34b4c49e 100644 --- a/tools/slang-capability-generator/capability-generator-main.cpp +++ b/tools/slang-capability-generator/capability-generator-main.cpp @@ -418,7 +418,7 @@ void outputUIntSetAsBufferValues(const String& nameOfBuffer, StringBuilder& resu resultBuilder << "const static CapabilityAtomSet " << nameOfBuffer << " = CapabilityAtomSet({\n"; for (auto i : set.getBuffer()) { - resultBuilder << " UIntSet::Element(" << i << "),\n"; + resultBuilder << " UIntSet::Element(" << i << "U),\n"; } resultBuilder << " 0\n});\n"; } |
