summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-11-18 02:50:40 +0800
committerGitHub <noreply@github.com>2023-11-17 10:50:40 -0800
commit27243ce07880f65f9abb15e38f7176eea9572aac (patch)
treec11db10cd6959cebfb198bc436f8694e404d9a9e
parent240aa243527eabcf87c30aabf9749396de47b1b2 (diff)
warnings (#3335)
* ignores * Remove unused variables * Squash out of bounds warning --------- Co-authored-by: Yong He <yonghe@outlook.com>
-rw-r--r--.gitignore1
-rw-r--r--source/slang/slang-language-server.cpp2
-rw-r--r--source/slang/slang-lower-to-ir.cpp4
-rw-r--r--tools/gfx/d3d12/d3d12-device.cpp1
4 files changed, 4 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index a194be87e..12a1e8e64 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@
*.ini
.clang-format
.gdb_history
+.vimspector
bin/
intermediate/
diff --git a/source/slang/slang-language-server.cpp b/source/slang/slang-language-server.cpp
index e550b23d2..24ab534ab 100644
--- a/source/slang/slang-language-server.cpp
+++ b/source/slang/slang-language-server.cpp
@@ -654,7 +654,7 @@ SlangResult LanguageServer::hover(
{
if (auto declRefExpr = as<DeclRefExpr>(expr))
return fillDeclRefHoverInfo(declRefExpr->declRef);
- else if (auto thisExpr = as<ThisExpr>(expr))
+ else if (as<ThisExpr>(expr))
{
if (expr->type)
{
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index cd9d19bcc..e44419a45 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -8038,8 +8038,6 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo>
// Not clear what to do around HLSLExportModifier.
// The HLSL spec says it only applies to functions, so we ignore for now.
- const bool isPublicType = decl->findModifier<PublicModifier>() != nullptr;
-
// We are going to create nested IR building state
// to use when emitting the members of the type.
//
@@ -9761,7 +9759,7 @@ LoweredValInfo emitDeclRef(
SLANG_UNUSED(initialSubst);
- if (auto thisTypeDecl = as<ThisTypeDecl>(decl))
+ if (as<ThisTypeDecl>(decl))
{
// A declref to ThisType decl should be lowered differently
// from other decls. In general, IFoo<T>.ThisType should lower to
diff --git a/tools/gfx/d3d12/d3d12-device.cpp b/tools/gfx/d3d12/d3d12-device.cpp
index 44a9faa45..cd4dfb7a3 100644
--- a/tools/gfx/d3d12/d3d12-device.cpp
+++ b/tools/gfx/d3d12/d3d12-device.cpp
@@ -1899,6 +1899,7 @@ Result DeviceImpl::createInputLayout(IInputLayout::Desc const& desc, IInputLayou
char* textPos = layout->m_text.getBuffer();
List<D3D12_INPUT_ELEMENT_DESC>& elements = layout->m_elements;
+ SLANG_ASSERT(inputElementCount > 0);
elements.setCount(inputElementCount);
for (Int i = 0; i < inputElementCount; ++i)