From 3acbe8145c60f4d1e7a180b4602a94269a489df5 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Thu, 27 Apr 2023 12:36:59 +0800 Subject: Fix most of the disabled warnings on gcc/clang (#2839) --- source/slang/slang-ir.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index eefcb9eea..78b62265b 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -1208,7 +1208,7 @@ namespace Slang IRGlobalValueWithCode* IRInsertLoc::getFunc() const { auto pp = getParent(); - if (auto block = as(pp)) + if (const auto block = as(pp)) { pp = pp->getParent(); } @@ -1710,7 +1710,9 @@ namespace Slang Int const* listArgCounts, IRInst* const* const* listArgs) { - m_dedupContext->getInstReplacementMap().tryGetValue((IRInst*)(type), *(IRInst**)&type); + IRInst* instReplacement = type; + m_dedupContext->getInstReplacementMap().tryGetValue(type, instReplacement); + type = (IRType*)instReplacement; if (getIROpInfo(op).flags & kIROpFlag_Hoistable) { @@ -4699,7 +4701,7 @@ namespace Slang { type = getVectorType(matrixType->getElementType(), matrixType->getColumnCount()); } - else if (auto basicType = as(basePtrType->getValueType())) + else if (const auto basicType = as(basePtrType->getValueType())) { // HLSL support things like float.x, in which case we just return the base pointer. return basePtr; @@ -6495,7 +6497,7 @@ namespace Slang { StringBuilder sb; printSlangIRAssembly(sb, module, options, sourceManager); - return sb; + return std::move(sb); } void dumpIR(IRModule* module, const IRDumpOptions& options, SourceManager* sourceManager, ISlangWriter* writer) -- cgit v1.2.3