diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-04-27 12:36:59 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-26 21:36:59 -0700 |
| commit | 3acbe8145c60f4d1e7a180b4602a94269a489df5 (patch) | |
| tree | 8031e7ca897260ac3ab6d2a920864f3114bc8668 /source/slang/slang-ir.cpp | |
| parent | a3da31c189a1cc9bdf85a42ac359b8c2777f3550 (diff) | |
Fix most of the disabled warnings on gcc/clang (#2839)
Diffstat (limited to 'source/slang/slang-ir.cpp')
| -rw-r--r-- | source/slang/slang-ir.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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<IRBlock>(pp)) + if (const auto block = as<IRBlock>(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<IRBasicType>(basePtrType->getValueType())) + else if (const auto basicType = as<IRBasicType>(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) |
