Skip to content

Commit

Permalink
rustllvm: update to SyncScope::ID
Browse files Browse the repository at this point in the history
  • Loading branch information
TimNN committed Jul 21, 2017
1 parent 48424c9 commit a536767
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/rustllvm/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,18 @@ enum class LLVMRustSynchronizationScope {
CrossThread,
};

#if LLVM_VERSION_GE(5, 0)
static SyncScope::ID fromRust(LLVMRustSynchronizationScope Scope) {
switch (Scope) {
case LLVMRustSynchronizationScope::SingleThread:
return SyncScope::SingleThread;
case LLVMRustSynchronizationScope::CrossThread:
return SyncScope::System;
default:
llvm_unreachable("bad SynchronizationScope.");
}
}
#else
static SynchronizationScope fromRust(LLVMRustSynchronizationScope Scope) {
switch (Scope) {
case LLVMRustSynchronizationScope::SingleThread:
Expand All @@ -277,6 +289,7 @@ static SynchronizationScope fromRust(LLVMRustSynchronizationScope Scope) {
llvm_unreachable("bad SynchronizationScope.");
}
}
#endif

extern "C" LLVMValueRef
LLVMRustBuildAtomicFence(LLVMBuilderRef B, LLVMAtomicOrdering Order,
Expand Down

0 comments on commit a536767

Please sign in to comment.