aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2024-05-02 15:22:01 +0000
committerDavid Spickett <david.spickett@linaro.org>2024-05-02 15:22:01 +0000
commitcb5d6a5639ab17933f127456cee9167fb0ed6439 (patch)
tree295c5fef0d26f85233d4712c8b1f48920d42f3b1
parentab8ac36f10eef3d50d3a6fc8168c98298b643698 (diff)
downloadllvm-cb5d6a5639ab17933f127456cee9167fb0ed6439.zip
llvm-cb5d6a5639ab17933f127456cee9167fb0ed6439.tar.gz
llvm-cb5d6a5639ab17933f127456cee9167fb0ed6439.tar.bz2
[llvm][ADT] Fix Arm 32 bit compilation warning in lazy atomic pointer
LazyAtomicPointer.h:36:49: warning: implicit conversion from 'unsigned long long' to 'uintptr_t' (aka 'unsigned int') changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion] static constexpr uintptr_t getBusy() { return -1ULL; } On 32 bit Arm ULL is an unsigned long long which is 8 bytes, but uintptr_t is 4 bytes. Instead of using a value, use the macro UINTPTR_MAX that will be the correctly sized value.
-rw-r--r--llvm/include/llvm/ADT/LazyAtomicPointer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/include/llvm/ADT/LazyAtomicPointer.h b/llvm/include/llvm/ADT/LazyAtomicPointer.h
index 8905847..c4fd389 100644
--- a/llvm/include/llvm/ADT/LazyAtomicPointer.h
+++ b/llvm/include/llvm/ADT/LazyAtomicPointer.h
@@ -33,7 +33,7 @@ namespace llvm {
/// std::atomic<T>::notify_all() in \a loadOrGenerate().
template <class T> class LazyAtomicPointer {
static constexpr uintptr_t getNull() { return 0; }
- static constexpr uintptr_t getBusy() { return -1ULL; }
+ static constexpr uintptr_t getBusy() { return UINTPTR_MAX; }
static T *makePointer(uintptr_t Value) {
assert(Value != getBusy());