Skip to content

[NFC][Clang][AST] Drop llvm:: in front of ArrayRef/MutableArrayRef #145207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2025

Conversation

jurahul
Copy link
Contributor

@jurahul jurahul commented Jun 22, 2025

No description provided.

@jurahul jurahul force-pushed the clang_ast_arrayref branch from 3c87dfe to 2e43d4b Compare June 22, 2025 06:08
@jurahul jurahul changed the title [NFC][Clang][AST] Drop llvm:: in front of ArrayRef [NFC][Clang][AST] Drop llvm:: in front of ArrayRef/MutableArrayRef Jun 22, 2025
@jurahul jurahul marked this pull request as ready for review June 22, 2025 12:32
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:modules C++20 modules and Clang Header Modules clang:openmp OpenMP related changes to Clang clang:bytecode Issues for the clang bytecode constexpr interpreter labels Jun 22, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 22, 2025

@llvm/pr-subscribers-clang-modules

Author: Rahul Joshi (jurahul)

Changes

Patch is 80.35 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/145207.diff

46 Files Affected:

  • (modified) clang/include/clang/AST/AbstractBasicReader.h (+1-2)
  • (modified) clang/include/clang/AST/AbstractBasicWriter.h (+1-2)
  • (modified) clang/include/clang/AST/ComputeDependence.h (+2-2)
  • (modified) clang/include/clang/AST/Decl.h (+2-5)
  • (modified) clang/include/clang/AST/DeclCXX.h (+6-8)
  • (modified) clang/include/clang/AST/DeclObjC.h (+1-1)
  • (modified) clang/include/clang/AST/DeclOpenMP.h (+4-4)
  • (modified) clang/include/clang/AST/DeclTemplate.h (+3-5)
  • (modified) clang/include/clang/AST/Expr.h (+12-15)
  • (modified) clang/include/clang/AST/ExprObjC.h (+1-2)
  • (modified) clang/include/clang/AST/ExternalASTMerger.h (+3-3)
  • (modified) clang/include/clang/AST/OpenACCClause.h (+7-11)
  • (modified) clang/include/clang/AST/OpenMPClause.h (+83-82)
  • (modified) clang/include/clang/AST/PropertiesBase.td (+1-1)
  • (modified) clang/include/clang/AST/Stmt.h (+4-7)
  • (modified) clang/include/clang/AST/StmtOpenACC.h (+2-4)
  • (modified) clang/include/clang/AST/StmtOpenMP.h (+11-12)
  • (modified) clang/include/clang/AST/TemplateBase.h (+5-5)
  • (modified) clang/include/clang/AST/Type.h (+4-4)
  • (modified) clang/include/clang/AST/TypeLoc.h (+3-3)
  • (modified) clang/include/clang/AST/TypeProperties.td (+1-1)
  • (modified) clang/lib/AST/APValue.cpp (+2-2)
  • (modified) clang/lib/AST/ASTContext.cpp (+2-3)
  • (modified) clang/lib/AST/ASTDiagnostic.cpp (+1-1)
  • (modified) clang/lib/AST/ASTImporter.cpp (+15-19)
  • (modified) clang/lib/AST/ByteCode/Compiler.cpp (+1-2)
  • (modified) clang/lib/AST/ByteCode/Interp.cpp (+1-1)
  • (modified) clang/lib/AST/ByteCode/Interp.h (+1-1)
  • (modified) clang/lib/AST/ByteCode/InterpBuiltin.cpp (+2-3)
  • (modified) clang/lib/AST/ByteCode/InterpShared.cpp (+1-1)
  • (modified) clang/lib/AST/ByteCode/InterpShared.h (+2-1)
  • (modified) clang/lib/AST/CommentParser.cpp (+12-12)
  • (modified) clang/lib/AST/CommentSema.cpp (+3-3)
  • (modified) clang/lib/AST/ComputeDependence.cpp (+4-5)
  • (modified) clang/lib/AST/Decl.cpp (+5-4)
  • (modified) clang/lib/AST/DeclCXX.cpp (+4-4)
  • (modified) clang/lib/AST/DeclPrinter.cpp (+2-2)
  • (modified) clang/lib/AST/Expr.cpp (+7-7)
  • (modified) clang/lib/AST/ExprCXX.cpp (+1-1)
  • (modified) clang/lib/AST/ExprConstant.cpp (+3-4)
  • (modified) clang/lib/AST/ExternalASTMerger.cpp (+5-4)
  • (modified) clang/lib/AST/ItaniumMangle.cpp (+1-1)
  • (modified) clang/lib/AST/OpenACCClause.cpp (+1-1)
  • (modified) clang/lib/AST/ParentMapContext.cpp (+3-2)
  • (modified) clang/lib/AST/StmtPrinter.cpp (+1-1)
  • (modified) clang/lib/AST/TemplateName.cpp (+1-1)
