diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2020-12-07 09:14:25 -0500 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2020-12-07 17:19:20 -0500 |
commit | 9cd2413f1ca7a7f40132ea3c44f251851aa325c2 (patch) | |
tree | b023d4cd828e280796aaf70da8d6da8e83d30fa9 /clang/lib/Parse/ParseDecl.cpp | |
parent | 234d88ab5053f0c55e0269d80bcb5e03ed2c0555 (diff) | |
download | llvm-9cd2413f1ca7a7f40132ea3c44f251851aa325c2.zip llvm-9cd2413f1ca7a7f40132ea3c44f251851aa325c2.tar.gz llvm-9cd2413f1ca7a7f40132ea3c44f251851aa325c2.tar.bz2 |
[clang] Add a new nullability annotation for swift async: _Nullable_result
_Nullable_result generally like _Nullable, except when being imported into a
swift async method. rdar://70106409
Differential revision: https://reviews.llvm.org/D92495
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index c3c56dd..7ebf06a 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -833,6 +833,7 @@ void Parser::ParseNullabilityTypeSpecifiers(ParsedAttributes &attrs) { switch (Tok.getKind()) { case tok::kw__Nonnull: case tok::kw__Nullable: + case tok::kw__Nullable_result: case tok::kw__Null_unspecified: { IdentifierInfo *AttrName = Tok.getIdentifierInfo(); SourceLocation AttrNameLoc = ConsumeToken(); @@ -3536,6 +3537,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, // Nullability type specifiers. case tok::kw__Nonnull: case tok::kw__Nullable: + case tok::kw__Nullable_result: case tok::kw__Null_unspecified: ParseNullabilityTypeSpecifiers(DS.getAttributes()); continue; @@ -5022,6 +5024,7 @@ bool Parser::isTypeSpecifierQualifier() { case tok::kw__Nonnull: case tok::kw__Nullable: + case tok::kw__Nullable_result: case tok::kw__Null_unspecified: case tok::kw___kindof: @@ -5249,6 +5252,7 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) { case tok::kw__Nonnull: case tok::kw__Nullable: + case tok::kw__Nullable_result: case tok::kw__Null_unspecified: case tok::kw___kindof: @@ -5524,6 +5528,7 @@ void Parser::ParseTypeQualifierListOpt( // Nullability type specifiers. case tok::kw__Nonnull: case tok::kw__Nullable: + case tok::kw__Nullable_result: case tok::kw__Null_unspecified: ParseNullabilityTypeSpecifiers(DS.getAttributes()); continue; |