diff options
author | Alexandre Ganea <alex_toresh@yahoo.fr> | 2024-01-02 22:20:50 -0500 |
---|---|---|
committer | Alexandre Ganea <alex_toresh@yahoo.fr> | 2024-01-17 07:23:57 -0500 |
commit | 6736cc60ed85e52c26d6643301d45c7d98a85698 (patch) | |
tree | ed6ed456edb4dde73581f1060bd26f01f30ff3cb /compiler-rt | |
parent | 6f8b633d0b0615c2f46f818b70901d880c205631 (diff) | |
download | llvm-6736cc60ed85e52c26d6643301d45c7d98a85698.zip llvm-6736cc60ed85e52c26d6643301d45c7d98a85698.tar.gz llvm-6736cc60ed85e52c26d6643301d45c7d98a85698.tar.bz2 |
[ORC-RT] Silence warning when building with Clang ToT on Windows
This fixes several of these:
```
[3524/7446] Building CXX object projects\compiler-rt\lib\orc\CMakeFiles\RTOrc.x86_64.dir\dlfcn_wrapper.cpp.obj
In file included from C:\git\llvm-project\compiler-rt\lib\orc\dlfcn_wrapper.cpp:15:
C:\git\llvm-project\compiler-rt\lib\orc\wrapper_function_utils.h(299,27): warning: address of '__orc_rt_jit_dispatch_ctx' will always evaluate to 'true' [-Wpointer-bool-conversion]
299 | if (ORC_RT_UNLIKELY(!&__orc_rt_jit_dispatch_ctx))
| ~ ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\git\llvm-project\compiler-rt\lib\orc\compiler.h(60,55): note: expanded from macro 'ORC_RT_UNLIKELY'
60 | #define ORC_RT_UNLIKELY(EXPR) __builtin_expect((bool)(EXPR), false)
| ^~~~
1 warning generated.
```
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/orc/wrapper_function_utils.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler-rt/lib/orc/wrapper_function_utils.h b/compiler-rt/lib/orc/wrapper_function_utils.h index dcb6d0e..8009438 100644 --- a/compiler-rt/lib/orc/wrapper_function_utils.h +++ b/compiler-rt/lib/orc/wrapper_function_utils.h @@ -296,11 +296,15 @@ public: // operation fails. detail::ResultDeserializer<SPSRetTagT, RetT>::makeSafe(Result); + // Since the functions cannot be zero/unresolved on Windows, the following + // reference taking would always be non-zero, thus generating a compiler + // warning otherwise. +#if !defined(_WIN32) if (ORC_RT_UNLIKELY(!&__orc_rt_jit_dispatch_ctx)) return make_error<StringError>("__orc_rt_jit_dispatch_ctx not set"); if (ORC_RT_UNLIKELY(!&__orc_rt_jit_dispatch)) return make_error<StringError>("__orc_rt_jit_dispatch not set"); - +#endif auto ArgBuffer = WrapperFunctionResult::fromSPSArgs<SPSArgList<SPSTagTs...>>(Args...); if (const char *ErrMsg = ArgBuffer.getOutOfBandError()) |