https://github.com/kevinsala created https://github.com/llvm/llvm-project/pull/206386
The LParentLoc is already a data member of the OMPVarListClause class. The OMPThreadLimitClause and OMPNumTeamsClause classes inherit from OMPVarListClause and should not need to have their own LParentLoc. >From f892160c52b0c1d73582ca47c505f29e84e02c82 Mon Sep 17 00:00:00 2001 From: Kevin Sala <[email protected]> Date: Sun, 28 Jun 2026 18:43:24 -0700 Subject: [PATCH] [Clang][OpenMP] Remove unnecessary LParentLoc in ThreadLimit and NumTeams clauses The LParentLoc is already a field of the OMPVarListClause class. The ThreadLimit and NumTeams clause classes should not need to define it. --- clang/include/clang/AST/OpenMPClause.h | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h index bae396d883dc8..12959fe0c2ff0 100644 --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -6995,9 +6995,6 @@ class OMPNumTeamsClause final friend OMPVarListClause; friend TrailingObjects; - /// Location of '('. - SourceLocation LParenLoc; - /// Modifier that was specified. OpenMPNumTeamsClauseModifier Modifier = OMPC_NUMTEAMS_unknown; @@ -7041,12 +7038,6 @@ class OMPNumTeamsClause final /// \param N The number of variables. static OMPNumTeamsClause *CreateEmpty(const ASTContext &C, unsigned N); - /// Sets the location of '('. - void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } - - /// Returns the location of '('. - SourceLocation getLParenLoc() const { return LParenLoc; } - /// Return NumTeams expressions. ArrayRef<Expr *> getNumTeams() { return getVarRefs(); } @@ -7119,9 +7110,6 @@ class OMPThreadLimitClause final friend OMPVarListClause; friend TrailingObjects; - /// Location of '('. - SourceLocation LParenLoc; - OMPThreadLimitClause(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N) @@ -7155,12 +7143,6 @@ class OMPThreadLimitClause final /// \param N The number of variables. static OMPThreadLimitClause *CreateEmpty(const ASTContext &C, unsigned N); - /// Sets the location of '('. - void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } - - /// Returns the location of '('. - SourceLocation getLParenLoc() const { return LParenLoc; } - /// Return ThreadLimit expressions. ArrayRef<Expr *> getThreadLimit() { return getVarRefs(); } _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
