[ubsan] Drop use of __atomic_exchange_n for now to fix build for some.

Need a more reliable way to check for support of this intrinsic.

llvm-svn: 171955
This commit is contained in:
Will Dietz 2013-01-09 06:18:40 +00:00
parent cc951b284b
commit b50565b21a
1 changed files with 0 additions and 6 deletions

View File

@ -64,13 +64,7 @@ public:
/// \brief Atomically acquire a copy, disabling original in-place. /// \brief Atomically acquire a copy, disabling original in-place.
/// Exactly one call to acquire() returns a copy that isn't disabled. /// Exactly one call to acquire() returns a copy that isn't disabled.
SourceLocation acquire() { SourceLocation acquire() {
#ifdef __ATOMIC_RELAXED
// Use weaker ordering if available (relaxed/monotonic)
u32 OldColumn = __atomic_exchange_n(&Column, ~u32(0), __ATOMIC_RELAXED);
#else
// Otherwise, do a TAS which has acquire semantics, stronger than needed.
u32 OldColumn = __sync_lock_test_and_set(&Column, ~u32(0)); u32 OldColumn = __sync_lock_test_and_set(&Column, ~u32(0));
#endif
return SourceLocation(Filename, Line, OldColumn); return SourceLocation(Filename, Line, OldColumn);
} }