Page MenuHomePhabricator

[CMake][NFC] Clean up CheckAtomic.cmake
ClosedPublic

Authored by luismarques on Feb 18 2020, 6:47 AM.

Details

Summary

CheckAtomic.cmake was skipping the test of whether atomics work in MSVC without an atomics library (they do), but not setting the value of HAVE_CXX_ATOMICS_WITHOUT_LIB. That caused build issues when trying to land D69869. I fixed that issue in f128f442a3d, by adding an elseif(MSVC), as was being done below in the 64-bit atomics check. That minimal fix did work, but it kept various inconsistencies between the original atomics check and the 64-bit one. This patch now makes the checks follow the same structure, cleaning them up.

Diff Detail

Event Timeline

luismarques created this revision.Feb 18 2020, 6:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2020, 6:47 AM
lenary accepted this revision.Mar 24 2020, 4:30 AM

I am happy that this is a simple logic refactoring of the original, given LLVM_COMPILER_IS_GCC_COMPATIBLE is currently just true/false based on the MSVC variable.

I am glad both blocks now have the same structure, which helps when debugging build issues.

LGTM (modulo nits below).

llvm/cmake/modules/CheckAtomic.cmake
45

Nit: whitespace before ).

66–67

Nit: whitespace before ).

This revision is now accepted and ready to land.Mar 24 2020, 4:30 AM

Fix whitespace.

luismarques marked 2 inline comments as done.Apr 17 2020, 2:11 PM
This revision was automatically updated to reflect the committed changes.