Reactor: Disable more warnings to get LLVM 10 building
There's yet more unnecessary semicolons knocking around in the public LLVM headers, which are purely stylistic issues. Just silence them.
`LegacyIRCompileLayer` is now annotated with deprecated, so we need to disable the warning for that too (and move to the new JIT in time).
Bug: b/152339534
Change-Id: Id84fe88fd2f6b50000e37a8b84f52742ca9db646
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43010
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1912aa9..8c96ad3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -476,6 +476,7 @@
"-Wno-unused-private-field" # private field 'offset' is not used - TODO: Consider enabling this once Vulkan is further implemented.
"-Wno-comment" # multi-line comment
"-Wno-undefined-var-template" # instantiation of variable 'X' required here, but no definition is available
+ "-Wno-extra-semi" # extra ';' after member function definition
# Silence errors caused by unknown warnings when building with older
# versions of Clang. This demands checking that warnings added above
diff --git a/src/Reactor/LLVMJIT.cpp b/src/Reactor/LLVMJIT.cpp
index e1b1cb7..6dd5c48 100644
--- a/src/Reactor/LLVMJIT.cpp
+++ b/src/Reactor/LLVMJIT.cpp
@@ -18,13 +18,6 @@
#include "ExecutableMemory.hpp"
#include "Routine.hpp"
-#if defined(__clang__)
-// LLVM has occurrences of the extra-semi warning in its headers, which will be
-// treated as an error in SwiftShader targets.
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wextra-semi"
-#endif // defined(__clang__)
-
// TODO(b/143539525): Eliminate when warning has been fixed.
#ifdef _MSC_VER
__pragma(warning(push))
@@ -60,10 +53,6 @@
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/GVN.h"
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif // defined(__clang__)
-
#ifdef _MSC_VER
__pragma(warning(pop))
#endif
@@ -595,6 +584,17 @@
#endif
public:
+#if defined(__clang__)
+// TODO(bclayton): Switch to new JIT
+// error: 'LegacyIRCompileLayer' is deprecated: ORCv1 layers (layers with the 'Legacy' prefix) are deprecated.
+// Please use the ORCv2 IRCompileLayer instead [-Werror,-Wdeprecated-declarations]
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(__GNUC__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
JITRoutine(
std::unique_ptr<llvm::Module> module,
llvm::Function **funcs,
@@ -638,6 +638,13 @@
})
, addresses(count)
{
+
+#if defined(__clang__)
+# pragma clang diagnostic pop
+#elif defined(__GNUC__)
+# pragma GCC diagnostic pop
+#endif
+
std::vector<std::string> mangledNames(count);
for(size_t i = 0; i < count; i++)
{