Add singlethreaded fence intrinsics.

These new intrinsics are comparable to `atomic_signal_fence` in C++,
ensuring the compiler will not reorder memory accesses across the
barrier, nor will it emit any machine instructions for it.

Closes #24118, implementing RFC 888.
This commit is contained in:
Peter Marheine
2015-02-14 23:48:10 -07:00
parent 0d8309ec0b
commit 998c10d6b6
7 changed files with 43 additions and 11 deletions

View File

@@ -189,8 +189,10 @@ extern "C" LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B,
failure_order
));
}
extern "C" LLVMValueRef LLVMBuildAtomicFence(LLVMBuilderRef B, AtomicOrdering order) {
return wrap(unwrap(B)->CreateFence(order));
extern "C" LLVMValueRef LLVMBuildAtomicFence(LLVMBuilderRef B,
AtomicOrdering order,
SynchronizationScope scope) {
return wrap(unwrap(B)->CreateFence(order, scope));
}
extern "C" void LLVMSetDebug(int Enabled) {