diff options
author | erichkeane <ekeane@nvidia.com> | 2024-05-28 14:25:13 -0700 |
---|---|---|
committer | erichkeane <ekeane@nvidia.com> | 2024-05-28 14:38:30 -0700 |
commit | e3f74d4589e29279e9f543b58577a2ece102dc6f (patch) | |
tree | 6f24e3ae053fce84ac2426e4058a2341ac90041c /clang/lib/Serialization/ASTWriter.cpp | |
parent | ed4227aad37f2c4adf307b63050fb9aee52b07f8 (diff) | |
download | llvm-e3f74d4589e29279e9f543b58577a2ece102dc6f.zip llvm-e3f74d4589e29279e9f543b58577a2ece102dc6f.tar.gz llvm-e3f74d4589e29279e9f543b58577a2ece102dc6f.tar.bz2 |
[OpenACC] Correct serialization of certain clause sub-expressions
For some reason I was using writeStmtRef when I meant writeStmt, so this
corrects that.
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index dd548fa..e830c40 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -7835,7 +7835,7 @@ 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: { @@ -7843,7 +7843,7 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) { writeSourceLocation(SC->getLParenLoc()); writeBool(SC->hasConditionExpr()); if (SC->hasConditionExpr()) - writeStmtRef(SC->getConditionExpr()); + AddStmt(const_cast<Expr*>(SC->getConditionExpr())); return; } case OpenACCClauseKind::NumGangs: { @@ -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: { @@ -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()); |