Skip to content

Commit 475a84e

Browse files
zmodemchromeos-ci-prod
authored andcommitted
Switch IS_TRIVIALLY_RELOCATABLE to __builtin_is_cpp_trivially_relocatable
__is_trivially_relocatable is deprecated since llvm/llvm-project#138835 Bug: 416394845 Change-Id: I10c9e8a2adec49f9f3b3b7c3606bdf7027b01a10 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6534163 Reviewed-by: Daniel Cheng <[email protected]> Auto-Submit: Hans Wennborg <[email protected]> Commit-Queue: Daniel Cheng <[email protected]> Cr-Commit-Position: refs/heads/main@{#1458903} CrOS-Libchrome-Original-Commit: 4ed2c83bf081877d7929eb20655fe4768f71c984
1 parent 1579d98 commit 475a84e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

base/compiler_specific.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,15 +587,19 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
587587
//
588588
// See also:
589589
// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1144r8.html
590-
// https://clang.llvm.org/docs/LanguageExtensions.html#:~:text=__is_trivially_relocatable
590+
// https://clang.llvm.org/docs/LanguageExtensions.html#:~:text=__builtin_is_cpp_trivially_relocatable
591591
//
592592
// Usage:
593593
// ```
594594
// if constexpr (IS_TRIVIALLY_RELOCATABLE(T)) {
595595
// // This block will only be executed if type `T` is trivially relocatable.
596596
// }
597597
// ```
598-
#if HAS_BUILTIN(__is_trivially_relocatable)
598+
#if HAS_BUILTIN(__builtin_is_cpp_trivially_relocatable)
599+
#define IS_TRIVIALLY_RELOCATABLE(t) __builtin_is_cpp_trivially_relocatable(t)
600+
#elif HAS_BUILTIN(__is_trivially_relocatable)
601+
// TODO(crbug.com/416394845): This is deprecated. Remove once all toolchains
602+
// have __builtin_is_cpp_trivially_relocatable.
599603
#define IS_TRIVIALLY_RELOCATABLE(t) __is_trivially_relocatable(t)
600604
#else
601605
#define IS_TRIVIALLY_RELOCATABLE(t) false

0 commit comments

Comments
 (0)