Pass type when creating atomic load
Instead of determining it from the pointer type, explicitly pass the type to load.
This commit is contained in:
parent
619c27a539
commit
33e9a6b565
5 changed files with 17 additions and 10 deletions
|
@ -349,11 +349,10 @@ extern "C" void LLVMRustSetFastMath(LLVMValueRef V) {
|
|||
}
|
||||
|
||||
extern "C" LLVMValueRef
|
||||
LLVMRustBuildAtomicLoad(LLVMBuilderRef B, LLVMValueRef Source, const char *Name,
|
||||
LLVMAtomicOrdering Order) {
|
||||
LLVMRustBuildAtomicLoad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Source,
|
||||
const char *Name, LLVMAtomicOrdering Order) {
|
||||
Value *Ptr = unwrap(Source);
|
||||
Type *Ty = Ptr->getType()->getPointerElementType();
|
||||
LoadInst *LI = unwrap(B)->CreateLoad(Ty, Ptr, Name);
|
||||
LoadInst *LI = unwrap(B)->CreateLoad(unwrap(Ty), Ptr, Name);
|
||||
LI->setAtomic(fromRust(Order));
|
||||
return wrap(LI);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue