Page MenuHomePhabricator

Modernize atomic detection and usage
Needs ReviewPublic

Authored by jfb on Jul 30 2019, 5:29 PM.

Details

Summary

Some of the cmake checks are obsolete and make bootstrapping an LLVM build painful: we only need to check for libatomic which we can do in pure C, no need for C++ <atomic>. That leads us to Atomic.h which we can get rid of.

Event Timeline

jfb created this revision.Jul 30 2019, 5:29 PM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptJul 30 2019, 5:29 PM
jfb updated this revision to Diff 212479.Jul 30 2019, 5:30 PM
  • Remove from cmake

This looks like a good simplification, but I think call_once could be simplified more.

llvm/cmake/modules/CheckAtomic.cmake
46

Indentation?

75

Does anything else set LLVM_HAS_ATOMICS?

llvm/include/llvm/Support/Threading.h
111

Not sure we still need the tsan hooks when using std::atomic.

118

Do we actually need thread fences here?