diff --git a/clang/include/clang/AST/AbstractBasicReader.h b/clang/include/clang/AST/AbstractBasicReader.h
index 586ad3be62a7e..514f4cef3a694 100644
--- a/clang/include/clang/AST/AbstractBasicReader.h
+++ b/clang/include/clang/AST/AbstractBasicReader.h
@@ -143,8 +143,7 @@ class DataStreamBasicReader : public BasicReaderBase<Impl> {
   // structure into a single data stream.
   Impl &readObject() { return asImpl(); }
 
-  template <class T>
-  llvm::ArrayRef<T> readArray(llvm::SmallVectorImpl<T> &buffer) {
+  template <class T> ArrayRef<T> readArray(llvm::SmallVectorImpl<T> &buffer) {
     assert(buffer.empty());
 
     uint32_t size = asImpl().readUInt32();
diff --git a/clang/include/clang/AST/AbstractBasicWriter.h b/clang/include/clang/AST/AbstractBasicWriter.h
index f65d94abc2ff1..fedde8a2e46c5 100644
--- a/clang/include/clang/AST/AbstractBasicWriter.h
+++ b/clang/include/clang/AST/AbstractBasicWriter.h
@@ -138,8 +138,7 @@ class DataStreamBasicWriter : public BasicWriterBase<Impl> {
     asImpl().writeUInt32(uint32_t(value));
   }
 
-  template <class T>
-  void writeArray(llvm::ArrayRef<T> array) {
+  template <class T> void writeArray(ArrayRef<T> array) {
     asImpl().writeUInt32(array.size());
     for (const T &elt : array) {
       WriteDispatcher<T>::write(asImpl(), elt);
diff --git a/clang/include/clang/AST/ComputeDependence.h b/clang/include/clang/AST/ComputeDependence.h
index e96275e5f2e07..c298f2620f211 100644
--- a/clang/include/clang/AST/ComputeDependence.h
+++ b/clang/include/clang/AST/ComputeDependence.h
@@ -15,7 +15,7 @@
 
 #include "clang/AST/DependenceFlags.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
-#include "llvm/ADT/ArrayRef.h"
+#include "clang/Basic/LLVM.h"
 
 namespace clang {
 
@@ -180,7 +180,7 @@ ExprDependence computeDependence(ConceptSpecializationExpr *E,
 
 ExprDependence computeDependence(SYCLUniqueStableNameExpr *E);
 ExprDependence computeDependence(PredefinedExpr *E);
-ExprDependence computeDependence(CallExpr *E, llvm::ArrayRef<Expr *> PreArgs);
+ExprDependence computeDependence(CallExpr *E, ArrayRef<Expr *> PreArgs);
 ExprDependence computeDependence(OffsetOfExpr *E);
 ExprDependence computeDependence(MemberExpr *E);
 ExprDependence computeDependence(ShuffleVectorExpr *E);
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 05aac15b30cd6..58209f4601422 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -3417,16 +3417,13 @@ class IndirectFieldDecl : public ValueDecl,
 
   static IndirectFieldDecl *Create(ASTContext &C, DeclContext *DC,
                                    SourceLocation L, const IdentifierInfo *Id,
-                                   QualType T,
-                                   llvm::MutableArrayRef<NamedDecl *> CH);
+                                   QualType T, MutableArrayRef<NamedDecl *> CH);
 
   static IndirectFieldDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);
 
   using chain_iterator = ArrayRef<NamedDecl *>::const_iterator;
 
-  ArrayRef<NamedDecl *> chain() const {
-    return llvm::ArrayRef(Chaining, ChainingSize);
-  }
+  ArrayRef<NamedDecl *> chain() const { return {Chaining, ChainingSize}; }
   chain_iterator chain_begin() const { return chain().begin(); }
   chain_iterator chain_end() const { return chain().end(); }
 
diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h
index df76e6f5015b3..05cddd024d7cf 100644
--- a/clang/include/clang/AST/DeclCXX.h
+++ b/clang/include/clang/AST/DeclCXX.h
@@ -365,12 +365,10 @@ class CXXRecordDecl : public RecordDecl {
       return getVBasesSlowCase();
     }
 
-    ArrayRef<CXXBaseSpecifier> bases() const {
-      return llvm::ArrayRef(getBases(), NumBases);
-    }
+    ArrayRef<CXXBaseSpecifier> bases() const { return {getBases(), NumBases}; }
 
     ArrayRef<CXXBaseSpecifier> vbases() const {
-      return llvm::ArrayRef(getVBases(), NumVBases);
+      return {getVBases(), NumVBases};
     }
 
   private:
@@ -4190,7 +4188,7 @@ class BindingDecl : public ValueDecl {
   Expr *getBinding() const { return Binding; }
 
   // Get the array of nested BindingDecls when the binding represents a pack.
-  llvm::ArrayRef<BindingDecl *> getBindingPackDecls() const;
+  ArrayRef<BindingDecl *> getBindingPackDecls() const;
 
   /// Get the decomposition declaration that this binding represents a
   /// decomposition of.
@@ -4269,11 +4267,11 @@ class DecompositionDecl final
 
   // Provide a flattened range to visit each binding.
   auto flat_bindings() const {
-    llvm::ArrayRef<BindingDecl *> Bindings = bindings();
-    llvm::ArrayRef<BindingDecl *> PackBindings;
+    ArrayRef<BindingDecl *> Bindings = bindings();
+    ArrayRef<BindingDecl *> PackBindings;
 
     // Split the bindings into subranges split by the pack.
-    llvm::ArrayRef<BindingDecl *> BeforePackBindings = Bindings.take_until(
+    ArrayRef<BindingDecl *> BeforePackBindings = Bindings.take_until(
         [](BindingDecl *BD) { return BD->isParameterPack(); });
 
     Bindings = Bindings.drop_front(BeforePackBindings.size());
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index 6e582627c45ed..9014d76f8433b 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/include/clang/AST/DeclObjC.h
@@ -371,7 +371,7 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext {
   // ArrayRef access to formal parameters.  This should eventually
   // replace the iterator interface above.
   ArrayRef<ParmVarDecl*> parameters() const {
-    return llvm::ArrayRef(const_cast<ParmVarDecl **>(getParams()), NumParams);
+    return {const_cast<ParmVarDecl **>(getParams()), NumParams};
   }
 
   ParmVarDecl *getParamDecl(unsigned Idx) {
diff --git a/clang/include/clang/AST/DeclOpenMP.h b/clang/include/clang/AST/DeclOpenMP.h
index 2d07f9d9f5d8c..f3e18ad0339af 100644
--- a/clang/include/clang/AST/DeclOpenMP.h
+++ b/clang/include/clang/AST/DeclOpenMP.h
@@ -118,12 +118,12 @@ class OMPThreadPrivateDecl final : public OMPDeclarativeDirective<Decl> {
 
   ArrayRef<const Expr *> getVars() const {
     auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
-    return llvm::ArrayRef(Storage, Data->getNumChildren());
+    return {Storage, Data->getNumChildren()};
   }
 
   MutableArrayRef<Expr *> getVars() {
     auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
-    return llvm::MutableArrayRef(Storage, Data->getNumChildren());
+    return {Storage, Data->getNumChildren()};
   }
 
   void setVars(ArrayRef<Expr *> VL);
@@ -482,12 +482,12 @@ class OMPAllocateDecl final : public OMPDeclarativeDirective<Decl> {
 
   ArrayRef<const Expr *> getVars() const {
     auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
-    return llvm::ArrayRef(Storage, Data->getNumChildren());
+    return {Storage, Data->getNumChildren()};
   }
 
   MutableArrayRef<Expr *> getVars() {
     auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
-    return llvm::MutableArrayRef(Storage, Data->getNumChildren());
+    return {Storage, Data->getNumChildren()};
   }
 
   void setVars(ArrayRef<Expr *> VL);
diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h
index 939b14b0351d6..1ff6cc6fcb7d1 100644
--- a/clang/include/clang/AST/DeclTemplate.h
+++ b/clang/include/clang/AST/DeclTemplate.h
@@ -139,10 +139,8 @@ class TemplateParameterList final
   unsigned size() const { return NumParams; }
   bool empty() const { return NumParams == 0; }
 
-  ArrayRef<NamedDecl *> asArray() { return llvm::ArrayRef(begin(), end()); }
-  ArrayRef<const NamedDecl*> asArray() const {
-    return llvm::ArrayRef(begin(), size());
-  }
+  ArrayRef<NamedDecl *> asArray() { return {begin(), end()}; }
+  ArrayRef<const NamedDecl *> asArray() const { return {begin(), size()}; }
 
   NamedDecl* getParam(unsigned Idx) {
     assert(Idx < size() && "Template parameter index out-of-range");
@@ -772,7 +770,7 @@ class RedeclarableTemplateDecl : public TemplateDecl,
 
   void loadLazySpecializationsImpl(bool OnlyPartial = false) const;
 
-  bool loadLazySpecializationsImpl(llvm::ArrayRef<TemplateArgument> Args,
+  bool loadLazySpecializationsImpl(ArrayRef<TemplateArgument> Args,
                                    TemplateParameterList *TPL = nullptr) const;
 
   template <class EntryType, typename... ProfileArguments>
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 41e50359962ee..c262433b691a1 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -3106,9 +3106,9 @@ class CallExpr : public Expr {
   /// Compute and set dependence bits.
   void computeDependence() {
     setDependence(clang::computeDependence(
-        this, llvm::ArrayRef(
-                  reinterpret_cast<Expr **>(getTrailingStmts() + PREARGS_START),
-                  getNumPreArgs())));
+        this,
+        ArrayRef(reinterpret_cast<Expr **>(getTrailingStmts() + PREARGS_START),
+                 getNumPreArgs())));
   }
 
   /// Reduce the number of arguments in this call expression. This is used for
@@ -3153,8 +3153,7 @@ class CallExpr : public Expr {
   /// interface.  This provides efficient reverse iteration of the
   /// subexpressions.  This is currently used for CFG construction.
   ArrayRef<Stmt *> getRawSubExprs() {
-    return llvm::ArrayRef(getTrailingStmts(),
-                          PREARGS_START + getNumPreArgs() + getNumArgs());
+    return {getTrailingStmts(), PREARGS_START + getNumPreArgs() + getNumArgs()};
   }
 
   /// Get FPOptionsOverride from trailing storage.
@@ -5276,11 +5275,9 @@ class InitListExpr : public Expr {
     return reinterpret_cast<Expr * const *>(InitExprs.data());
   }
 
-  ArrayRef<Expr *> inits() { return llvm::ArrayRef(getInits(), getNumInits()); }
+  ArrayRef<Expr *> inits() { return {getInits(), getNumInits()}; }
 
-  ArrayRef<Expr *> inits() const {
-    return llvm::ArrayRef(getInits(), getNumInits());
-  }
+  ArrayRef<Expr *> inits() const { return {getInits(), getNumInits()}; }
 
   const Expr *getInit(unsigned Init) const {
     assert(Init < getNumInits() && "Initializer access out of range!");
@@ -5508,7 +5505,7 @@ class DesignatedInitExpr final
   Designator *Designators;
 
   DesignatedInitExpr(const ASTContext &C, QualType Ty,
-                     llvm::ArrayRef<Designator> Designators,
+                     ArrayRef<Designator> Designators,
                      SourceLocation EqualOrColonLoc, bool GNUSyntax,
                      ArrayRef<Expr *> IndexExprs, Expr *Init);
 
@@ -5701,8 +5698,8 @@ class DesignatedInitExpr final
   };
 
   static DesignatedInitExpr *Create(const ASTContext &C,
-                                    llvm::ArrayRef<Designator> Designators,
-                                    ArrayRef<Expr*> IndexExprs,
+                                    ArrayRef<Designator> Designators,
+                                    ArrayRef<Expr *> IndexExprs,
                                     SourceLocation EqualOrColonLoc,
                                     bool GNUSyntax, Expr *Init);
 
@@ -5713,11 +5710,11 @@ class DesignatedInitExpr final
   unsigned size() const { return NumDesignators; }
 
   // Iterator access to the designators.
-  llvm::MutableArrayRef<Designator> designators() {
+  MutableArrayRef<Designator> designators() {
     return {Designators, NumDesignators};
   }
 
-  llvm::ArrayRef<Designator> designators() const {
+  ArrayRef<Designator> designators() const {
     return {Designators, NumDesignators};
   }
 
@@ -6052,7 +6049,7 @@ class ParenListExpr final
 
   Expr **getExprs() { return reinterpret_cast<Expr **>(getTrailingObjects()); }
 
-  ArrayRef<Expr *> exprs() { return llvm::ArrayRef(getExprs(), getNumExprs()); }
+  ArrayRef<Expr *> exprs() { return {getExprs(), getNumExprs()}; }
 
   SourceLocation getLParenLoc() const { return LParenLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
diff --git a/clang/include/clang/AST/ExprObjC.h b/clang/include/clang/AST/ExprObjC.h
index 3d9b3c4585e8a..8210be38608a6 100644
--- a/clang/include/clang/AST/ExprObjC.h
+++ b/clang/include/clang/AST/ExprObjC.h
@@ -1421,8 +1421,7 @@ class ObjCMessageExpr final
     if (hasStandardSelLocs())
       return getStandardSelectorLoc(
           Index, getSelector(), getSelLocsKind() == SelLoc_StandardWithSpace,
-          llvm::ArrayRef(const_cast<Expr **>(getArgs()), getNumArgs()),
-          RBracLoc);
+          ArrayRef(const_cast<Expr **>(getArgs()), getNumArgs()), RBracLoc);
     return getStoredSelLocs()[Index];
   }
 
diff --git a/clang/include/clang/AST/ExternalASTMerger.h b/clang/include/clang/AST/ExternalASTMerger.h
index 2c6f2a941311b..bc3cd31635251 100644
--- a/clang/include/clang/AST/ExternalASTMerger.h
+++ b/clang/include/clang/AST/ExternalASTMerger.h
@@ -113,7 +113,7 @@ class ExternalASTMerger : public ExternalASTSource {
 
 public:
   ExternalASTMerger(const ImporterTarget &Target,
-                    llvm::ArrayRef<ImporterSource> Sources);
+                    ArrayRef<ImporterSource> Sources);
 
   /// Asks all connected ASTImporters if any of them imported the given
   /// declaration. If any ASTImporter did import the given declaration,
@@ -128,7 +128,7 @@ class ExternalASTMerger : public ExternalASTSource {
   /// newly-parsed source files).
   ///
   /// Ensures that Importers does not gain duplicate entries as a result.
-  void AddSources(llvm::ArrayRef<ImporterSource> Sources);
+  void AddSources(ArrayRef<ImporterSource> Sources);
 
   /// Remove a set of ASTContexts as possible origins.
   ///
@@ -137,7 +137,7 @@ class ExternalASTMerger : public ExternalASTSource {
   ///
   /// The caller is responsible for ensuring that this doesn't leave
   /// DeclContexts that can't be completed.
-  void RemoveSources(llvm::ArrayRef<ImporterSource> Sources);
+  void RemoveSources(ArrayRef<ImporterSource> Sources);
 
   /// Implementation of the ExternalASTSource API.
   bool FindExternalVisibleDeclsByName(const DeclContext *DC,
diff --git a/clang/include/clang/AST/OpenACCClause.h b/clang/include/clang/AST/OpenACCClause.h
index a778c7cc3dc98..71ad24a427105 100644
--- a/clang/include/clang/AST/OpenACCClause.h
+++ b/clang/include/clang/AST/OpenACCClause.h
@@ -513,7 +513,7 @@ class OpenACCClauseWithExprs : public OpenACCClauseWithParams {
 
   /// Gets the entire list of expressions, but leave it to the
   /// individual clauses to expose this how they'd like.
-  llvm::ArrayRef<Expr *> getExprs() const { return Exprs; }
+  ArrayRef<Expr *> getExprs() const { return Exprs; }
 
 public:
   static bool classof(const OpenACCClause *C);
@@ -563,10 +563,10 @@ class OpenACCWaitClause final
   SourceLocation getQueuesLoc() const { return QueuesLoc; }
   bool hasDevNumExpr() const { return getExprs()[0]; }
   Expr *getDevNumExpr() const { return getExprs()[0]; }
-  llvm::ArrayRef<Expr *> getQueueIdExprs() {
+  ArrayRef<Expr *> getQueueIdExprs() {
     return OpenACCClauseWithExprs::getExprs().drop_front();
   }
-  llvm::ArrayRef<Expr *> getQueueIdExprs() const {
+  ArrayRef<Expr *> getQueueIdExprs() const {
     return OpenACCClauseWithExprs::getExprs().drop_front();
   }
   // If this is a plain `wait` (no parens) this returns 'false'. Else Sema/Parse
@@ -594,11 +594,9 @@ class OpenACCNumGangsClause final
   Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
          ArrayRef<Expr *> IntExprs, SourceLocation EndLoc);
 
-  llvm::ArrayRef<Expr *> getIntExprs() {
-    return OpenACCClauseWithExprs::getExprs();
-  }
+  ArrayRef<Expr *> getIntExprs() { return OpenACCClauseWithExprs::getExprs(); }
 
-  llvm::ArrayRef<Expr *> getIntExprs() const {
+  ArrayRef<Expr *> getIntExprs() const {
     return OpenACCClauseWithExprs::getExprs();
   }
 };
@@ -622,11 +620,9 @@ class OpenACCTileClause final
                                    SourceLocation LParenLoc,
                                    ArrayRef<Expr *> SizeExprs,
                                    SourceLocation EndLoc);
-  llvm::ArrayRef<Expr *> getSizeExprs() {
-    return OpenACCClauseWithExprs::getExprs();
-  }
+  ArrayRef<Expr *> getSizeExprs() { return OpenACCClauseWithExprs::getExprs(); }
 
-  llvm::ArrayRef<Expr *> getSizeExprs() const {
+  ArrayRef<Expr *> getSizeExprs() const {
     return OpenACCClauseWithExprs::getExprs();
   }
 };
diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h
index 2fa8fa529741e..c2c839f77987c 100644
--- a/clang/include/clang/AST/OpenMPClause.h
+++ b/clang/include/clang/AST/OpenMPClause.h
@@ -3150,10 +3150,10 @@ class OMPPrivateClause final
   /// Gets the list of references to private copies with initializers for
   /// new private variables.
   MutableArrayRef<Expr *> getPrivateCopies() {
-    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
   ArrayRef<const Expr *> getPrivateCopies() const {
-    return llvm::ArrayRef(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
 
 public:
@@ -3259,10 +3259,10 @@ class OMPFirstprivateClause final
   /// Gets the list of references to private copies with initializers for
   /// new private variables.
   MutableArrayRef<Expr *> getPrivateCopies() {
-    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
   ArrayRef<const Expr *> getPrivateCopies() const {
-    return llvm::ArrayRef(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
 
   /// Sets the list of references to initializer variables for new
@@ -3273,10 +3273,10 @@ class OMPFirstprivateClause final
   /// Gets the list of references to initializer variables for new
   /// private variables.
   MutableArrayRef<Expr *> getInits() {
-    return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
+    return {getPrivateCopies().end(), varlist_size()};
   }
   ArrayRef<const Expr *> getInits() const {
-    return llvm::ArrayRef(getPrivateCopies().end(), varlist_size());
+    return {getPrivateCopies().end(), varlist_size()};
   }
 
 public:
@@ -3424,7 +3424,7 @@ class OMPLastprivateClause final
     return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
   }
   ArrayRef<const Expr *> getPrivateCopies() const {
-    return llvm::ArrayRef(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
 
   /// Set list of helper expressions, required for proper codegen of the
@@ -3435,10 +3435,10 @@ class OMPLastprivateClause final
 
   /// Get the list of helper source expressions.
   MutableArrayRef<Expr *> getSourceExprs() {
-    return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
+    return {getPrivateCopies().end(), varlist_size()};
   }
   ArrayRef<const Expr *> getSourceExprs() const {
-    return llvm::ArrayRef(getPrivateCopies().end(), varlist_size());
+    return {getPrivateCopies().end(), varlist_size()};
   }
 
   /// Set list of helper expressions, required for proper codegen of the
@@ -3449,10 +3449,10 @@ class OMPLastprivateClause final
 
   /// Get the list of helper destination expressions.
   MutableArrayRef<Expr *> getDestinationExprs() {
-    return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
+    return {getSourceExprs().end(), varlist_size()};
   }
   ArrayRef<const Expr *> getDestinationExprs() const {
-    return llvm::ArrayRef(getSourceExprs().end(), varlist_size());
+    return {getSourceExprs().end(), varlist_size()};
   }
 
   /// Set list of helper assignment expressions, required for proper
@@ -3462,10 +3462,10 @@ class OMPLastprivateClause final
 
   /// Get the list of helper assignment expressions.
   MutableArrayRef<Expr *> getAssignmentOps() {
-    return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
+    return {getDestinationExprs().end(), varlist_size()};
   }
   ArrayRef<const Expr *> getAssignmentOps() const {
-    return llvm::ArrayRef(getDestinationExprs().end(), varlist_size());
+    return {getDestinationExprs().end(), varlist_size()};
   }
 
   /// Sets lastprivate kind.
@@ -3761,10 +3761,10 @@ class OMPReductionClause final
 
   /// Get the list of helper privates.
   MutableArrayRef<Expr *> getPrivates() {
-    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
   ArrayRef<const ...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Jun 22, 2025

@llvm/pr-subscribers-clang

Author: Rahul Joshi (jurahul)

Changes

Patch is 80.35 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/145207.diff

46 Files Affected:

  • (modified) clang/include/clang/AST/AbstractBasicReader.h (+1-2)
  • (modified) clang/include/clang/AST/AbstractBasicWriter.h (+1-2)
  • (modified) clang/include/clang/AST/ComputeDependence.h (+2-2)
  • (modified) clang/include/clang/AST/Decl.h (+2-5)
  • (modified) clang/include/clang/AST/DeclCXX.h (+6-8)
  • (modified) clang/include/clang/AST/DeclObjC.h (+1-1)
  • (modified) clang/include/clang/AST/DeclOpenMP.h (+4-4)
  • (modified) clang/include/clang/AST/DeclTemplate.h (+3-5)
  • (modified) clang/include/clang/AST/Expr.h (+12-15)
  • (modified) clang/include/clang/AST/ExprObjC.h (+1-2)
  • (modified) clang/include/clang/AST/ExternalASTMerger.h (+3-3)
  • (modified) clang/include/clang/AST/OpenACCClause.h (+7-11)
  • (modified) clang/include/clang/AST/OpenMPClause.h (+83-82)
  • (modified) clang/include/clang/AST/PropertiesBase.td (+1-1)
  • (modified) clang/include/clang/AST/Stmt.h (+4-7)
  • (modified) clang/include/clang/AST/StmtOpenACC.h (+2-4)
  • (modified) clang/include/clang/AST/StmtOpenMP.h (+11-12)
  • (modified) clang/include/clang/AST/TemplateBase.h (+5-5)
  • (modified) clang/include/clang/AST/Type.h (+4-4)
  • (modified) clang/include/clang/AST/TypeLoc.h (+3-3)
  • (modified) clang/include/clang/AST/TypeProperties.td (+1-1)
  • (modified) clang/lib/AST/APValue.cpp (+2-2)
  • (modified) clang/lib/AST/ASTContext.cpp (+2-3)
  • (modified) clang/lib/AST/ASTDiagnostic.cpp (+1-1)
  • (modified) clang/lib/AST/ASTImporter.cpp (+15-19)
  • (modified) clang/lib/AST/ByteCode/Compiler.cpp (+1-2)
  • (modified) clang/lib/AST/ByteCode/Interp.cpp (+1-1)
  • (modified) clang/lib/AST/ByteCode/Interp.h (+1-1)
  • (modified) clang/lib/AST/ByteCode/InterpBuiltin.cpp (+2-3)
  • (modified) clang/lib/AST/ByteCode/InterpShared.cpp (+1-1)
  • (modified) clang/lib/AST/ByteCode/InterpShared.h (+2-1)
  • (modified) clang/lib/AST/CommentParser.cpp (+12-12)
  • (modified) clang/lib/AST/CommentSema.cpp (+3-3)
  • (modified) clang/lib/AST/ComputeDependence.cpp (+4-5)
  • (modified) clang/lib/AST/Decl.cpp (+5-4)
  • (modified) clang/lib/AST/DeclCXX.cpp (+4-4)
  • (modified) clang/lib/AST/DeclPrinter.cpp (+2-2)
  • (modified) clang/lib/AST/Expr.cpp (+7-7)
  • (modified) clang/lib/AST/ExprCXX.cpp (+1-1)
  • (modified) clang/lib/AST/ExprConstant.cpp (+3-4)
  • (modified) clang/lib/AST/ExternalASTMerger.cpp (+5-4)
  • (modified) clang/lib/AST/ItaniumMangle.cpp (+1-1)
  • (modified) clang/lib/AST/OpenACCClause.cpp (+1-1)
  • (modified) clang/lib/AST/ParentMapContext.cpp (+3-2)
  • (modified) clang/lib/AST/StmtPrinter.cpp (+1-1)
  • (modified) clang/lib/AST/TemplateName.cpp (+1-1)
diff --git a/clang/include/clang/AST/AbstractBasicReader.h b/clang/include/clang/AST/AbstractBasicReader.h
index 586ad3be62a7e..514f4cef3a694 100644
--- a/clang/include/clang/AST/AbstractBasicReader.h
+++ b/clang/include/clang/AST/AbstractBasicReader.h
@@ -143,8 +143,7 @@ class DataStreamBasicReader : public BasicReaderBase<Impl> {
   // structure into a single data stream.
   Impl &readObject() { return asImpl(); }
 
-  template <class T>
-  llvm::ArrayRef<T> readArray(llvm::SmallVectorImpl<T> &buffer) {
+  template <class T> ArrayRef<T> readArray(llvm::SmallVectorImpl<T> &buffer) {
     assert(buffer.empty());
 
     uint32_t size = asImpl().readUInt32();
diff --git a/clang/include/clang/AST/AbstractBasicWriter.h b/clang/include/clang/AST/AbstractBasicWriter.h
index f65d94abc2ff1..fedde8a2e46c5 100644
--- a/clang/include/clang/AST/AbstractBasicWriter.h
+++ b/clang/include/clang/AST/AbstractBasicWriter.h
@@ -138,8 +138,7 @@ class DataStreamBasicWriter : public BasicWriterBase<Impl> {
     asImpl().writeUInt32(uint32_t(value));
   }
 
-  template <class T>
-  void writeArray(llvm::ArrayRef<T> array) {
+  template <class T> void writeArray(ArrayRef<T> array) {
     asImpl().writeUInt32(array.size());
     for (const T &elt : array) {
       WriteDispatcher<T>::write(asImpl(), elt);
diff --git a/clang/include/clang/AST/ComputeDependence.h b/clang/include/clang/AST/ComputeDependence.h
index e96275e5f2e07..c298f2620f211 100644
--- a/clang/include/clang/AST/ComputeDependence.h
+++ b/clang/include/clang/AST/ComputeDependence.h
@@ -15,7 +15,7 @@
 
 #include "clang/AST/DependenceFlags.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
-#include "llvm/ADT/ArrayRef.h"
+#include "clang/Basic/LLVM.h"
 
 namespace clang {
 
@@ -180,7 +180,7 @@ ExprDependence computeDependence(ConceptSpecializationExpr *E,
 
 ExprDependence computeDependence(SYCLUniqueStableNameExpr *E);
 ExprDependence computeDependence(PredefinedExpr *E);
-ExprDependence computeDependence(CallExpr *E, llvm::ArrayRef<Expr *> PreArgs);
+ExprDependence computeDependence(CallExpr *E, ArrayRef<Expr *> PreArgs);
 ExprDependence computeDependence(OffsetOfExpr *E);
 ExprDependence computeDependence(MemberExpr *E);
 ExprDependence computeDependence(ShuffleVectorExpr *E);
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 05aac15b30cd6..58209f4601422 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -3417,16 +3417,13 @@ class IndirectFieldDecl : public ValueDecl,
 
   static IndirectFieldDecl *Create(ASTContext &C, DeclContext *DC,
                                    SourceLocation L, const IdentifierInfo *Id,
-                                   QualType T,
-                                   llvm::MutableArrayRef<NamedDecl *> CH);
+                                   QualType T, MutableArrayRef<NamedDecl *> CH);
 
   static IndirectFieldDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);
 
   using chain_iterator = ArrayRef<NamedDecl *>::const_iterator;
 
-  ArrayRef<NamedDecl *> chain() const {
-    return llvm::ArrayRef(Chaining, ChainingSize);
-  }
+  ArrayRef<NamedDecl *> chain() const { return {Chaining, ChainingSize}; }
   chain_iterator chain_begin() const { return chain().begin(); }
   chain_iterator chain_end() const { return chain().end(); }
 
diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h
index df76e6f5015b3..05cddd024d7cf 100644
--- a/clang/include/clang/AST/DeclCXX.h
+++ b/clang/include/clang/AST/DeclCXX.h
@@ -365,12 +365,10 @@ class CXXRecordDecl : public RecordDecl {
       return getVBasesSlowCase();
     }
 
-    ArrayRef<CXXBaseSpecifier> bases() const {
-      return llvm::ArrayRef(getBases(), NumBases);
-    }
+    ArrayRef<CXXBaseSpecifier> bases() const { return {getBases(), NumBases}; }
 
     ArrayRef<CXXBaseSpecifier> vbases() const {
-      return llvm::ArrayRef(getVBases(), NumVBases);
+      return {getVBases(), NumVBases};
     }
 
   private:
@@ -4190,7 +4188,7 @@ class BindingDecl : public ValueDecl {
   Expr *getBinding() const { return Binding; }
 
   // Get the array of nested BindingDecls when the binding represents a pack.
-  llvm::ArrayRef<BindingDecl *> getBindingPackDecls() const;
+  ArrayRef<BindingDecl *> getBindingPackDecls() const;
 
   /// Get the decomposition declaration that this binding represents a
   /// decomposition of.
@@ -4269,11 +4267,11 @@ class DecompositionDecl final
 
   // Provide a flattened range to visit each binding.
   auto flat_bindings() const {
-    llvm::ArrayRef<BindingDecl *> Bindings = bindings();
-    llvm::ArrayRef<BindingDecl *> PackBindings;
+    ArrayRef<BindingDecl *> Bindings = bindings();
+    ArrayRef<BindingDecl *> PackBindings;
 
     // Split the bindings into subranges split by the pack.
-    llvm::ArrayRef<BindingDecl *> BeforePackBindings = Bindings.take_until(
+    ArrayRef<BindingDecl *> BeforePackBindings = Bindings.take_until(
         [](BindingDecl *BD) { return BD->isParameterPack(); });
 
     Bindings = Bindings.drop_front(BeforePackBindings.size());
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index 6e582627c45ed..9014d76f8433b 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/include/clang/AST/DeclObjC.h
@@ -371,7 +371,7 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext {
   // ArrayRef access to formal parameters.  This should eventually
   // replace the iterator interface above.
   ArrayRef<ParmVarDecl*> parameters() const {
-    return llvm::ArrayRef(const_cast<ParmVarDecl **>(getParams()), NumParams);
+    return {const_cast<ParmVarDecl **>(getParams()), NumParams};
   }
 
   ParmVarDecl *getParamDecl(unsigned Idx) {
diff --git a/clang/include/clang/AST/DeclOpenMP.h b/clang/include/clang/AST/DeclOpenMP.h
index 2d07f9d9f5d8c..f3e18ad0339af 100644
--- a/clang/include/clang/AST/DeclOpenMP.h
+++ b/clang/include/clang/AST/DeclOpenMP.h
@@ -118,12 +118,12 @@ class OMPThreadPrivateDecl final : public OMPDeclarativeDirective<Decl> {
 
   ArrayRef<const Expr *> getVars() const {
     auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
-    return llvm::ArrayRef(Storage, Data->getNumChildren());
+    return {Storage, Data->getNumChildren()};
   }
 
   MutableArrayRef<Expr *> getVars() {
     auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
-    return llvm::MutableArrayRef(Storage, Data->getNumChildren());
+    return {Storage, Data->getNumChildren()};
   }
 
   void setVars(ArrayRef<Expr *> VL);
@@ -482,12 +482,12 @@ class OMPAllocateDecl final : public OMPDeclarativeDirective<Decl> {
 
   ArrayRef<const Expr *> getVars() const {
     auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
-    return llvm::ArrayRef(Storage, Data->getNumChildren());
+    return {Storage, Data->getNumChildren()};
   }
 
   MutableArrayRef<Expr *> getVars() {
     auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
-    return llvm::MutableArrayRef(Storage, Data->getNumChildren());
+    return {Storage, Data->getNumChildren()};
   }
 
   void setVars(ArrayRef<Expr *> VL);
diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h
index 939b14b0351d6..1ff6cc6fcb7d1 100644
--- a/clang/include/clang/AST/DeclTemplate.h
+++ b/clang/include/clang/AST/DeclTemplate.h
@@ -139,10 +139,8 @@ class TemplateParameterList final
   unsigned size() const { return NumParams; }
   bool empty() const { return NumParams == 0; }
 
-  ArrayRef<NamedDecl *> asArray() { return llvm::ArrayRef(begin(), end()); }
-  ArrayRef<const NamedDecl*> asArray() const {
-    return llvm::ArrayRef(begin(), size());
-  }
+  ArrayRef<NamedDecl *> asArray() { return {begin(), end()}; }
+  ArrayRef<const NamedDecl *> asArray() const { return {begin(), size()}; }
 
   NamedDecl* getParam(unsigned Idx) {
     assert(Idx < size() && "Template parameter index out-of-range");
@@ -772,7 +770,7 @@ class RedeclarableTemplateDecl : public TemplateDecl,
 
   void loadLazySpecializationsImpl(bool OnlyPartial = false) const;
 
-  bool loadLazySpecializationsImpl(llvm::ArrayRef<TemplateArgument> Args,
+  bool loadLazySpecializationsImpl(ArrayRef<TemplateArgument> Args,
                                    TemplateParameterList *TPL = nullptr) const;
 
   template <class EntryType, typename... ProfileArguments>
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 41e50359962ee..c262433b691a1 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -3106,9 +3106,9 @@ class CallExpr : public Expr {
   /// Compute and set dependence bits.
   void computeDependence() {
     setDependence(clang::computeDependence(
-        this, llvm::ArrayRef(
-                  reinterpret_cast<Expr **>(getTrailingStmts() + PREARGS_START),
-                  getNumPreArgs())));
+        this,
+        ArrayRef(reinterpret_cast<Expr **>(getTrailingStmts() + PREARGS_START),
+                 getNumPreArgs())));
   }
 
   /// Reduce the number of arguments in this call expression. This is used for
@@ -3153,8 +3153,7 @@ class CallExpr : public Expr {
   /// interface.  This provides efficient reverse iteration of the
   /// subexpressions.  This is currently used for CFG construction.
   ArrayRef<Stmt *> getRawSubExprs() {
-    return llvm::ArrayRef(getTrailingStmts(),
-                          PREARGS_START + getNumPreArgs() + getNumArgs());
+    return {getTrailingStmts(), PREARGS_START + getNumPreArgs() + getNumArgs()};
   }
 
   /// Get FPOptionsOverride from trailing storage.
@@ -5276,11 +5275,9 @@ class InitListExpr : public Expr {
     return reinterpret_cast<Expr * const *>(InitExprs.data());
   }
 
-  ArrayRef<Expr *> inits() { return llvm::ArrayRef(getInits(), getNumInits()); }
+  ArrayRef<Expr *> inits() { return {getInits(), getNumInits()}; }
 
-  ArrayRef<Expr *> inits() const {
-    return llvm::ArrayRef(getInits(), getNumInits());
-  }
+  ArrayRef<Expr *> inits() const { return {getInits(), getNumInits()}; }
 
   const Expr *getInit(unsigned Init) const {
     assert(Init < getNumInits() && "Initializer access out of range!");
@@ -5508,7 +5505,7 @@ class DesignatedInitExpr final
   Designator *Designators;
 
   DesignatedInitExpr(const ASTContext &C, QualType Ty,
-                     llvm::ArrayRef<Designator> Designators,
+                     ArrayRef<Designator> Designators,
                      SourceLocation EqualOrColonLoc, bool GNUSyntax,
                      ArrayRef<Expr *> IndexExprs, Expr *Init);
 
@@ -5701,8 +5698,8 @@ class DesignatedInitExpr final
   };
 
   static DesignatedInitExpr *Create(const ASTContext &C,
-                                    llvm::ArrayRef<Designator> Designators,
-                                    ArrayRef<Expr*> IndexExprs,
+                                    ArrayRef<Designator> Designators,
+                                    ArrayRef<Expr *> IndexExprs,
                                     SourceLocation EqualOrColonLoc,
                                     bool GNUSyntax, Expr *Init);
 
@@ -5713,11 +5710,11 @@ class DesignatedInitExpr final
   unsigned size() const { return NumDesignators; }
 
   // Iterator access to the designators.
-  llvm::MutableArrayRef<Designator> designators() {
+  MutableArrayRef<Designator> designators() {
     return {Designators, NumDesignators};
   }
 
-  llvm::ArrayRef<Designator> designators() const {
+  ArrayRef<Designator> designators() const {
     return {Designators, NumDesignators};
   }
 
@@ -6052,7 +6049,7 @@ class ParenListExpr final
 
   Expr **getExprs() { return reinterpret_cast<Expr **>(getTrailingObjects()); }
 
-  ArrayRef<Expr *> exprs() { return llvm::ArrayRef(getExprs(), getNumExprs()); }
+  ArrayRef<Expr *> exprs() { return {getExprs(), getNumExprs()}; }
 
   SourceLocation getLParenLoc() const { return LParenLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
diff --git a/clang/include/clang/AST/ExprObjC.h b/clang/include/clang/AST/ExprObjC.h
index 3d9b3c4585e8a..8210be38608a6 100644
--- a/clang/include/clang/AST/ExprObjC.h
+++ b/clang/include/clang/AST/ExprObjC.h
@@ -1421,8 +1421,7 @@ class ObjCMessageExpr final
     if (hasStandardSelLocs())
       return getStandardSelectorLoc(
           Index, getSelector(), getSelLocsKind() == SelLoc_StandardWithSpace,
-          llvm::ArrayRef(const_cast<Expr **>(getArgs()), getNumArgs()),
-          RBracLoc);
+          ArrayRef(const_cast<Expr **>(getArgs()), getNumArgs()), RBracLoc);
     return getStoredSelLocs()[Index];
   }
 
diff --git a/clang/include/clang/AST/ExternalASTMerger.h b/clang/include/clang/AST/ExternalASTMerger.h
index 2c6f2a941311b..bc3cd31635251 100644
--- a/clang/include/clang/AST/ExternalASTMerger.h
+++ b/clang/include/clang/AST/ExternalASTMerger.h
@@ -113,7 +113,7 @@ class ExternalASTMerger : public ExternalASTSource {
 
 public:
   ExternalASTMerger(const ImporterTarget &Target,
-                    llvm::ArrayRef<ImporterSource> Sources);
+                    ArrayRef<ImporterSource> Sources);
 
   /// Asks all connected ASTImporters if any of them imported the given
   /// declaration. If any ASTImporter did import the given declaration,
@@ -128,7 +128,7 @@ class ExternalASTMerger : public ExternalASTSource {
   /// newly-parsed source files).
   ///
   /// Ensures that Importers does not gain duplicate entries as a result.
-  void AddSources(llvm::ArrayRef<ImporterSource> Sources);
+  void AddSources(ArrayRef<ImporterSource> Sources);
 
   /// Remove a set of ASTContexts as possible origins.
   ///
@@ -137,7 +137,7 @@ class ExternalASTMerger : public ExternalASTSource {
   ///
   /// The caller is responsible for ensuring that this doesn't leave
   /// DeclContexts that can't be completed.
-  void RemoveSources(llvm::ArrayRef<ImporterSource> Sources);
+  void RemoveSources(ArrayRef<ImporterSource> Sources);
 
   /// Implementation of the ExternalASTSource API.
   bool FindExternalVisibleDeclsByName(const DeclContext *DC,
diff --git a/clang/include/clang/AST/OpenACCClause.h b/clang/include/clang/AST/OpenACCClause.h
index a778c7cc3dc98..71ad24a427105 100644
--- a/clang/include/clang/AST/OpenACCClause.h
+++ b/clang/include/clang/AST/OpenACCClause.h
@@ -513,7 +513,7 @@ class OpenACCClauseWithExprs : public OpenACCClauseWithParams {
 
   /// Gets the entire list of expressions, but leave it to the
   /// individual clauses to expose this how they'd like.
-  llvm::ArrayRef<Expr *> getExprs() const { return Exprs; }
+  ArrayRef<Expr *> getExprs() const { return Exprs; }
 
 public:
   static bool classof(const OpenACCClause *C);
@@ -563,10 +563,10 @@ class OpenACCWaitClause final
   SourceLocation getQueuesLoc() const { return QueuesLoc; }
   bool hasDevNumExpr() const { return getExprs()[0]; }
   Expr *getDevNumExpr() const { return getExprs()[0]; }
-  llvm::ArrayRef<Expr *> getQueueIdExprs() {
+  ArrayRef<Expr *> getQueueIdExprs() {
     return OpenACCClauseWithExprs::getExprs().drop_front();
   }
-  llvm::ArrayRef<Expr *> getQueueIdExprs() const {
+  ArrayRef<Expr *> getQueueIdExprs() const {
     return OpenACCClauseWithExprs::getExprs().drop_front();
   }
   // If this is a plain `wait` (no parens) this returns 'false'. Else Sema/Parse
@@ -594,11 +594,9 @@ class OpenACCNumGangsClause final
   Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
          ArrayRef<Expr *> IntExprs, SourceLocation EndLoc);
 
-  llvm::ArrayRef<Expr *> getIntExprs() {
-    return OpenACCClauseWithExprs::getExprs();
-  }
+  ArrayRef<Expr *> getIntExprs() { return OpenACCClauseWithExprs::getExprs(); }
 
-  llvm::ArrayRef<Expr *> getIntExprs() const {
+  ArrayRef<Expr *> getIntExprs() const {
     return OpenACCClauseWithExprs::getExprs();
   }
 };
@@ -622,11 +620,9 @@ class OpenACCTileClause final
                                    SourceLocation LParenLoc,
                                    ArrayRef<Expr *> SizeExprs,
                                    SourceLocation EndLoc);
-  llvm::ArrayRef<Expr *> getSizeExprs() {
-    return OpenACCClauseWithExprs::getExprs();
-  }
+  ArrayRef<Expr *> getSizeExprs() { return OpenACCClauseWithExprs::getExprs(); }
 
-  llvm::ArrayRef<Expr *> getSizeExprs() const {
+  ArrayRef<Expr *> getSizeExprs() const {
     return OpenACCClauseWithExprs::getExprs();
   }
 };
diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h
index 2fa8fa529741e..c2c839f77987c 100644
--- a/clang/include/clang/AST/OpenMPClause.h
+++ b/clang/include/clang/AST/OpenMPClause.h
@@ -3150,10 +3150,10 @@ class OMPPrivateClause final
   /// Gets the list of references to private copies with initializers for
   /// new private variables.
   MutableArrayRef<Expr *> getPrivateCopies() {
-    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
   ArrayRef<const Expr *> getPrivateCopies() const {
-    return llvm::ArrayRef(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
 
 public:
@@ -3259,10 +3259,10 @@ class OMPFirstprivateClause final
   /// Gets the list of references to private copies with initializers for
   /// new private variables.
   MutableArrayRef<Expr *> getPrivateCopies() {
-    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
   ArrayRef<const Expr *> getPrivateCopies() const {
-    return llvm::ArrayRef(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
 
   /// Sets the list of references to initializer variables for new
@@ -3273,10 +3273,10 @@ class OMPFirstprivateClause final
   /// Gets the list of references to initializer variables for new
   /// private variables.
   MutableArrayRef<Expr *> getInits() {
-    return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
+    return {getPrivateCopies().end(), varlist_size()};
   }
   ArrayRef<const Expr *> getInits() const {
-    return llvm::ArrayRef(getPrivateCopies().end(), varlist_size());
+    return {getPrivateCopies().end(), varlist_size()};
   }
 
 public:
@@ -3424,7 +3424,7 @@ class OMPLastprivateClause final
     return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
   }
   ArrayRef<const Expr *> getPrivateCopies() const {
-    return llvm::ArrayRef(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
 
   /// Set list of helper expressions, required for proper codegen of the
@@ -3435,10 +3435,10 @@ class OMPLastprivateClause final
 
   /// Get the list of helper source expressions.
   MutableArrayRef<Expr *> getSourceExprs() {
-    return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
+    return {getPrivateCopies().end(), varlist_size()};
   }
   ArrayRef<const Expr *> getSourceExprs() const {
-    return llvm::ArrayRef(getPrivateCopies().end(), varlist_size());
+    return {getPrivateCopies().end(), varlist_size()};
   }
 
   /// Set list of helper expressions, required for proper codegen of the
@@ -3449,10 +3449,10 @@ class OMPLastprivateClause final
 
   /// Get the list of helper destination expressions.
   MutableArrayRef<Expr *> getDestinationExprs() {
-    return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
+    return {getSourceExprs().end(), varlist_size()};
   }
   ArrayRef<const Expr *> getDestinationExprs() const {
-    return llvm::ArrayRef(getSourceExprs().end(), varlist_size());
+    return {getSourceExprs().end(), varlist_size()};
   }
 
   /// Set list of helper assignment expressions, required for proper
@@ -3462,10 +3462,10 @@ class OMPLastprivateClause final
 
   /// Get the list of helper assignment expressions.
   MutableArrayRef<Expr *> getAssignmentOps() {
-    return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
+    return {getDestinationExprs().end(), varlist_size()};
   }
   ArrayRef<const Expr *> getAssignmentOps() const {
-    return llvm::ArrayRef(getDestinationExprs().end(), varlist_size());
+    return {getDestinationExprs().end(), varlist_size()};
   }
 
   /// Sets lastprivate kind.
@@ -3761,10 +3761,10 @@ class OMPReductionClause final
 
   /// Get the list of helper privates.
   MutableArrayRef<Expr *> getPrivates() {
-    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+    return {varlist_end(), varlist_size()};
   }
   ArrayRef<const ...
[truncated]

@jurahul jurahul merged commit 6cf656e into llvm:main Jun 23, 2025
14 checks passed
@jurahul jurahul deleted the clang_ast_arrayref branch June 23, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:bytecode Issues for the clang bytecode constexpr interpreter clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:modules C++20 modules and Clang Header Modules clang:openmp OpenMP related changes to Clang clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants