[llvm-branch-commits] [polly] c8e7a87 - [CMake] Fix -Wstrict-prototypes

2022-11-10 Thread Tom Stellard via llvm-branch-commits

Author: Sam James
Date: 2022-11-10T16:53:39-08:00
New Revision: c8e7a87b1ed6b00dc2c3543a80c892d5948f8849

URL: 
https://github.com/llvm/llvm-project/commit/c8e7a87b1ed6b00dc2c3543a80c892d5948f8849
DIFF: 
https://github.com/llvm/llvm-project/commit/c8e7a87b1ed6b00dc2c3543a80c892d5948f8849.diff

LOG: [CMake] Fix -Wstrict-prototypes

Fixes warnings (or errors, if someone injects -Werror in their build system,
which happens in fact with some folks vendoring LLVM too) with Clang 16:
```
+/var/tmp/portage.notmp/portage/sys-devel/llvm-15.0.4/work/llvm_build-abi_x86_64.amd64/CMakeFiles/CMakeTmp/src.c:3:9:
 warning: a function declaration without a prototype
is deprecated in all versions of C [-Wstrict-prototypes]
-/var/tmp/portage.notmp/portage/sys-devel/llvm-14.0.4/work/llvm_build-abi_x86_64.amd64/CMakeFiles/CMakeTmp/src.c:3:9:
 error: a function declaration without a prototype is
deprecated in all versions of C [-Werror,-Wstrict-prototypes]
 int main() {return 0;}
 ^
  void
```

Differential Revision: https://reviews.llvm.org/D137503

(cherry picked from commit 32a2af44e1e882f13d1cc2817f0a8d4d8b375d4d)

Added: 


Modified: 
compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
compiler-rt/cmake/config-ix.cmake
compiler-rt/lib/builtins/CMakeLists.txt
libcxx/cmake/config-ix.cmake
libcxxabi/cmake/config-ix.cmake
libunwind/cmake/config-ix.cmake
lldb/tools/debugserver/source/CMakeLists.txt
llvm/cmake/config-ix.cmake
llvm/cmake/modules/FindFFI.cmake
llvm/cmake/modules/FindTerminfo.cmake
llvm/cmake/modules/FindZ3.cmake
llvm/cmake/modules/HandleLLVMOptions.cmake
openmp/runtime/cmake/config-ix.cmake
polly/lib/External/CMakeLists.txt

Removed: 




diff  --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake 
b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
index 2c9983c6a1ae3..640c7e7124c99 100644
--- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -116,7 +116,7 @@ function(darwin_test_archs os valid_archs)
   if(NOT TEST_COMPILE_ONLY)
 message(STATUS "Finding valid architectures for ${os}...")
 set(SIMPLE_C ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/src.c)
-file(WRITE ${SIMPLE_C} "#include \nint main() { printf(__FILE__); 
return 0; }\n")
+file(WRITE ${SIMPLE_C} "#include \nint main(void) { 
printf(__FILE__); return 0; }\n")
 
 set(os_linker_flags)
 foreach(flag ${DARWIN_${os}_LINK_FLAGS})

diff  --git a/compiler-rt/cmake/config-ix.cmake 
b/compiler-rt/cmake/config-ix.cmake
index cd45176cf2ba7..9077e8f9ffe04 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -209,7 +209,7 @@ set(COMPILER_RT_SUPPORTED_ARCH)
 # runtime libraries supported by our current compilers cross-compiling
 # abilities.
 set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.cc)
-file(WRITE ${SIMPLE_SOURCE} "#include \n#include \nint 
main() { printf(\"hello, world\"); }\n")
+file(WRITE ${SIMPLE_SOURCE} "#include \n#include \nint 
main(void) { printf(\"hello, world\"); }\n")
 
 # Detect whether the current target platform is 32-bit or 64-bit, and setup
 # the correct commandline flags needed to attempt to target 32-bit and 64-bit.

diff  --git a/compiler-rt/lib/builtins/CMakeLists.txt 
b/compiler-rt/lib/builtins/CMakeLists.txt
index ec668e294d6d7..df02682ae00f9 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -745,7 +745,7 @@ else ()
SOURCE "#if !(__ARM_FP & 0x8)
#error No double-precision support!
#endif
-   int main() { return 0; }")
+   int main(void) { return 0; }")
   if(NOT COMPILER_RT_HAS_${arch}_VFP_DP)
 list(REMOVE_ITEM ${arch}_SOURCES ${arm_Thumb1_VFPv2_DP_SOURCES})
   endif()

diff  --git a/libcxx/cmake/config-ix.cmake b/libcxx/cmake/config-ix.cmake
index 209e6214a4718..e65d320728528 100644
--- a/libcxx/cmake/config-ix.cmake
+++ b/libcxx/cmake/config-ix.cmake
@@ -94,7 +94,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
   set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unknown-pragmas")
   check_c_source_compiles("
 #pragma comment(lib, \"c\")
-int main() { return 0; }
+int main(void) { return 0; }
 " C_SUPPORTS_COMMENT_LIB_PRAGMA)
   cmake_pop_check_state()
 endif()

diff  --git a/libcxxabi/cmake/config-ix.cmake b/libcxxabi/cmake/config-ix.cmake
index 079cabf25da5a..fa16a108e98ad 100644
--- a/libcxxabi/cmake/config-ix.cmake
+++ b/libcxxabi/cmake/config-ix.cmake
@@ -77,7 +77,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
   set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unknown-pragmas")
   check_c_source_compiles("
 #pragma comment(lib, \"c\")
-int main() { re

[llvm-branch-commits] [clang] 931b6d5 - Reenable POSIX builtin library functions in gnu2x mode

2022-11-10 Thread Tom Stellard via llvm-branch-commits

Author: Aaron Ballman
Date: 2022-11-10T16:55:23-08:00
New Revision: 931b6d51d84e2a5cbbdc925d546819d4d3b7c63e

URL: 
https://github.com/llvm/llvm-project/commit/931b6d51d84e2a5cbbdc925d546819d4d3b7c63e
DIFF: 
https://github.com/llvm/llvm-project/commit/931b6d51d84e2a5cbbdc925d546819d4d3b7c63e.diff

LOG: Reenable POSIX builtin library functions in gnu2x mode

gnu17 and earlier modes automatically expose several POSIX C APIs, and
this was accidentally disabled for gnu2x in
7d644e1215b376ec5e915df9ea2eeb56e2d94626.

This restores the behavior for gnu2x mode (without changing the
behavior in C standards modes instead of GNU modes).

Fixes #56607

Added: 
clang/test/Sema/gnu-builtins.c

Modified: 
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaLookup.cpp

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index a1ee8f0459aed..13cca2ebbfb89 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -227,6 +227,10 @@ Bug Fixes
   `Issue 57377 `_.
 - Fix a crash when a ``btf_type_tag`` attribute is applied to the pointee of
   a function pointer.
+- Clang 14 predeclared some builtin POSIX library functions in ``gnu2x`` mode,
+  and Clang 15 accidentally stopped predeclaring those functions in that
+  language mode. Clang 16 now predeclares those functions again. This fixes
+  `Issue 56607 `_.
 
 Improvements to Clang's diagnostics
 ^^^

diff  --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 68158ec977cfe..5d0d87fd2422d 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -939,11 +939,9 @@ bool Sema::LookupBuiltin(LookupResult &R) {
 
   // If this is a builtin on this (or all) targets, create the decl.
   if (unsigned BuiltinID = II->getBuiltinID()) {
-// In C++, C2x, and OpenCL (spec v1.2 s6.9.f), we don't have any
-// predefined library functions like 'malloc'. Instead, we'll just
-// error.
-if ((getLangOpts().CPlusPlus || getLangOpts().OpenCL ||
- getLangOpts().C2x) &&
+// In C++ and OpenCL (spec v1.2 s6.9.f), we don't have any predefined
+// library functions like 'malloc'. Instead, we'll just error.
+if ((getLangOpts().CPlusPlus || getLangOpts().OpenCL) &&
 Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID))
   return false;
 

diff  --git a/clang/test/Sema/gnu-builtins.c b/clang/test/Sema/gnu-builtins.c
new file mode 100644
index 0..c4da8b39363cd
--- /dev/null
+++ b/clang/test/Sema/gnu-builtins.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -fsyntax-only -verify=gnu -std=gnu17 %s
+// RUN: %clang_cc1 -fsyntax-only -verify=gnu -std=gnu2x %s
+// RUN: %clang_cc1 -fsyntax-only -verify=std -std=c17 %s
+// RUN: %clang_cc1 -fsyntax-only -verify=std -std=c2x %s
+
+// std-no-diagnostics
+
+// 'index' is a builtin library function, but only in GNU mode. So this should
+// give an error in GNU modes but be okay in non-GNU mode.
+// FIXME: the error is correct, but these notes are pretty awful.
+int index; // gnu-error {{redefinition of 'index' as 
diff erent kind of symbol}} \
+  gnu-note {{unguarded header; consider using #ifdef guards or 
#pragma once}} \
+  gnu-note {{previous definition is here}}



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 6750e34 - [TypePromotion] Replace Zext to Truncate for the case src bitwidth is larger

2022-11-10 Thread Tom Stellard via llvm-branch-commits

Author: chenglin.bi
Date: 2022-11-10T17:00:50-08:00
New Revision: 6750e341b076d10a336c662ed6916500fdb20105

URL: 
https://github.com/llvm/llvm-project/commit/6750e341b076d10a336c662ed6916500fdb20105
DIFF: 
https://github.com/llvm/llvm-project/commit/6750e341b076d10a336c662ed6916500fdb20105.diff

LOG: [TypePromotion] Replace Zext to Truncate for the case src bitwidth is 
larger

Fix: https://github.com/llvm/llvm-project/issues/58843

Reviewed By: samtebbs

Differential Revision: https://reviews.llvm.org/D137613

(cherry picked from commit 597f44409236bf7fa933a4ce18af23772e28fb43)

Added: 
llvm/test/Transforms/TypePromotion/AArch64/pr58843.ll

Modified: 
llvm/lib/CodeGen/TypePromotion.cpp

Removed: 




diff  --git a/llvm/lib/CodeGen/TypePromotion.cpp 
b/llvm/lib/CodeGen/TypePromotion.cpp
index 8dc8d381ad166..a63118067139f 100644
--- a/llvm/lib/CodeGen/TypePromotion.cpp
+++ b/llvm/lib/CodeGen/TypePromotion.cpp
@@ -569,7 +569,8 @@ void IRPromoter::TruncateSinks() {
 void IRPromoter::Cleanup() {
   LLVM_DEBUG(dbgs() << "IR Promotion: Cleanup..\n");
   // Some zexts will now have become redundant, along with their trunc
-  // operands, so remove them
+  // operands, so remove them.
+  // Some zexts need to be replaced with truncate if src bitwidth is larger.
   for (auto *V : Visited) {
 if (!isa(V))
   continue;
@@ -584,6 +585,11 @@ void IRPromoter::Cleanup() {
 << "\n");
   ReplaceAllUsersOfWith(ZExt, Src);
   continue;
+} else if (ZExt->getSrcTy()->getScalarSizeInBits() > PromotedWidth) {
+  IRBuilder<> Builder{ZExt};
+  Value *Trunc = Builder.CreateTrunc(Src, ZExt->getDestTy());
+  ReplaceAllUsersOfWith(ZExt, Trunc);
+  continue;
 }
 
 // We've inserted a trunc for a zext sink, but we already know that the

diff  --git a/llvm/test/Transforms/TypePromotion/AArch64/pr58843.ll 
b/llvm/test/Transforms/TypePromotion/AArch64/pr58843.ll
new file mode 100644
index 0..983a32029c652
--- /dev/null
+++ b/llvm/test/Transforms/TypePromotion/AArch64/pr58843.ll
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -mtriple=aarch64 -type-promotion -verify -S %s -o - | FileCheck %s
+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
+
+; Check the case don't crash due to zext source type bitwidth
+; larger than dest type bitwidth.
+define i1 @test(i8 %arg) {
+; CHECK-LABEL: @test(
+; CHECK-NEXT:[[EXT1:%.*]] = zext i8 [[ARG:%.*]] to i64
+; CHECK-NEXT:[[TMP1:%.*]] = and i64 [[EXT1]], 7
+; CHECK-NEXT:[[TMP2:%.*]] = trunc i64 [[TMP1]] to i32
+; CHECK-NEXT:[[CMP:%.*]] = icmp ne i32 [[TMP2]], 0
+; CHECK-NEXT:ret i1 [[CMP]]
+;
+  %ext1 = zext i8 %arg to i64
+  %trunc = trunc i64 %ext1 to i3
+  %ext2 = zext i3 %trunc to i8
+  %cmp = icmp ne i8 %ext2, 0
+  ret i1 %cmp
+}



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] d75ae21 - Set LLVM_ATOMIC_LIB variable for convenient linking against libatomic

2022-11-10 Thread Tom Stellard via llvm-branch-commits

Author: Sam James
Date: 2022-11-10T17:04:34-08:00
New Revision: d75ae21044ad893572855cefb0c0898a771b2094

URL: 
https://github.com/llvm/llvm-project/commit/d75ae21044ad893572855cefb0c0898a771b2094
DIFF: 
https://github.com/llvm/llvm-project/commit/d75ae21044ad893572855cefb0c0898a771b2094.diff

LOG: Set LLVM_ATOMIC_LIB variable for convenient linking against libatomic

* Set LLVM_ATOMIC_LIB to keep track of when we need to link against libatomic.
* Add detection of mold linker which is required for this.
* Use --as-needed when linking against libatomic as a bonus. On some platforms,
  libatomic may be required only sometimes.

Bug: https://bugs.gentoo.org/832675
Thanks-to: Arfrever Frehtes Taifersar Arahesis 
Tested-by: erhar...@mailbox.org 

Differential Revision: https://reviews.llvm.org/D136280

(cherry picked from commit fa981b541365190ae646d2dce575706cd0626cf7)

Added: 


Modified: 
llvm/cmake/modules/AddLLVM.cmake
llvm/cmake/modules/CheckAtomic.cmake
llvm/lib/Support/CMakeLists.txt
llvm/tools/dsymutil/CMakeLists.txt

Removed: 




diff  --git a/llvm/cmake/modules/AddLLVM.cmake 
b/llvm/cmake/modules/AddLLVM.cmake
index 057431208322e..1f0507f395cf6 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -212,6 +212,7 @@ if (NOT DEFINED LLVM_LINKER_DETECTED AND NOT WIN32)
   else()
 if("${stdout}" MATCHES "^mold")
   set(LLVM_LINKER_DETECTED YES CACHE INTERNAL "")
+  set(LLVM_LINKER_IS_MOLD YES CACHE INTERNAL "")
   message(STATUS "Linker detection: mold")
 elseif("${stdout}" MATCHES "GNU gold")
   set(LLVM_LINKER_DETECTED YES CACHE INTERNAL "")

diff  --git a/llvm/cmake/modules/CheckAtomic.cmake 
b/llvm/cmake/modules/CheckAtomic.cmake
index 3c5ba72993a3a..f11cadf39ff6b 100644
--- a/llvm/cmake/modules/CheckAtomic.cmake
+++ b/llvm/cmake/modules/CheckAtomic.cmake
@@ -82,6 +82,19 @@ elseif(LLVM_COMPILER_IS_GCC_COMPATIBLE OR 
CMAKE_CXX_COMPILER_ID MATCHES "XL")
   endif()
 endif()
 
+# Set variable LLVM_ATOMIC_LIB specifying flags for linking against libatomic.
+if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
+  # Use options --push-state, --as-needed and --pop-state if linker is known 
to support them.
+  # Use single option -Wl of compiler driver to avoid incorrect re-ordering of 
options by CMake.
+  if(LLVM_LINKER_IS_GNULD OR LLVM_LINKER_IS_GOLD OR LLVM_LINKER_IS_LLD OR 
LLVM_LINKER_IS_MOLD)
+set(LLVM_ATOMIC_LIB "-Wl,--push-state,--as-needed,-latomic,--pop-state")
+  else()
+set(LLVM_ATOMIC_LIB "-latomic")
+  endif()
+else()
+  set(LLVM_ATOMIC_LIB)
+endif()
+
 ## TODO: This define is only used for the legacy atomic operations in
 ## llvm's Atomic.h, which should be replaced.  Other code simply
 ## assumes C++11  works.

diff  --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index 806cbc884cc5d..ff23ec74df962 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -59,9 +59,7 @@ elseif( CMAKE_HOST_UNIX )
   if( LLVM_ENABLE_TERMINFO )
 set(imported_libs ${imported_libs} Terminfo::terminfo)
   endif()
-  if( LLVM_ENABLE_THREADS AND (HAVE_LIBATOMIC OR HAVE_CXX_LIBATOMICS64) )
-set(system_libs ${system_libs} atomic)
-  endif()
+  set(system_libs ${system_libs} ${LLVM_ATOMIC_LIB})
   set(system_libs ${system_libs} ${LLVM_PTHREAD_LIB})
   if( UNIX AND NOT (BEOS OR HAIKU) )
 set(system_libs ${system_libs} m)

diff  --git a/llvm/tools/dsymutil/CMakeLists.txt 
b/llvm/tools/dsymutil/CMakeLists.txt
index a255c1c5daf51..38028cd3d80a3 100644
--- a/llvm/tools/dsymutil/CMakeLists.txt
+++ b/llvm/tools/dsymutil/CMakeLists.txt
@@ -40,6 +40,4 @@ if(APPLE)
   target_link_libraries(dsymutil PRIVATE "-framework CoreFoundation")
 endif(APPLE)
 
-if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
-  target_link_libraries(dsymutil PRIVATE atomic)
-endif()
+target_link_libraries(dsymutil PRIVATE ${LLVM_ATOMIC_LIB})



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] 4c3d838 - Link liblldCOFF against libatomic when necessary

2022-11-10 Thread Tom Stellard via llvm-branch-commits

Author: Sam James
Date: 2022-11-10T17:04:34-08:00
New Revision: 4c3d83810ad7bde70b2665df9a15947695e92adb

URL: 
https://github.com/llvm/llvm-project/commit/4c3d83810ad7bde70b2665df9a15947695e92adb
DIFF: 
https://github.com/llvm/llvm-project/commit/4c3d83810ad7bde70b2665df9a15947695e92adb.diff

LOG: Link liblldCOFF against libatomic when necessary

Also simplify code for liblldCommon using the new LLVM_ATOMIC_LIB variable.

Depends on D136280.

Bug: https://bugs.gentoo.org/832675
Thanks-to: Arfrever Frehtes Taifersar Arahesis 
Tested-by: erhar...@mailbox.org 

Differential Revision: https://reviews.llvm.org/D136281

(cherry picked from commit f0b451c77f14947e3e7d314f048679fa2f5c6298)

Added: 


Modified: 
lld/COFF/CMakeLists.txt
lld/Common/CMakeLists.txt

Removed: 




diff  --git a/lld/COFF/CMakeLists.txt b/lld/COFF/CMakeLists.txt
index d289bd5910348..55aec26854c8d 100644
--- a/lld/COFF/CMakeLists.txt
+++ b/lld/COFF/CMakeLists.txt
@@ -44,6 +44,7 @@ add_lld_library(lldCOFF
   LINK_LIBS
   lldCommon
   ${LLVM_PTHREAD_LIB}
+  ${LLVM_ATOMIC_LIB}
 
   DEPENDS
   COFFOptionsTableGen

diff  --git a/lld/Common/CMakeLists.txt b/lld/Common/CMakeLists.txt
index 1ae7da1f5f7f0..9c23ed3952235 100644
--- a/lld/Common/CMakeLists.txt
+++ b/lld/Common/CMakeLists.txt
@@ -1,9 +1,3 @@
-set(LLD_SYSTEM_LIBS ${LLVM_PTHREAD_LIB})
-
-if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
-  list(APPEND LLD_SYSTEM_LIBS atomic)
-endif()
-
 find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
 find_first_existing_vc_file("${LLD_SOURCE_DIR}" lld_vc)
 
@@ -54,7 +48,8 @@ add_lld_library(lldCommon
   Target
 
   LINK_LIBS
-  ${LLD_SYSTEM_LIBS}
+  ${LLVM_PTHREAD_LIB}
+  ${LLVM_ATOMIC_LIB}
 
   DEPENDS
   intrinsics_gen



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 0988add - Link libclangBasic against libatomic when necessary.

2022-11-10 Thread Tom Stellard via llvm-branch-commits

Author: Sam James
Date: 2022-11-10T17:04:34-08:00
New Revision: 0988addf2680b3717be47fd6f2493f33fe886f90

URL: 
https://github.com/llvm/llvm-project/commit/0988addf2680b3717be47fd6f2493f33fe886f90
DIFF: 
https://github.com/llvm/llvm-project/commit/0988addf2680b3717be47fd6f2493f33fe886f90.diff

LOG: Link libclangBasic against libatomic when necessary.

This is necessary at least on PPC32.

Depends on D136280.

Bug: https://bugs.gentoo.org/874024
Thanks-to: Arfrever Frehtes Taifersar Arahesis 
Tested-by: erhar...@mailbox.org 

Differential Revision: https://reviews.llvm.org/D136282

(cherry picked from commit 20132d8eaa68a6c53e152718beda1dc0f4c9ff6c)

Added: 


Modified: 
clang/CMakeLists.txt
clang/lib/Basic/CMakeLists.txt

Removed: 




diff  --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 13d76e7fd935a..e3bc4b468fb66 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -117,6 +117,7 @@ if(CLANG_BUILT_STANDALONE)
   include(TableGen)
   include(HandleLLVMOptions)
   include(VersionFromVCS)
+  include(CheckAtomic)
   include(GetErrcMessages)
   include(LLVMDistributionSupport)
 

diff  --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt
index 3e052c0cf9957..c38c9fddb4240 100644
--- a/clang/lib/Basic/CMakeLists.txt
+++ b/clang/lib/Basic/CMakeLists.txt
@@ -110,3 +110,7 @@ add_clang_library(clangBasic
   omp_gen
   )
 
+target_link_libraries(clangBasic
+  PRIVATE
+  ${LLVM_ATOMIC_LIB}
+)



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits