Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/AsmParser/LLParser.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 7,010 Lines • ▼ Show 20 Lines | int LLParser::ParseStore(Instruction *&Inst, PerFunctionState &PFS) { | ||||
if (cast<PointerType>(Ptr->getType())->getElementType() != Val->getType()) | if (cast<PointerType>(Ptr->getType())->getElementType() != Val->getType()) | ||||
return Error(Loc, "stored value and pointer type do not match"); | return Error(Loc, "stored value and pointer type do not match"); | ||||
if (isAtomic && !Alignment) | if (isAtomic && !Alignment) | ||||
return Error(Loc, "atomic store must have explicit non-zero alignment"); | return Error(Loc, "atomic store must have explicit non-zero alignment"); | ||||
if (Ordering == AtomicOrdering::Acquire || | if (Ordering == AtomicOrdering::Acquire || | ||||
Ordering == AtomicOrdering::AcquireRelease) | Ordering == AtomicOrdering::AcquireRelease) | ||||
return Error(Loc, "atomic store cannot use Acquire ordering"); | return Error(Loc, "atomic store cannot use Acquire ordering"); | ||||
Inst = new StoreInst(Val, Ptr, isVolatile, Alignment ? Alignment->value() : 0, | Inst = new StoreInst(Val, Ptr, isVolatile, Alignment, Ordering, SSID); | ||||
Ordering, SSID); | |||||
return AteExtraComma ? InstExtraComma : InstNormal; | return AteExtraComma ? InstExtraComma : InstNormal; | ||||
} | } | ||||
/// ParseCmpXchg | /// ParseCmpXchg | ||||
/// ::= 'cmpxchg' 'weak'? 'volatile'? TypeAndValue ',' TypeAndValue ',' | /// ::= 'cmpxchg' 'weak'? 'volatile'? TypeAndValue ',' TypeAndValue ',' | ||||
/// TypeAndValue 'singlethread'? AtomicOrdering AtomicOrdering | /// TypeAndValue 'singlethread'? AtomicOrdering AtomicOrdering | ||||
int LLParser::ParseCmpXchg(Instruction *&Inst, PerFunctionState &PFS) { | int LLParser::ParseCmpXchg(Instruction *&Inst, PerFunctionState &PFS) { | ||||
Value *Ptr, *Cmp, *New; LocTy PtrLoc, CmpLoc, NewLoc; | Value *Ptr, *Cmp, *New; LocTy PtrLoc, CmpLoc, NewLoc; | ||||
▲ Show 20 Lines • Show All 1,852 Lines • Show Last 20 Lines |