Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Switch to ArrayRef instead of Mutable
  • Loading branch information
erichkeane committed Apr 8, 2024
commit ebb2f33b17ca9ebbda3a03116f051be4b2c98008
2 changes: 1 addition & 1 deletion clang/include/clang/Sema/SemaOpenACC.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class SemaOpenACC : public SemaBase {
StmtResult ActOnEndStmtDirective(OpenACCDirectiveKind K,
SourceLocation StartLoc,
SourceLocation EndLoc,
MutableArrayRef<OpenACCClause *> Clauses,
ArrayRef<OpenACCClause *> Clauses,
StmtResult AssocStmt);

/// Called after the directive has been completely parsed, including the
Expand Down
12 changes: 6 additions & 6 deletions clang/lib/Sema/SemaOpenACC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ bool doesClauseApplyToDirective(OpenACCDirectiveKind DirectiveKind,

/// Destruct and deallocate any clauses that aren't going to be used because
/// they don't have a Construct to attach to.
void DestroyUnusedClauses(ASTContext &Ctx,
MutableArrayRef<OpenACCClause *> Clauses) {
void DestroyUnusedClauses(ASTContext &Ctx, ArrayRef<OpenACCClause *> Clauses) {
auto *Itr = Clauses.begin();
auto *End = Clauses.end();

for (; Itr != End; ++Itr) {
(*Itr)->~OpenACCClause();
Ctx.Deallocate(*Itr);
*Itr = nullptr;
}
}
} // namespace
Expand Down Expand Up @@ -114,9 +112,11 @@ bool SemaOpenACC::ActOnStartStmtDirective(OpenACCDirectiveKind K,
return diagnoseConstructAppertainment(*this, K, StartLoc, /*IsStmt=*/true);
}

StmtResult SemaOpenACC::ActOnEndStmtDirective(
OpenACCDirectiveKind K, SourceLocation StartLoc, SourceLocation EndLoc,
MutableArrayRef<OpenACCClause *> Clauses, StmtResult AssocStmt) {
StmtResult SemaOpenACC::ActOnEndStmtDirective(OpenACCDirectiveKind K,
SourceLocation StartLoc,
SourceLocation EndLoc,
ArrayRef<OpenACCClause *> Clauses,
StmtResult AssocStmt) {
switch (K) {
default:
DestroyUnusedClauses(getASTContext(), Clauses);
Expand Down
8 changes: 5 additions & 3 deletions clang/lib/Sema/TreeTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -4002,9 +4002,11 @@ class TreeTransform {
return getSema().CreateRecoveryExpr(BeginLoc, EndLoc, SubExprs, Type);
}

StmtResult RebuildOpenACCComputeConstruct(
OpenACCDirectiveKind K, SourceLocation BeginLoc, SourceLocation EndLoc,
MutableArrayRef<OpenACCClause *> Clauses, StmtResult StrBlock) {
StmtResult RebuildOpenACCComputeConstruct(OpenACCDirectiveKind K,
SourceLocation BeginLoc,
SourceLocation EndLoc,
ArrayRef<OpenACCClause *> Clauses,
StmtResult StrBlock) {
return getSema().OpenACC().ActOnEndStmtDirective(K, BeginLoc, EndLoc,
Clauses, StrBlock);
}
Expand Down