Fix warnings raised during release builds Bug: b/123933266 Change-Id: If4dc4858c8a81dd5e7b3510a08e7dbae74051483 Reviewed-on: https://swiftshader-review.googlesource.com/c/25556 Reviewed-by: Nicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp index 74b6261..e589d17 100644 --- a/src/Reactor/LLVMReactor.cpp +++ b/src/Reactor/LLVMReactor.cpp
@@ -118,6 +118,7 @@ rr::MutexLock codegenMutex; +#ifdef ENABLE_RR_PRINT std::string replace(std::string str, const std::string& substr, const std::string& replacement) { size_t pos = 0; @@ -127,6 +128,7 @@ } return str; } +#endif // ENABLE_RR_PRINT #if REACTOR_LLVM_VERSION >= 7 llvm::Value *lowerPAVG(llvm::Value *x, llvm::Value *y) @@ -7532,7 +7534,7 @@ } #endif // defined(__i386__) || defined(__x86_64__) -#if ENABLE_RR_PRINT +#ifdef ENABLE_RR_PRINT // extractAll returns a vector containing the extracted n scalar value of // the vector vec. static std::vector<Value*> extractAll(Value* vec, int n)
diff --git a/src/Reactor/Reactor.hpp b/src/Reactor/Reactor.hpp index ca5a54e..357d0ce 100644 --- a/src/Reactor/Reactor.hpp +++ b/src/Reactor/Reactor.hpp
@@ -3077,9 +3077,9 @@ // args as this appears to still be broken on certain compilers. #define RR_GET_NTH_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, N, ...) N #define RR_COUNT_ARGUMENTS(...) RR_GET_NTH_ARG(__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) - static_assert(1 == RR_COUNT_ARGUMENTS(a)); // Sanity checks. - static_assert(2 == RR_COUNT_ARGUMENTS(a, b)); - static_assert(3 == RR_COUNT_ARGUMENTS(a, b, c)); + static_assert(1 == RR_COUNT_ARGUMENTS(a), "RR_COUNT_ARGUMENTS broken"); // Sanity checks. + static_assert(2 == RR_COUNT_ARGUMENTS(a, b), "RR_COUNT_ARGUMENTS broken"); + static_assert(3 == RR_COUNT_ARGUMENTS(a, b, c), "RR_COUNT_ARGUMENTS broken"); // RR_WATCH_FMT(...) resolves to a string literal that lists all the // arguments by name. This string can be passed to LOG() to print each of