My own comments:
This looks fine since it removes code duplication across multiple
subprojects. Have you tested that both libcxx and lldb work correctly when
using this module as opposed to the existing ones?
This seems generally fine but:
- I'd love Chris B to look at this to make sure he likes it too.
- Pretty sure LLVM itself needs to use this. Can you update LLVM's CMake to switch to this routine?
This looks reasonable to me. Is there a reason for having this as a new CMake module instead of just adding it to CheckAtomic.cmake?
It seems to me it could be reasonable to modify CheckAtomic.cmake to test for both 32-bit and 64-bit atomics.