[clang] [Clang][OpenMP] Remove unnecessary LParentLoc in clause classes (PR #206386)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 28 18:57:58 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Kevin Sala Penades (kevinsala)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/206386.diff


1 Files Affected:

- (modified) clang/include/clang/AST/OpenMPClause.h (-18) 


``````````diff
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(); }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/206386


More information about the cfe-commits mailing list