diff options
author | Wang Pengcheng <wangpengcheng.pp@bytedance.com> | 2024-04-17 21:47:29 +0800 |
---|---|---|
committer | Wang Pengcheng <wangpengcheng.pp@bytedance.com> | 2024-04-17 21:47:29 +0800 |
commit | 7d1b70a3960cdacfa4d7531531a9a921dadd3d88 (patch) | |
tree | ac207bdf9fcb3c3656deafb734acd8f03b40c8db /clang/lib/Parse/ParseOpenACC.cpp | |
parent | c9d96c0d77b67c208aaf7f8f2554f972baa412d2 (diff) | |
parent | e77f6742143d71161f3f1161270648c9b95b2137 (diff) | |
download | llvm-7d1b70a3960cdacfa4d7531531a9a921dadd3d88.zip llvm-7d1b70a3960cdacfa4d7531531a9a921dadd3d88.tar.gz llvm-7d1b70a3960cdacfa4d7531531a9a921dadd3d88.tar.bz2 |
Rebase on #88868users/wangpc-pp/spr/riscv-dont-use-v0-directly-in-patterns
Created using spr 1.3.6-beta.1
Diffstat (limited to 'clang/lib/Parse/ParseOpenACC.cpp')
-rw-r--r-- | clang/lib/Parse/ParseOpenACC.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/clang/lib/Parse/ParseOpenACC.cpp b/clang/lib/Parse/ParseOpenACC.cpp index 91f2b8a..123be47 100644 --- a/clang/lib/Parse/ParseOpenACC.cpp +++ b/clang/lib/Parse/ParseOpenACC.cpp @@ -835,19 +835,23 @@ Parser::OpenACCClauseParseResult Parser::ParseOpenACCClauseParams( case OpenACCClauseKind::Default: { Token DefKindTok = getCurToken(); - if (expectIdentifierOrKeyword(*this)) - break; + if (expectIdentifierOrKeyword(*this)) { + Parens.skipToEnd(); + return OpenACCCanContinue(); + } ConsumeToken(); OpenACCDefaultClauseKind DefKind = getOpenACCDefaultClauseKind(DefKindTok); - if (DefKind == OpenACCDefaultClauseKind::Invalid) + if (DefKind == OpenACCDefaultClauseKind::Invalid) { Diag(DefKindTok, diag::err_acc_invalid_default_clause_kind); - else - ParsedClause.setDefaultDetails(DefKind); + Parens.skipToEnd(); + return OpenACCCanContinue(); + } + ParsedClause.setDefaultDetails(DefKind); break; } case OpenACCClauseKind::If: { @@ -977,6 +981,8 @@ Parser::OpenACCClauseParseResult Parser::ParseOpenACCClauseParams( case OpenACCClauseKind::Self: { assert(DirKind != OpenACCDirectiveKind::Update); ExprResult CondExpr = ParseOpenACCConditionExpr(); + ParsedClause.setConditionDetails(CondExpr.isUsable() ? CondExpr.get() + : nullptr); if (CondExpr.isInvalid()) { Parens.skipToEnd(); |