Skip to content

Commit e3f74d4

Browse files
committed
[OpenACC] Correct serialization of certain clause sub-expressions
For some reason I was using writeStmtRef when I meant writeStmt, so this corrects that.
1 parent ed4227a commit e3f74d4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7835,15 +7835,15 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) {
78357835
case OpenACCClauseKind::If: {
78367836
const auto *IC = cast<OpenACCIfClause>(C);
78377837
writeSourceLocation(IC->getLParenLoc());
7838-
writeStmtRef(IC->getConditionExpr());
7838+
AddStmt(const_cast<Expr*>(IC->getConditionExpr()));
78397839
return;
78407840
}
78417841
case OpenACCClauseKind::Self: {
78427842
const auto *SC = cast<OpenACCSelfClause>(C);
78437843
writeSourceLocation(SC->getLParenLoc());
78447844
writeBool(SC->hasConditionExpr());
78457845
if (SC->hasConditionExpr())
7846-
writeStmtRef(SC->getConditionExpr());
7846+
AddStmt(const_cast<Expr*>(SC->getConditionExpr()));
78477847
return;
78487848
}
78497849
case OpenACCClauseKind::NumGangs: {
@@ -7857,13 +7857,13 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) {
78577857
case OpenACCClauseKind::NumWorkers: {
78587858
const auto *NWC = cast<OpenACCNumWorkersClause>(C);
78597859
writeSourceLocation(NWC->getLParenLoc());
7860-
writeStmtRef(NWC->getIntExpr());
7860+
AddStmt(const_cast<Expr*>(NWC->getIntExpr()));
78617861
return;
78627862
}
78637863
case OpenACCClauseKind::VectorLength: {
78647864
const auto *NWC = cast<OpenACCVectorLengthClause>(C);
78657865
writeSourceLocation(NWC->getLParenLoc());
7866-
writeStmtRef(NWC->getIntExpr());
7866+
AddStmt(const_cast<Expr*>(NWC->getIntExpr()));
78677867
return;
78687868
}
78697869
case OpenACCClauseKind::Private: {
@@ -7942,15 +7942,15 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) {
79427942
writeSourceLocation(AC->getLParenLoc());
79437943
writeBool(AC->hasIntExpr());
79447944
if (AC->hasIntExpr())
7945-
writeStmtRef(AC->getIntExpr());
7945+
AddStmt(const_cast<Expr*>(AC->getIntExpr()));
79467946
return;
79477947
}
79487948
case OpenACCClauseKind::Wait: {
79497949
const auto *WC = cast<OpenACCWaitClause>(C);
79507950
writeSourceLocation(WC->getLParenLoc());
79517951
writeBool(WC->getDevNumExpr());
7952-
if (const Expr *DNE = WC->getDevNumExpr())
7953-
writeStmtRef(DNE);
7952+
if (Expr *DNE = WC->getDevNumExpr())
7953+
AddStmt(DNE);
79547954
writeSourceLocation(WC->getQueuesLoc());
79557955

79567956
writeOpenACCIntExprList(WC->getQueueIdExprs());

0 commit comments

Comments
 (0)