Skip to content

Commit 719ee52

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-materialize-constant-vector-tc
2 parents b106c80 + 0c80427 commit 719ee52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1651
-1348
lines changed

clang/lib/AST/OSLog.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
// TODO: header template
1+
//===--- OSLog.cpp - OS log format string analysis ------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
///
9+
/// \file
10+
/// This file implements analysis functions for OS log format strings and
11+
/// buffer layout computation for __builtin_os_log_format and related builtins.
12+
///
13+
//===----------------------------------------------------------------------===//
214

315
#include "clang/AST/OSLog.h"
416
#include "clang/AST/Attr.h"
@@ -137,8 +149,8 @@ class OSLogFormatStringHandler
137149
for (auto &Data : ArgsData) {
138150
if (!Data.MaskType.empty()) {
139151
CharUnits Size = CharUnits::fromQuantity(8);
140-
Layout.Items.emplace_back(OSLogBufferItem::MaskKind, nullptr,
141-
Size, 0, Data.MaskType);
152+
Layout.Items.emplace_back(OSLogBufferItem::MaskKind, nullptr, Size, 0,
153+
Data.MaskType);
142154
}
143155

144156
if (Data.FieldWidth) {

flang-rt/cmake/modules/AddFlangRT.cmake

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -286,27 +286,6 @@ function (add_flangrt_library name)
286286
target_compile_options(${tgtname} PUBLIC -U_LIBCPP_ENABLE_ASSERTIONS)
287287
endif ()
288288

289-
# Flang/Clang (including clang-cl) -compiled programs targeting the MSVC ABI
290-
# should only depend on msvcrt/ucrt. LLVM still emits libgcc/compiler-rt
291-
# functions in some cases like 128-bit integer math (__udivti3, __modti3,
292-
# __fixsfti, __floattidf, ...) that msvc does not support. We are injecting a
293-
# dependency to Compiler-RT's builtin library where these are implemented.
294-
if (MSVC AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
295-
if (FLANG_RT_BUILTINS_LIBRARY)
296-
target_compile_options(${tgtname} PRIVATE "$<$<COMPILE_LANGUAGE:CXX,C>:-Xclang>" "$<$<COMPILE_LANGUAGE:CXX,C>:--dependent-lib=${FLANG_RT_BUILTINS_LIBRARY}>")
297-
endif ()
298-
endif ()
299-
if (MSVC AND CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
300-
if (FLANG_RT_BUILTINS_LIBRARY)
301-
target_compile_options(${tgtname} PRIVATE "$<$<COMPILE_LANGUAGE:Fortran>:-Xflang>" "$<$<COMPILE_LANGUAGE:Fortran>:--dependent-lib=${FLANG_RT_BUILTINS_LIBRARY}>")
302-
else ()
303-
message(WARNING "Did not find libclang_rt.builtins.lib.
304-
LLVM may emit builtins that are not implemented in msvcrt/ucrt and
305-
instead falls back to builtins from Compiler-RT. Linking with ${tgtname}
306-
may result in a linker error.")
307-
endif ()
308-
endif ()
309-
310289
# Non-GTest unittests depend on LLVMSupport
311290
if (ARG_LINK_TO_LLVM)
312291
if (LLVM_LINK_LLVM_DYLIB)

flang-rt/unittests/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,27 @@ function(add_flangrt_unittest_offload_properties target)
6060
endif()
6161
endfunction()
6262

63+
# flang-rt on Windows requires compiler-rt for some symbols. For binaries built
64+
# with flang this dependency is added by the flang driver, but since the unit
65+
# tests are built with clang we need to add the dependency manually.
66+
function(add_flangrt_dependent_libs target)
67+
if (MSVC AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
68+
if (FLANG_RT_BUILTINS_LIBRARY)
69+
target_compile_options(${target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX,C>:-Xclang>" "$<$<COMPILE_LANGUAGE:CXX,C>:--dependent-lib=${FLANG_RT_BUILTINS_LIBRARY}>")
70+
endif ()
71+
endif ()
72+
if (MSVC AND CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
73+
if (FLANG_RT_BUILTINS_LIBRARY)
74+
target_compile_options(${target} PRIVATE "$<$<COMPILE_LANGUAGE:Fortran>:-Xflang>" "$<$<COMPILE_LANGUAGE:Fortran>:--dependent-lib=${FLANG_RT_BUILTINS_LIBRARY}>")
75+
else ()
76+
message(WARNING "Did not find libclang_rt.builtins.lib.
77+
LLVM may emit builtins that are not implemented in msvcrt/ucrt and
78+
instead falls back to builtins from Compiler-RT. Linking with ${tgtname}
79+
may result in a linker error.")
80+
endif ()
81+
endif ()
82+
endfunction()
83+
6384

6485
function(add_flangrt_unittest test_dirname)
6586
cmake_parse_arguments(ARG
@@ -72,6 +93,7 @@ function(add_flangrt_unittest test_dirname)
7293

7394
target_link_libraries(${test_dirname} PRIVATE ${ARG_LINK_LIBS})
7495
add_flangrt_unittest_offload_properties(${test_dirname})
96+
add_flangrt_dependent_libs(${test_dirname})
7597

7698
# Required because LLVMSupport is compiled with this option.
7799
# FIXME: According to CMake documentation, this is the default. Why is it
@@ -99,6 +121,7 @@ function(add_flangrt_nongtest_unittest test_name)
99121
set_target_properties(${test_name}${suffix} PROPERTIES FOLDER "Flang-RT/Tests/Unit")
100122

101123
target_link_libraries(${test_name}${suffix} PRIVATE NonGTestTesting ${ARG_LINK_LIBS})
124+
add_flangrt_dependent_libs(${test_name}${suffix})
102125

103126
if(NOT ARG_SLOW_TEST)
104127
add_dependencies(FlangRTUnitTests ${test_name}${suffix})

libc/src/__support/math/acos.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace LIBC_NAMESPACE_DECL {
2424

2525
namespace math {
2626

27-
static constexpr double acos(double x) {
27+
LIBC_INLINE static constexpr double acos(double x) {
2828
using DoubleDouble = fputil::DoubleDouble;
2929
using namespace asin_internal;
3030
using FPBits = fputil::FPBits<double>;

libc/src/__support/math/acosf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static constexpr fputil::ExceptValues<float, N_EXCEPTS> ACOSF_EXCEPTS = {{
4545

4646
} // namespace acosf_internal
4747

48-
static constexpr float acosf(float x) {
48+
LIBC_INLINE static constexpr float acosf(float x) {
4949
using namespace acosf_internal;
5050
using namespace inv_trigf_utils_internal;
5151
using FPBits = typename fputil::FPBits<float>;

libc/src/__support/math/acosf16.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace LIBC_NAMESPACE_DECL {
2626

2727
namespace math {
2828

29-
static constexpr float16 acosf16(float16 x) {
29+
LIBC_INLINE static constexpr float16 acosf16(float16 x) {
3030

3131
// Generated by Sollya using the following command:
3232
// > round(pi/2, SG, RN);

libc/src/__support/math/acoshf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace LIBC_NAMESPACE_DECL {
2121

2222
namespace math {
2323

24-
static constexpr float acoshf(float x) {
24+
LIBC_INLINE static constexpr float acoshf(float x) {
2525
using namespace acoshf_internal;
2626
using FPBits_t = typename fputil::FPBits<float>;
2727
FPBits_t xbits(x);

libc/src/__support/math/acoshf16.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace LIBC_NAMESPACE_DECL {
2828

2929
namespace math {
3030

31-
static constexpr float16 acoshf16(float16 x) {
31+
LIBC_INLINE static constexpr float16 acoshf16(float16 x) {
3232

3333
using namespace acoshf_internal;
3434
constexpr size_t N_EXCEPTS = 2;

libc/src/__support/math/acospif16.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace LIBC_NAMESPACE_DECL {
2525

2626
namespace math {
2727

28-
static constexpr float16 acospif16(float16 x) {
28+
LIBC_INLINE static constexpr float16 acospif16(float16 x) {
2929
using FPBits = fputil::FPBits<float16>;
3030
FPBits xbits(x);
3131

libc/src/__support/math/asin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace LIBC_NAMESPACE_DECL {
2525

2626
namespace math {
2727

28-
static constexpr double asin(double x) {
28+
LIBC_INLINE static constexpr double asin(double x) {
2929
using namespace asin_internal;
3030
using FPBits = fputil::FPBits<double>;
3131

0 commit comments

Comments
 (0)