summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index e72686d045c..d326edfd63f 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -1088,6 +1088,7 @@ bool LLParser::ParseFnAttributeValuePairs(AttrBuilder &B,
case lltok::kw_nonnull:
case lltok::kw_returned:
case lltok::kw_sret:
+ case lltok::kw_swifterror:
case lltok::kw_swiftself:
HaveError |=
Error(Lex.getLoc(),
@@ -1362,6 +1363,7 @@ bool LLParser::ParseOptionalParamAttrs(AttrBuilder &B) {
case lltok::kw_returned: B.addAttribute(Attribute::Returned); break;
case lltok::kw_signext: B.addAttribute(Attribute::SExt); break;
case lltok::kw_sret: B.addAttribute(Attribute::StructRet); break;
+ case lltok::kw_swifterror: B.addAttribute(Attribute::SwiftError); break;
case lltok::kw_swiftself: B.addAttribute(Attribute::SwiftSelf); break;
case lltok::kw_zeroext: B.addAttribute(Attribute::ZExt); break;
@@ -1450,6 +1452,7 @@ bool LLParser::ParseOptionalReturnAttrs(AttrBuilder &B) {
case lltok::kw_nocapture:
case lltok::kw_returned:
case lltok::kw_sret:
+ case lltok::kw_swifterror:
case lltok::kw_swiftself:
HaveError |= Error(Lex.getLoc(), "invalid use of parameter-only attribute");
break;
@@ -5802,7 +5805,8 @@ bool LLParser::ParseCall(Instruction *&Inst, PerFunctionState &PFS,
//===----------------------------------------------------------------------===//
/// ParseAlloc
-/// ::= 'alloca' 'inalloca'? Type (',' TypeAndValue)? (',' 'align' i32)?
+/// ::= 'alloca' 'inalloca'? 'swifterror'? Type (',' TypeAndValue)?
+/// (',' 'align' i32)?
int LLParser::ParseAlloc(Instruction *&Inst, PerFunctionState &PFS) {
Value *Size = nullptr;
LocTy SizeLoc, TyLoc;
@@ -5810,6 +5814,7 @@ int LLParser::ParseAlloc(Instruction *&Inst, PerFunctionState &PFS) {
Type *Ty = nullptr;
bool IsInAlloca = EatIfPresent(lltok::kw_inalloca);
+ bool IsSwiftError = EatIfPresent(lltok::kw_swifterror);
if (ParseType(Ty, TyLoc)) return true;
@@ -5834,6 +5839,7 @@ int LLParser::ParseAlloc(Instruction *&Inst, PerFunctionState &PFS) {
AllocaInst *AI = new AllocaInst(Ty, Size, Alignment);
AI->setUsedWithInAlloca(IsInAlloca);
+ AI->setSwiftError(IsSwiftError);
Inst = AI;
return AteExtraComma ? InstExtraComma : InstNormal;
}
OpenPOWER on IntegriCloud