diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-08-16 13:27:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-15 22:27:00 -0700 |
| commit | 00e2bf1cd3e30cd6560222f620b7f66fa55c1549 (patch) | |
| tree | dbb6270062bba6f0cbb9355438c822e3c97ff2f9 /source/slang/slang-emit-spirv.cpp | |
| parent | 9ec30a1d5ac99ec08f83ad262156a671c35a287d (diff) | |
squash warnings (#3113)
* Remove unused variables
* Silence gcc out of bounds warnings
* Squash strict-aliasing warnings
It is still a naughty thing to be casting to T like this though
* Correct equality check when val is nullptr
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
| -rw-r--r-- | source/slang/slang-emit-spirv.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index a3051fadb..10adb9708 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -2806,11 +2806,7 @@ struct SPIRVEmitContext SpvWord baseId = 0; // Only used in debug build, but we don't want a warning/error for an unused initialized variable - if (auto ptrLikeType = as<IRPointerLikeType>(base->getDataType())) - { - baseId = getID(ensureInst(base)); - } - else if (auto ptrType = as<IRPtrTypeBase>(base->getDataType())) + if (as<IRPointerLikeType>(base->getDataType()) || as<IRPtrTypeBase>(base->getDataType())) { baseId = getID(ensureInst(base)); } |
