aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunctionPass.cpp
diff options
context:
space:
mode:
authorJF Bastien <jfbastien@apple.com>2018-09-10 20:42:56 +0000
committerJF Bastien <jfbastien@apple.com>2018-09-10 20:42:56 +0000
commite77b48b07840bbbb3c86cd283b07682637ba3869 (patch)
tree742239c737d83b2d52f7731bf1464c79c3fc6fcb /llvm/lib/CodeGen/MachineFunctionPass.cpp
parenta5ae613c15a315ea7e575ea94e058cd6524a0aaf (diff)
downloadllvm-e77b48b07840bbbb3c86cd283b07682637ba3869.zip
llvm-e77b48b07840bbbb3c86cd283b07682637ba3869.tar.gz
llvm-e77b48b07840bbbb3c86cd283b07682637ba3869.tar.bz2
Implement -Watomic-implicit-seq-cst
Summary: _Atomic and __sync_* operations are implicitly sequentially-consistent. Some codebases want to force explicit usage of memory order instead. This warning allows them to know where implicit sequentially-consistent memory order is used. The warning isn't on by default because _Atomic was purposefully designed to have seq_cst as the default: the idea was that it's the right thing to use most of the time. This warning allows developers who disagree to enforce explicit usage instead. A follow-up patch will take care of C++'s std::atomic. It'll be different enough from this patch that I think it should be separate: for C++ the atomic operations all have a memory order parameter (or two), but it's defaulted. I believe this warning should trigger when the default is used, but not when seq_cst is used explicitly (or implicitly as the failure order for cmpxchg). <rdar://problem/28172966> Reviewers: rjmccall Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D51084 llvm-svn: 341860
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunctionPass.cpp')
0 files changed, 0 insertions, 0 deletions