Skip to content

Commit

Permalink
[OpenACC] Correct serialization of certain clause sub-expressions
Browse files Browse the repository at this point in the history
For some reason I was using writeStmtRef when I meant writeStmt, so this
corrects that.
  • Loading branch information
erichkeane committed May 28, 2024
1 parent ed4227a commit e3f74d4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions clang/lib/Serialization/ASTWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7835,15 +7835,15 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) {
case OpenACCClauseKind::If: {
const auto *IC = cast<OpenACCIfClause>(C);
writeSourceLocation(IC->getLParenLoc());
writeStmtRef(IC->getConditionExpr());
AddStmt(const_cast<Expr*>(IC->getConditionExpr()));
return;
}
case OpenACCClauseKind::Self: {
const auto *SC = cast<OpenACCSelfClause>(C);
writeSourceLocation(SC->getLParenLoc());
writeBool(SC->hasConditionExpr());
if (SC->hasConditionExpr())
writeStmtRef(SC->getConditionExpr());
AddStmt(const_cast<Expr*>(SC->getConditionExpr()));
return;
}
case OpenACCClauseKind::NumGangs: {
Expand All @@ -7857,13 +7857,13 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) {
case OpenACCClauseKind::NumWorkers: {
const auto *NWC = cast<OpenACCNumWorkersClause>(C);
writeSourceLocation(NWC->getLParenLoc());
writeStmtRef(NWC->getIntExpr());
AddStmt(const_cast<Expr*>(NWC->getIntExpr()));
return;
}
case OpenACCClauseKind::VectorLength: {
const auto *NWC = cast<OpenACCVectorLengthClause>(C);
writeSourceLocation(NWC->getLParenLoc());
writeStmtRef(NWC->getIntExpr());
AddStmt(const_cast<Expr*>(NWC->getIntExpr()));
return;
}
case OpenACCClauseKind::Private: {
Expand Down Expand Up @@ -7942,15 +7942,15 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) {
writeSourceLocation(AC->getLParenLoc());
writeBool(AC->hasIntExpr());
if (AC->hasIntExpr())
writeStmtRef(AC->getIntExpr());
AddStmt(const_cast<Expr*>(AC->getIntExpr()));
return;
}
case OpenACCClauseKind::Wait: {
const auto *WC = cast<OpenACCWaitClause>(C);
writeSourceLocation(WC->getLParenLoc());
writeBool(WC->getDevNumExpr());
if (const Expr *DNE = WC->getDevNumExpr())
writeStmtRef(DNE);
if (Expr *DNE = WC->getDevNumExpr())
AddStmt(DNE);
writeSourceLocation(WC->getQueuesLoc());

writeOpenACCIntExprList(WC->getQueueIdExprs());
Expand Down

0 comments on commit e3f74d4

Please sign in to comment.