aboutsummaryrefslogtreecommitdiff
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.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 4281193caf85..769601c7e633 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -1333,6 +1333,13 @@ bool LLParser::parseEnumAttribute(Attribute::AttrKind Attr, AttrBuilder &B,
B.addDereferenceableOrNullAttr(Bytes);
return false;
}
+ case Attribute::UWTable: {
+ UWTableKind Kind;
+ if (parseOptionalUWTableKind(Kind))
+ return true;
+ B.addUWTableAttr(Kind);
+ return false;
+ }
default:
B.addAttribute(Attr);
Lex.Lex();
@@ -1996,6 +2003,22 @@ bool LLParser::parseOptionalDerefAttrBytes(lltok::Kind AttrKind,
return false;
}
+bool LLParser::parseOptionalUWTableKind(UWTableKind &Kind) {
+ Lex.Lex();
+ Kind = UWTableKind::Default;
+ if (!EatIfPresent(lltok::lparen))
+ return false;
+ LocTy KindLoc = Lex.getLoc();
+ if (Lex.getKind() == lltok::kw_sync)
+ Kind = UWTableKind::Sync;
+ else if (Lex.getKind() == lltok::kw_async)
+ Kind = UWTableKind::Async;
+ else
+ return error(KindLoc, "expected unwind table kind");
+ Lex.Lex();
+ return parseToken(lltok::rparen, "expected ')'");
+}
+
/// parseOptionalCommaAlign
/// ::=
/// ::= ',' align 4