Skip to content

Commit a536767

Browse files
committed
rustllvm: update to SyncScope::ID
1 parent 48424c9 commit a536767

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/rustllvm/RustWrapper.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,18 @@ enum class LLVMRustSynchronizationScope {
267267
CrossThread,
268268
};
269269

270+
#if LLVM_VERSION_GE(5, 0)
271+
static SyncScope::ID fromRust(LLVMRustSynchronizationScope Scope) {
272+
switch (Scope) {
273+
case LLVMRustSynchronizationScope::SingleThread:
274+
return SyncScope::SingleThread;
275+
case LLVMRustSynchronizationScope::CrossThread:
276+
return SyncScope::System;
277+
default:
278+
llvm_unreachable("bad SynchronizationScope.");
279+
}
280+
}
281+
#else
270282
static SynchronizationScope fromRust(LLVMRustSynchronizationScope Scope) {
271283
switch (Scope) {
272284
case LLVMRustSynchronizationScope::SingleThread:
@@ -277,6 +289,7 @@ static SynchronizationScope fromRust(LLVMRustSynchronizationScope Scope) {
277289
llvm_unreachable("bad SynchronizationScope.");
278290
}
279291
}
292+
#endif
280293

281294
extern "C" LLVMValueRef
282295
LLVMRustBuildAtomicFence(LLVMBuilderRef B, LLVMAtomicOrdering Order,

0 commit comments

Comments
 (0)