From 30f515a9101da65de3ca32306c9de80fb16c9f92 Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Mon, 13 Feb 2023 11:14:13 +0000 Subject: [PATCH] [libc] Fix LIBC_LOOP_NOUNROLL being a noop --- libc/src/__support/macros/optimization.h | 5 +++-- utils/bazel/llvm-project-overlay/libc/BUILD.bazel | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libc/src/__support/macros/optimization.h b/libc/src/__support/macros/optimization.h index ebd11e6..707ecd4 100644 --- a/libc/src/__support/macros/optimization.h +++ b/libc/src/__support/macros/optimization.h @@ -10,7 +10,8 @@ #ifndef LLVM_LIBC_SRC_SUPPORT_MACROS_OPTIMIZATION_H #define LLVM_LIBC_SRC_SUPPORT_MACROS_OPTIMIZATION_H -#include "src/__support/macros/config.h" // LIBC_HAS_BUILTIN +#include "src/__support/macros/config.h" // LIBC_HAS_BUILTIN +#include "src/__support/macros/properties/compiler.h" // LIBC_COMPILER_IS_CLANG // We use a template to implement likely/unlikely to make sure that we don't // accidentally pass an integer. @@ -28,7 +29,7 @@ constexpr LIBC_INLINE bool expects_bool_condition(T value, T expected) { #elif defined(LIBC_COMPILER_IS_GCC) #define LIBC_LOOP_NOUNROLL _Pragma("GCC unroll 0") #else -#define LIBC_LOOP_NOUNROLL +#error "Unhandled compiler" #endif #endif /* LLVM_LIBC_SRC_SUPPORT_MACROS_OPTIMIZATION_H */ diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel index a2e90ed..d5ba402 100644 --- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel @@ -95,6 +95,7 @@ libc_support_library( hdrs = ["src/__support/macros/optimization.h"], deps = [ ":__support_macros_config", + ":__support_macros_properties_compiler", ":libc_root", ], ) -- 2.7.4