Commit 09a7f45f by Ben Clayton

CMakeLists: Fix REACTOR_EMIT_DEBUG_INFO builds

ENABLE_RR_DEBUG_INFO was not being passed to the ReactorLLVM target. This introduced a subtle calling mismatch as the RValue<T> copy constructor is conditionally added only when ENABLE_RR_DEBUG_INFO is defined. This would cause parameters to go out of sync for inlined functions (not entirely sure I understand the underlying cause here), leading to hilarity. This change also moves "-fno-exceptions" back to the global cpp_flags. This is a true global setting and should not have been moved to SWIFTSHADER_COMPILE_OPTIONS. Change-Id: Ib20777f1ee4b443358ada667902f9a6a1ac3513a Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29932Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent eac32c45
...@@ -229,8 +229,9 @@ if(MSVC) ...@@ -229,8 +229,9 @@ if(MSVC)
add_definitions(-D_SBCS) # Single Byte Character Set (ASCII) add_definitions(-D_SBCS) # Single Byte Character Set (ASCII)
else() else()
set_cpp_flag("--std=c++11") set_cpp_flag("--std=c++11")
set_cpp_flag("-fno-exceptions")
list(APPEND SWIFTSHADER_COMPILE_OPTIONS list(APPEND SWIFTSHADER_COMPILE_OPTIONS
"-fno-exceptions"
"-Wall" "-Wall"
"-Werror=reorder" "-Werror=reorder"
"-Werror=sign-compare" "-Werror=sign-compare"
...@@ -1883,6 +1884,7 @@ if(${REACTOR_BACKEND} STREQUAL "LLVM") ...@@ -1883,6 +1884,7 @@ if(${REACTOR_BACKEND} STREQUAL "LLVM")
INCLUDE_DIRECTORIES "${COMMON_INCLUDE_DIR}" INCLUDE_DIRECTORIES "${COMMON_INCLUDE_DIR}"
POSITION_INDEPENDENT_CODE 1 POSITION_INDEPENDENT_CODE 1
FOLDER "Core" FOLDER "Core"
COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
) )
target_link_libraries(ReactorLLVM llvm ${OS_LIBS}) target_link_libraries(ReactorLLVM llvm ${OS_LIBS})
......
...@@ -26,6 +26,13 @@ ...@@ -26,6 +26,13 @@
#undef min #undef min
#undef max #undef max
#if defined(__clang__)
// LLVM has occurances 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__)
#include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/LoopPass.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JITSymbol.h" #include "llvm/ExecutionEngine/JITSymbol.h"
...@@ -52,6 +59,10 @@ ...@@ -52,6 +59,10 @@
#include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/GVN.h" #include "llvm/Transforms/Scalar/GVN.h"
#if defined(__clang__)
#pragma clang diagnostic pop
#endif // defined(__clang__)
#include "LLVMRoutine.hpp" #include "LLVMRoutine.hpp"
#define ARGS(...) {__VA_ARGS__} #define ARGS(...) {__VA_ARGS__}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment