diff options
author | David Spickett <david.spickett@linaro.org> | 2024-05-02 16:30:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-02 16:30:02 +0100 |
commit | f5b4e20a5ab8e0d8f7e3909cfdc0c82e4cf507c3 (patch) | |
tree | 52a30100d9aa312911344ba0c6d68df9337b2905 /llvm/lib/IR/Module.cpp | |
parent | 646559e90b8370a2d6459b65ecca31a98b5fad0e (diff) | |
download | llvm-f5b4e20a5ab8e0d8f7e3909cfdc0c82e4cf507c3.zip llvm-f5b4e20a5ab8e0d8f7e3909cfdc0c82e4cf507c3.tar.gz llvm-f5b4e20a5ab8e0d8f7e3909cfdc0c82e4cf507c3.tar.bz2 |
[llvm][AArch64] Fix Arm 32 bit build warnings (#90862)
https://github.com/llvm/llvm-project/pull/84173 added uses of std::labs
on an int64_t which leads to this warning on Arm 32 bit:
```
/home/david.spickett/llvm-project/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:16655:12: warning: absolute value function 'labs' given an argument of type 'long long' but has parameter of type 'long' which may cause truncation of value [-Wabsolute-value]
return std::labs(Imm / 4) <= 16;
^
/home/david.spickett/llvm-project/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:16655:12: note: use function 'std::abs' instead
return std::labs(Imm / 4) <= 16;
^~~~~~~~~
std::abs
```
Since int64_t is "long long" on Arm, not "long".
Use std::abs instead since it has versions for "long" and "long long",
we'll pick up the right one at compile time
(https://en.cppreference.com/w/cpp/numeric/math/abs).
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions