Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/IR/Instructions.cpp
Show First 20 Lines • Show All 1,365 Lines • ▼ Show 20 Lines | |||||
StoreInst::StoreInst(Value *val, Value *addr, Instruction *InsertBefore) | StoreInst::StoreInst(Value *val, Value *addr, Instruction *InsertBefore) | ||||
: StoreInst(val, addr, /*isVolatile=*/false, InsertBefore) {} | : StoreInst(val, addr, /*isVolatile=*/false, InsertBefore) {} | ||||
StoreInst::StoreInst(Value *val, Value *addr, BasicBlock *InsertAtEnd) | StoreInst::StoreInst(Value *val, Value *addr, BasicBlock *InsertAtEnd) | ||||
: StoreInst(val, addr, /*isVolatile=*/false, InsertAtEnd) {} | : StoreInst(val, addr, /*isVolatile=*/false, InsertAtEnd) {} | ||||
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, | StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, | ||||
Instruction *InsertBefore) | Instruction *InsertBefore) | ||||
: StoreInst(val, addr, isVolatile, /*Align=*/0, InsertBefore) {} | : StoreInst(val, addr, isVolatile, /*Align=*/None, InsertBefore) {} | ||||
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, | StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, | ||||
BasicBlock *InsertAtEnd) | BasicBlock *InsertAtEnd) | ||||
: StoreInst(val, addr, isVolatile, /*Align=*/0, InsertAtEnd) {} | : StoreInst(val, addr, isVolatile, /*Align=*/None, InsertAtEnd) {} | ||||
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, unsigned Align, | StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, MaybeAlign Align, | ||||
Instruction *InsertBefore) | Instruction *InsertBefore) | ||||
: StoreInst(val, addr, isVolatile, Align, AtomicOrdering::NotAtomic, | : StoreInst(val, addr, isVolatile, Align, AtomicOrdering::NotAtomic, | ||||
SyncScope::System, InsertBefore) {} | SyncScope::System, InsertBefore) {} | ||||
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, unsigned Align, | StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, MaybeAlign Align, | ||||
BasicBlock *InsertAtEnd) | BasicBlock *InsertAtEnd) | ||||
: StoreInst(val, addr, isVolatile, Align, AtomicOrdering::NotAtomic, | : StoreInst(val, addr, isVolatile, Align, AtomicOrdering::NotAtomic, | ||||
SyncScope::System, InsertAtEnd) {} | SyncScope::System, InsertAtEnd) {} | ||||
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, | StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, MaybeAlign Align, | ||||
unsigned Align, AtomicOrdering Order, | AtomicOrdering Order, SyncScope::ID SSID, | ||||
SyncScope::ID SSID, | |||||
Instruction *InsertBefore) | Instruction *InsertBefore) | ||||
: Instruction(Type::getVoidTy(val->getContext()), Store, | : Instruction(Type::getVoidTy(val->getContext()), Store, | ||||
OperandTraits<StoreInst>::op_begin(this), | OperandTraits<StoreInst>::op_begin(this), | ||||
OperandTraits<StoreInst>::operands(this), | OperandTraits<StoreInst>::operands(this), InsertBefore) { | ||||
InsertBefore) { | |||||
Op<0>() = val; | Op<0>() = val; | ||||
Op<1>() = addr; | Op<1>() = addr; | ||||
setVolatile(isVolatile); | setVolatile(isVolatile); | ||||
setAlignment(MaybeAlign(Align)); | setAlignment(Align); | ||||
setAtomic(Order, SSID); | setAtomic(Order, SSID); | ||||
AssertOK(); | AssertOK(); | ||||
} | } | ||||
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, | StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, MaybeAlign Align, | ||||
unsigned Align, AtomicOrdering Order, | AtomicOrdering Order, SyncScope::ID SSID, | ||||
SyncScope::ID SSID, | |||||
BasicBlock *InsertAtEnd) | BasicBlock *InsertAtEnd) | ||||
: Instruction(Type::getVoidTy(val->getContext()), Store, | : Instruction(Type::getVoidTy(val->getContext()), Store, | ||||
OperandTraits<StoreInst>::op_begin(this), | OperandTraits<StoreInst>::op_begin(this), | ||||
OperandTraits<StoreInst>::operands(this), | OperandTraits<StoreInst>::operands(this), InsertAtEnd) { | ||||
InsertAtEnd) { | |||||
Op<0>() = val; | Op<0>() = val; | ||||
Op<1>() = addr; | Op<1>() = addr; | ||||
setVolatile(isVolatile); | setVolatile(isVolatile); | ||||
setAlignment(MaybeAlign(Align)); | setAlignment(Align); | ||||
setAtomic(Order, SSID); | setAtomic(Order, SSID); | ||||
AssertOK(); | AssertOK(); | ||||
} | } | ||||
void StoreInst::setAlignment(MaybeAlign Align) { | void StoreInst::setAlignment(MaybeAlign Align) { | ||||
assert((!Align || *Align <= MaximumAlignment) && | assert((!Align || *Align <= MaximumAlignment) && | ||||
"Alignment is greater than MaximumAlignment!"); | "Alignment is greater than MaximumAlignment!"); | ||||
setInstructionSubclassData((getSubclassDataFromInstruction() & ~(31 << 1)) | | setInstructionSubclassData((getSubclassDataFromInstruction() & ~(31 << 1)) | | ||||
▲ Show 20 Lines • Show All 2,715 Lines • ▼ Show 20 Lines | |||||
LoadInst *LoadInst::cloneImpl() const { | LoadInst *LoadInst::cloneImpl() const { | ||||
return new LoadInst(getType(), getOperand(0), Twine(), isVolatile(), | return new LoadInst(getType(), getOperand(0), Twine(), isVolatile(), | ||||
MaybeAlign(getAlignment()), getOrdering(), | MaybeAlign(getAlignment()), getOrdering(), | ||||
getSyncScopeID()); | getSyncScopeID()); | ||||
} | } | ||||
StoreInst *StoreInst::cloneImpl() const { | StoreInst *StoreInst::cloneImpl() const { | ||||
return new StoreInst(getOperand(0), getOperand(1), isVolatile(), | return new StoreInst(getOperand(0), getOperand(1), isVolatile(), | ||||
getAlignment(), getOrdering(), getSyncScopeID()); | MaybeAlign(getAlignment()), getOrdering(), | ||||
getSyncScopeID()); | |||||
} | } | ||||
AtomicCmpXchgInst *AtomicCmpXchgInst::cloneImpl() const { | AtomicCmpXchgInst *AtomicCmpXchgInst::cloneImpl() const { | ||||
AtomicCmpXchgInst *Result = | AtomicCmpXchgInst *Result = | ||||
new AtomicCmpXchgInst(getOperand(0), getOperand(1), getOperand(2), | new AtomicCmpXchgInst(getOperand(0), getOperand(1), getOperand(2), | ||||
getSuccessOrdering(), getFailureOrdering(), | getSuccessOrdering(), getFailureOrdering(), | ||||
getSyncScopeID()); | getSyncScopeID()); | ||||
Result->setVolatile(isVolatile()); | Result->setVolatile(isVolatile()); | ||||
▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines |