mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-20 06:43:14 +01:00
Fixed atomic_store and atomic_load instrinsics
This commit is contained in:
@@ -948,7 +948,7 @@ DValue* CallExp::toElem(IRState* p)
|
||||
LLValue* ptr = exp2->toElem(p)->getRVal();
|
||||
llvm::StoreInst* ret = gIR->ir->CreateStore(val, ptr, "tmp");
|
||||
ret->setAtomic(llvm::AtomicOrdering(atomicOrdering));
|
||||
ret->setAlignment(exp1->type->alignsize());
|
||||
ret->setAlignment(getTypeAllocSize(val->getType()));
|
||||
return NULL;
|
||||
// atomic load instruction
|
||||
} else if (fndecl->llvmInternal == LLVMatomic_load) {
|
||||
@@ -957,7 +957,7 @@ DValue* CallExp::toElem(IRState* p)
|
||||
LLValue* ptr = exp->toElem(p)->getRVal();
|
||||
Type* retType = exp->type->nextOf();
|
||||
llvm::LoadInst* val = gIR->ir->CreateLoad(ptr, "tmp");
|
||||
val->setAlignment(retType->alignsize());
|
||||
val->setAlignment(getTypeAllocSize(val->getType()));
|
||||
val->setAtomic(llvm::AtomicOrdering(atomicOrdering));
|
||||
return new DImValue(retType, val);
|
||||
// cmpxchg instruction
|
||||
|
||||
Reference in New Issue
Block a user