[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-18 Thread via cfe-commits
https://github.com/c8ef closed https://github.com/llvm/llvm-project/pull/112539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-18 Thread via cfe-commits
c8ef wrote: ``` Clang :: Analysis/diagnostics/sarif-diagnostics-taint-test.c Clang :: Analysis/diagnostics/sarif-multi-diagnostic-test.c Clang :: CXX/drs/cwg3xx.cpp ``` These test failures are unrelated and have been observed in other CI runs. Let's go ahead and merge this for now. https://git

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-18 Thread via cfe-commits
https://github.com/c8ef updated https://github.com/llvm/llvm-project/pull/112539 >From dfa1585af3f080987cbd15830c45c34bfecc1fca Mon Sep 17 00:00:00 2001 From: c8ef Date: Wed, 16 Oct 2024 01:18:13 + Subject: [PATCH 01/11] implement constexpr builtin {l}abs --- clang/include/clang/Basic/Buil

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-18 Thread via cfe-commits
c8ef wrote: Thank you for all your reviews! If there are no further comments, I will proceed with merging this after updating the branch. https://github.com/llvm/llvm-project/pull/112539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-17 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/112539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-17 Thread via cfe-commits
@@ -265,6 +265,15 @@ namespace fpclassify { char classify_subnorm [__builtin_fpclassify(-1, -1, -1, +1, -1, 1.0e-38f)]; } +namespace abs { + static_assert(__builtin_abs(14) == 14, ""); + static_assert(__builtin_labs(14L) == 14L, ""); + static_assert(__builtin_llabs(14LL)

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-17 Thread via cfe-commits
https://github.com/c8ef updated https://github.com/llvm/llvm-project/pull/112539 >From dfa1585af3f080987cbd15830c45c34bfecc1fca Mon Sep 17 00:00:00 2001 From: c8ef Date: Wed, 16 Oct 2024 01:18:13 + Subject: [PATCH 01/11] implement constexpr builtin {l}abs --- clang/include/clang/Basic/Buil

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-17 Thread via cfe-commits
@@ -265,6 +265,15 @@ namespace fpclassify { char classify_subnorm [__builtin_fpclassify(-1, -1, -1, +1, -1, 1.0e-38f)]; } +namespace abs { + static_assert(__builtin_abs(14) == 14, ""); + static_assert(__builtin_labs(14L) == 14L, ""); + static_assert(__builtin_llabs(14LL)

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-17 Thread via cfe-commits
c8ef wrote: > Please add an entry to `clang/docs/ReleaseNotes.rst`, thanks! Done. https://github.com/llvm/llvm-project/pull/112539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-17 Thread via cfe-commits
@@ -563,6 +563,19 @@ static bool interp__builtin_fabs(InterpState &S, CodePtr OpPC, return true; } +static bool interp__builtin_abs(InterpState &S, CodePtr OpPC, +const InterpFrame *Frame, const Function *Func, +

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-17 Thread via cfe-commits
@@ -265,6 +265,15 @@ namespace fpclassify { char classify_subnorm [__builtin_fpclassify(-1, -1, -1, +1, -1, 1.0e-38f)]; } +namespace abs { +static_assert(__builtin_abs(14) == 14, ""); +static_assert(__builtin_labs(14L) == 14L, ""); +static_assert(__builtin_llabs(14LL) == 14L

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-17 Thread via cfe-commits
https://github.com/c8ef updated https://github.com/llvm/llvm-project/pull/112539 >From dfa1585af3f080987cbd15830c45c34bfecc1fca Mon Sep 17 00:00:00 2001 From: c8ef Date: Wed, 16 Oct 2024 01:18:13 + Subject: [PATCH 01/10] implement constexpr builtin {l}abs --- clang/include/clang/Basic/Buil

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-17 Thread via cfe-commits
cor3ntin wrote: Please add an entry to `clang/docs/ReleaseNotes.rst`, thanks! https://github.com/llvm/llvm-project/pull/112539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-17 Thread Timm Baeder via cfe-commits
@@ -563,6 +563,19 @@ static bool interp__builtin_fabs(InterpState &S, CodePtr OpPC, return true; } +static bool interp__builtin_abs(InterpState &S, CodePtr OpPC, +const InterpFrame *Frame, const Function *Func, +

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-17 Thread Timm Baeder via cfe-commits
@@ -265,6 +265,15 @@ namespace fpclassify { char classify_subnorm [__builtin_fpclassify(-1, -1, -1, +1, -1, 1.0e-38f)]; } +namespace abs { +static_assert(__builtin_abs(14) == 14, ""); +static_assert(__builtin_labs(14L) == 14L, ""); +static_assert(__builtin_llabs(14LL) == 14L

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (c8ef) Changes According to [P0533R9](https://wg21.link/P0533R9), the C++ standard library functions corresponding to the C macros in `[c.math.abs]` are now `constexpr`. To implement this feature in libc++, we must make the built-in

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-16 Thread via cfe-commits
https://github.com/c8ef ready_for_review https://github.com/llvm/llvm-project/pull/112539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-16 Thread via cfe-commits
https://github.com/c8ef updated https://github.com/llvm/llvm-project/pull/112539 >From dfa1585af3f080987cbd15830c45c34bfecc1fca Mon Sep 17 00:00:00 2001 From: c8ef Date: Wed, 16 Oct 2024 01:18:13 + Subject: [PATCH 1/9] implement constexpr builtin {l}abs --- clang/include/clang/Basic/Builti

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-16 Thread via cfe-commits
https://github.com/c8ef edited https://github.com/llvm/llvm-project/pull/112539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in abs function. (PR #112539)

2024-10-16 Thread via cfe-commits
https://github.com/c8ef edited https://github.com/llvm/llvm-project/pull/112539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits