diff options
| author | Yong He <yonghe@outlook.com> | 2017-11-04 19:12:01 -0400 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2017-11-04 19:12:01 -0400 |
| commit | aeb69cb8f617d3a59e2baf38a94224c1cdb4755c (patch) | |
| tree | 6cfd4e48f905de55f542d83ee064615e5b807abd /source | |
| parent | 8c0a429c292ea6735ce1ac14c22125266e8fb6c5 (diff) | |
| parent | c6fb1de9547bd24a693915b758cc35499f1d949f (diff) | |
Merge remote-tracking branch 'refs/remotes/official/master'
Diffstat (limited to 'source')
| -rw-r--r-- | source/core/common.h | 3 | ||||
| -rw-r--r-- | source/slang/lexer.cpp | 1 | ||||
| -rw-r--r-- | source/slang/lower-to-ir.cpp | 6 |
3 files changed, 7 insertions, 3 deletions
diff --git a/source/core/common.h b/source/core/common.h index 3a4543085..17161ab14 100644 --- a/source/core/common.h +++ b/source/core/common.h @@ -74,5 +74,8 @@ namespace Slang #define SLANG_RELEASE_ASSERT(VALUE) if(VALUE) {} else Slang::signalUnexpectedError("assertion failed") #define SLANG_RELEASE_EXPECT(VALUE, WHAT) if(VALUE) {} else SLANG_UNEXPECTED(WHAT) +template<typename T> void slang_use_obj(T&) {} +#define SLANG_UNREFERENCED_PARAMETER(P) slang_use_obj(P) +#define SLANG_UNREFERENCED_VARIABLE(P) slang_use_obj(P) #endif diff --git a/source/slang/lexer.cpp b/source/slang/lexer.cpp index 11c70d1f5..3f8709a9d 100644 --- a/source/slang/lexer.cpp +++ b/source/slang/lexer.cpp @@ -808,6 +808,7 @@ namespace Slang char const* cursor = token.Content.begin(); char const* end = token.Content.end(); + SLANG_UNREFERENCED_VARIABLE(end); auto quote = *cursor++; SLANG_ASSERT(quote == '\'' || quote == '"'); diff --git a/source/slang/lower-to-ir.cpp b/source/slang/lower-to-ir.cpp index e149036a7..a7baf265c 100644 --- a/source/slang/lower-to-ir.cpp +++ b/source/slang/lower-to-ir.cpp @@ -362,7 +362,7 @@ LoweredValInfo emitCompoundAssignOp( IRValue* const* args) { auto builder = context->irBuilder; - + SLANG_UNREFERENCED_PARAMETER(argCount); assert(argCount == 2); auto leftPtr = args[0]; auto rightVal = args[1]; @@ -412,7 +412,7 @@ LoweredValInfo emitPreOp( IRValue* const* args) { auto builder = context->irBuilder; - + SLANG_UNREFERENCED_PARAMETER(argCount); assert(argCount == 1); auto argPtr = args[0]; @@ -436,7 +436,7 @@ LoweredValInfo emitPostOp( IRValue* const* args) { auto builder = context->irBuilder; - + SLANG_UNREFERENCED_PARAMETER(argCount); assert(argCount == 1); auto argPtr = args[0]; |
