This is an archive of the discontinued LLVM Phabricator instance.

Use "long long int" when checking whether atomics are supported.
AbandonedPublic

Authored by vkalintiris on Jan 26 2016, 4:45 PM.

Details

Summary

Some targets implement 4-byte atomic related functions without calling
into libatomic, while for 8-byte atomics they need to make a function
call. By using a long long int we can identify such cases.

Diff Detail

Event Timeline

vkalintiris retitled this revision from to Use "long long int" when checking whether atomics are supported..
vkalintiris updated this object.
vkalintiris added a subscriber: llvm-commits.

What happens on platforms that don't need the lib to make std::atomic<long long int> x; work?

jyknight accepted this revision.Jan 26 2016, 5:21 PM
jyknight edited edge metadata.

What happens on platforms that don't need the lib to make std::atomic<long long int> x; work?

Then the first check succeeds, and they don't get -latomic added to the link line (HAVE_CXX_ATOMICS_WITHOUT_LIB gets set)

This revision is now accepted and ready to land.Jan 26 2016, 5:21 PM
vkalintiris abandoned this revision.Jan 28 2016, 6:13 AM