[clang] [NFC][Clang][AST] Drop `llvm::` in front of `ArrayRef` (PR #145207)
Rahul Joshi via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 21 23:08:25 PDT 2025
https://github.com/jurahul updated https://github.com/llvm/llvm-project/pull/145207
>From 2e43d4b182cbc998fd19c4bb016123fc0bc15ee3 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Sat, 21 Jun 2025 22:32:22 -0700
Subject: [PATCH] [NFC][Clang][AST] Drop `llvm::` in front of `ArrayRef`
---
clang/include/clang/AST/AbstractBasicReader.h | 3 +-
clang/include/clang/AST/AbstractBasicWriter.h | 3 +-
clang/include/clang/AST/ComputeDependence.h | 4 +-
clang/include/clang/AST/Decl.h | 7 +-
clang/include/clang/AST/DeclCXX.h | 14 +-
clang/include/clang/AST/DeclObjC.h | 2 +-
clang/include/clang/AST/DeclOpenMP.h | 8 +-
clang/include/clang/AST/DeclTemplate.h | 8 +-
clang/include/clang/AST/Expr.h | 27 ++-
clang/include/clang/AST/ExprObjC.h | 3 +-
clang/include/clang/AST/ExternalASTMerger.h | 6 +-
clang/include/clang/AST/OpenACCClause.h | 18 +-
clang/include/clang/AST/OpenMPClause.h | 165 +++++++++---------
clang/include/clang/AST/PropertiesBase.td | 2 +-
clang/include/clang/AST/Stmt.h | 11 +-
clang/include/clang/AST/StmtOpenACC.h | 6 +-
clang/include/clang/AST/StmtOpenMP.h | 23 ++-
clang/include/clang/AST/TemplateBase.h | 10 +-
clang/include/clang/AST/Type.h | 8 +-
clang/include/clang/AST/TypeLoc.h | 6 +-
clang/include/clang/AST/TypeProperties.td | 2 +-
clang/lib/AST/APValue.cpp | 4 +-
clang/lib/AST/ASTContext.cpp | 5 +-
clang/lib/AST/ASTDiagnostic.cpp | 2 +-
clang/lib/AST/ASTImporter.cpp | 34 ++--
clang/lib/AST/ByteCode/Compiler.cpp | 3 +-
clang/lib/AST/ByteCode/Interp.cpp | 2 +-
clang/lib/AST/ByteCode/Interp.h | 2 +-
clang/lib/AST/ByteCode/InterpBuiltin.cpp | 5 +-
clang/lib/AST/ByteCode/InterpShared.cpp | 2 +-
clang/lib/AST/ByteCode/InterpShared.h | 3 +-
clang/lib/AST/CommentParser.cpp | 24 +--
clang/lib/AST/CommentSema.cpp | 6 +-
clang/lib/AST/ComputeDependence.cpp | 9 +-
clang/lib/AST/Decl.cpp | 9 +-
clang/lib/AST/DeclCXX.cpp | 8 +-
clang/lib/AST/DeclPrinter.cpp | 4 +-
clang/lib/AST/Expr.cpp | 14 +-
clang/lib/AST/ExprCXX.cpp | 2 +-
clang/lib/AST/ExprConstant.cpp | 7 +-
clang/lib/AST/ExternalASTMerger.cpp | 9 +-
clang/lib/AST/ItaniumMangle.cpp | 2 +-
clang/lib/AST/OpenACCClause.cpp | 2 +-
clang/lib/AST/ParentMapContext.cpp | 5 +-
clang/lib/AST/StmtPrinter.cpp | 2 +-
clang/lib/AST/TemplateName.cpp | 2 +-
46 files changed, 238 insertions(+), 265 deletions(-)
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 Expr *> getPrivates() const {
- return llvm::ArrayRef(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
/// Set list of helper expressions, required for proper codegen of the
@@ -3774,10 +3774,10 @@ class OMPReductionClause final
/// Get the list of helper LHS expressions.
MutableArrayRef<Expr *> getLHSExprs() {
- return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
+ return {getPrivates().end(), varlist_size()};
}
ArrayRef<const Expr *> getLHSExprs() const {
- return llvm::ArrayRef(getPrivates().end(), varlist_size());
+ return {getPrivates().end(), varlist_size()};
}
/// Set list of helper expressions, required for proper codegen of the
@@ -3817,7 +3817,7 @@ class OMPReductionClause final
return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getRHSExprs() const {
- return ArrayRef(getLHSExprs().end(), varlist_size());
+ return {getLHSExprs().end(), varlist_size()};
}
/// Set list of helper reduction expressions, required for proper
@@ -3828,10 +3828,10 @@ class OMPReductionClause final
/// Get the list of helper reduction expressions.
MutableArrayRef<Expr *> getReductionOps() {
- return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
+ return {getRHSExprs().end(), varlist_size()};
}
ArrayRef<const Expr *> getReductionOps() const {
- return llvm::ArrayRef(getRHSExprs().end(), varlist_size());
+ return {getRHSExprs().end(), varlist_size()};
}
/// Set list of helper copy operations for inscan reductions.
@@ -3840,10 +3840,10 @@ class OMPReductionClause final
/// Get the list of helper inscan copy operations.
MutableArrayRef<Expr *> getInscanCopyOps() {
- return MutableArrayRef<Expr *>(getReductionOps().end(), varlist_size());
+ return {getReductionOps().end(), varlist_size()};
}
ArrayRef<const Expr *> getInscanCopyOps() const {
- return llvm::ArrayRef(getReductionOps().end(), varlist_size());
+ return {getReductionOps().end(), varlist_size()};
}
/// Set list of helper temp vars for inscan copy array operations.
@@ -3851,10 +3851,10 @@ class OMPReductionClause final
/// Get the list of helper inscan copy temps.
MutableArrayRef<Expr *> getInscanCopyArrayTemps() {
- return MutableArrayRef<Expr *>(getInscanCopyOps().end(), varlist_size());
+ return {getInscanCopyOps().end(), varlist_size()};
}
ArrayRef<const Expr *> getInscanCopyArrayTemps() const {
- return llvm::ArrayRef(getInscanCopyOps().end(), varlist_size());
+ return {getInscanCopyOps().end(), varlist_size()};
}
/// Set list of helper temp elements vars for inscan copy array operations.
@@ -3862,11 +3862,10 @@ class OMPReductionClause final
/// Get the list of helper inscan copy temps.
MutableArrayRef<Expr *> getInscanCopyArrayElems() {
- return MutableArrayRef<Expr *>(getInscanCopyArrayTemps().end(),
- varlist_size());
+ return {getInscanCopyArrayTemps().end(), varlist_size()};
}
ArrayRef<const Expr *> getInscanCopyArrayElems() const {
- return llvm::ArrayRef(getInscanCopyArrayTemps().end(), varlist_size());
+ return {getInscanCopyArrayTemps().end(), varlist_size()};
}
public:
@@ -4127,10 +4126,10 @@ class OMPTaskReductionClause final
/// Get the list of helper privates.
MutableArrayRef<Expr *> getPrivates() {
- return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
ArrayRef<const Expr *> getPrivates() const {
- return llvm::ArrayRef(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
/// Set list of helper expressions, required for proper codegen of the clause.
@@ -4140,10 +4139,10 @@ class OMPTaskReductionClause final
/// Get the list of helper LHS expressions.
MutableArrayRef<Expr *> getLHSExprs() {
- return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
+ return {getPrivates().end(), varlist_size()};
}
ArrayRef<const Expr *> getLHSExprs() const {
- return llvm::ArrayRef(getPrivates().end(), varlist_size());
+ return {getPrivates().end(), varlist_size()};
}
/// Set list of helper expressions, required for proper codegen of the clause.
@@ -4154,10 +4153,10 @@ class OMPTaskReductionClause final
/// Get the list of helper destination expressions.
MutableArrayRef<Expr *> getRHSExprs() {
- return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
+ return {getLHSExprs().end(), varlist_size()};
}
ArrayRef<const Expr *> getRHSExprs() const {
- return llvm::ArrayRef(getLHSExprs().end(), varlist_size());
+ return {getLHSExprs().end(), varlist_size()};
}
/// Set list of helper reduction expressions, required for proper
@@ -4168,10 +4167,10 @@ class OMPTaskReductionClause final
/// Get the list of helper reduction expressions.
MutableArrayRef<Expr *> getReductionOps() {
- return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
+ return {getRHSExprs().end(), varlist_size()};
}
ArrayRef<const Expr *> getReductionOps() const {
- return llvm::ArrayRef(getRHSExprs().end(), varlist_size());
+ return {getRHSExprs().end(), varlist_size()};
}
public:
@@ -4358,10 +4357,10 @@ class OMPInReductionClause final
/// Get the list of helper privates.
MutableArrayRef<Expr *> getPrivates() {
- return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
ArrayRef<const Expr *> getPrivates() const {
- return llvm::ArrayRef(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
/// Set list of helper expressions, required for proper codegen of the clause.
@@ -4371,10 +4370,10 @@ class OMPInReductionClause final
/// Get the list of helper LHS expressions.
MutableArrayRef<Expr *> getLHSExprs() {
- return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
+ return {getPrivates().end(), varlist_size()};
}
ArrayRef<const Expr *> getLHSExprs() const {
- return llvm::ArrayRef(getPrivates().end(), varlist_size());
+ return {getPrivates().end(), varlist_size()};
}
/// Set list of helper expressions, required for proper codegen of the clause.
@@ -4385,10 +4384,10 @@ class OMPInReductionClause final
/// Get the list of helper destination expressions.
MutableArrayRef<Expr *> getRHSExprs() {
- return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
+ return {getLHSExprs().end(), varlist_size()};
}
ArrayRef<const Expr *> getRHSExprs() const {
- return llvm::ArrayRef(getLHSExprs().end(), varlist_size());
+ return {getLHSExprs().end(), varlist_size()};
}
/// Set list of helper reduction expressions, required for proper
@@ -4399,10 +4398,10 @@ class OMPInReductionClause final
/// Get the list of helper reduction expressions.
MutableArrayRef<Expr *> getReductionOps() {
- return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
+ return {getRHSExprs().end(), varlist_size()};
}
ArrayRef<const Expr *> getReductionOps() const {
- return llvm::ArrayRef(getRHSExprs().end(), varlist_size());
+ return {getRHSExprs().end(), varlist_size()};
}
/// Set list of helper reduction taskgroup descriptors.
@@ -4410,10 +4409,10 @@ class OMPInReductionClause final
/// Get the list of helper reduction taskgroup descriptors.
MutableArrayRef<Expr *> getTaskgroupDescriptors() {
- return MutableArrayRef<Expr *>(getReductionOps().end(), varlist_size());
+ return {getReductionOps().end(), varlist_size()};
}
ArrayRef<const Expr *> getTaskgroupDescriptors() const {
- return llvm::ArrayRef(getReductionOps().end(), varlist_size());
+ return {getReductionOps().end(), varlist_size()};
}
public:
@@ -4621,41 +4620,41 @@ class OMPLinearClause final
/// { Vars[] /* in OMPVarListClause */; Privates[]; Inits[]; Updates[];
/// Finals[]; Step; CalcStep; }
MutableArrayRef<Expr *> getPrivates() {
- return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
ArrayRef<const Expr *> getPrivates() const {
- return llvm::ArrayRef(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
MutableArrayRef<Expr *> getInits() {
- return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
+ return {getPrivates().end(), varlist_size()};
}
ArrayRef<const Expr *> getInits() const {
- return llvm::ArrayRef(getPrivates().end(), varlist_size());
+ return {getPrivates().end(), varlist_size()};
}
/// Sets the list of update expressions for linear variables.
MutableArrayRef<Expr *> getUpdates() {
- return MutableArrayRef<Expr *>(getInits().end(), varlist_size());
+ return {getInits().end(), varlist_size()};
}
ArrayRef<const Expr *> getUpdates() const {
- return llvm::ArrayRef(getInits().end(), varlist_size());
+ return {getInits().end(), varlist_size()};
}
/// Sets the list of final update expressions for linear variables.
MutableArrayRef<Expr *> getFinals() {
- return MutableArrayRef<Expr *>(getUpdates().end(), varlist_size());
+ return {getUpdates().end(), varlist_size()};
}
ArrayRef<const Expr *> getFinals() const {
- return llvm::ArrayRef(getUpdates().end(), varlist_size());
+ return {getUpdates().end(), varlist_size()};
}
/// Gets the list of used expressions for linear variables.
MutableArrayRef<Expr *> getUsedExprs() {
- return MutableArrayRef<Expr *>(getFinals().end() + 2, varlist_size() + 1);
+ return {getFinals().end() + 2, varlist_size() + 1};
}
ArrayRef<const Expr *> getUsedExprs() const {
- return llvm::ArrayRef(getFinals().end() + 2, varlist_size() + 1);
+ return {getFinals().end() + 2, varlist_size() + 1};
}
/// Sets the list of the copies of original linear variables.
@@ -4989,10 +4988,10 @@ class OMPCopyinClause final
/// Get the list of helper source expressions.
MutableArrayRef<Expr *> getSourceExprs() {
- return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
ArrayRef<const Expr *> getSourceExprs() const {
- return llvm::ArrayRef(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
/// Set list of helper expressions, required for proper codegen of the
@@ -5002,10 +5001,10 @@ class OMPCopyinClause 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
@@ -5016,10 +5015,10 @@ class OMPCopyinClause 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()};
}
public:
@@ -5154,10 +5153,10 @@ class OMPCopyprivateClause final
/// Get the list of helper source expressions.
MutableArrayRef<Expr *> getSourceExprs() {
- return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
ArrayRef<const Expr *> getSourceExprs() const {
- return llvm::ArrayRef(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
/// Set list of helper expressions, required for proper codegen of the
@@ -5167,10 +5166,10 @@ class OMPCopyprivateClause 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
@@ -5181,10 +5180,10 @@ class OMPCopyprivateClause 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()};
}
public:
@@ -6083,7 +6082,7 @@ class OMPMappableExprListClause : public OMPVarListClause<T>,
MutableArrayRef<Expr *> getUDMapperRefs() {
assert(SupportsMapper &&
"Must be a clause that is possible to have user-defined mappers");
- return llvm::MutableArrayRef<Expr *>(
+ return MutableArrayRef<Expr *>(
static_cast<T *>(this)->template getTrailingObjects<Expr *>() +
OMPVarListClause<T>::varlist_size(),
OMPVarListClause<T>::varlist_size());
@@ -6094,7 +6093,7 @@ class OMPMappableExprListClause : public OMPVarListClause<T>,
ArrayRef<Expr *> getUDMapperRefs() const {
assert(SupportsMapper &&
"Must be a clause that is possible to have user-defined mappers");
- return llvm::ArrayRef<Expr *>(
+ return ArrayRef<Expr *>(
static_cast<const T *>(this)->template getTrailingObjects<Expr *>() +
OMPVarListClause<T>::varlist_size(),
OMPVarListClause<T>::varlist_size());
@@ -6604,12 +6603,12 @@ class OMPMapClause final : public OMPMappableExprListClause<OMPMapClause>,
/// Fetches ArrayRef of map-type-modifiers.
ArrayRef<OpenMPMapModifierKind> getMapTypeModifiers() const LLVM_READONLY {
- return llvm::ArrayRef(MapTypeModifiers);
+ return MapTypeModifiers;
}
/// Fetches ArrayRef of location of map-type-modifiers.
ArrayRef<SourceLocation> getMapTypeModifiersLoc() const LLVM_READONLY {
- return llvm::ArrayRef(MapTypeModifiersLoc);
+ return MapTypeModifiersLoc;
}
/// Fetches location of clause mapping kind.
@@ -7594,12 +7593,12 @@ class OMPToClause final : public OMPMappableExprListClause<OMPToClause>,
/// Fetches ArrayRef of motion-modifiers.
ArrayRef<OpenMPMotionModifierKind> getMotionModifiers() const LLVM_READONLY {
- return llvm::ArrayRef(MotionModifiers);
+ return MotionModifiers;
}
/// Fetches ArrayRef of location of motion-modifiers.
ArrayRef<SourceLocation> getMotionModifiersLoc() const LLVM_READONLY {
- return llvm::ArrayRef(MotionModifiersLoc);
+ return MotionModifiersLoc;
}
/// Get colon location.
@@ -7794,12 +7793,12 @@ class OMPFromClause final
/// Fetches ArrayRef of motion-modifiers.
ArrayRef<OpenMPMotionModifierKind> getMotionModifiers() const LLVM_READONLY {
- return llvm::ArrayRef(MotionModifiers);
+ return MotionModifiers;
}
/// Fetches ArrayRef of location of motion-modifiers.
ArrayRef<SourceLocation> getMotionModifiersLoc() const LLVM_READONLY {
- return llvm::ArrayRef(MotionModifiersLoc);
+ return MotionModifiersLoc;
}
/// Get colon location.
@@ -7894,7 +7893,7 @@ class OMPUseDevicePtrClause 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()};
}
/// Sets the list of references to initializer variables for new private
@@ -7905,10 +7904,10 @@ class OMPUseDevicePtrClause 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:
@@ -8339,10 +8338,10 @@ class OMPNontemporalClause final
/// Get the list of privatied copies if the member expression was captured by
/// one of the privatization clauses.
MutableArrayRef<Expr *> getPrivateRefs() {
- return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
ArrayRef<const Expr *> getPrivateRefs() const {
- return llvm::ArrayRef(varlist_end(), varlist_size());
+ return {varlist_end(), varlist_size()};
}
public:
@@ -9462,14 +9461,16 @@ struct OMPTraitProperty {
/// (which accepts anything) and (later) extensions.
StringRef RawString;
};
+
struct OMPTraitSelector {
Expr *ScoreOrCondition = nullptr;
llvm::omp::TraitSelector Kind = llvm::omp::TraitSelector::invalid;
- llvm::SmallVector<OMPTraitProperty, 1> Properties;
+ SmallVector<OMPTraitProperty, 1> Properties;
};
+
struct OMPTraitSet {
llvm::omp::TraitSet Kind = llvm::omp::TraitSet::invalid;
- llvm::SmallVector<OMPTraitSelector, 2> Selectors;
+ SmallVector<OMPTraitSelector, 2> Selectors;
};
/// Helper data structure representing the traits in a match clause of an
diff --git a/clang/include/clang/AST/PropertiesBase.td b/clang/include/clang/AST/PropertiesBase.td
index 8317b6a874fa3..1215056ffde1b 100644
--- a/clang/include/clang/AST/PropertiesBase.td
+++ b/clang/include/clang/AST/PropertiesBase.td
@@ -898,6 +898,6 @@ let Class = PropertyTypeCase<TemplateArgument, "Pack"> in {
TemplateArgument *ctxElements = new (ctx) TemplateArgument[elements.size()];
for (size_t i = 0, e = elements.size(); i != e; ++i)
ctxElements[i] = elements[i];
- return TemplateArgument(llvm::ArrayRef(ctxElements, elements.size()));
+ return TemplateArgument(ArrayRef(ctxElements, elements.size()));
}]>;
}
diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h
index 6c4bd6f6946ba..5771d850856e8 100644
--- a/clang/include/clang/AST/Stmt.h
+++ b/clang/include/clang/AST/Stmt.h
@@ -2236,7 +2236,7 @@ class AttributedStmt final
SourceLocation getAttrLoc() const { return AttributedStmtBits.AttrLoc; }
ArrayRef<const Attr *> getAttrs() const {
- return llvm::ArrayRef(getAttrArrayPtr(), AttributedStmtBits.NumAttrs);
+ return {getAttrArrayPtr(), AttributedStmtBits.NumAttrs};
}
Stmt *getSubStmt() { return SubStmt; }
@@ -3649,16 +3649,13 @@ class MSAsmStmt : public AsmStmt {
//===--- Other ---===//
ArrayRef<StringRef> getAllConstraints() const {
- return llvm::ArrayRef(Constraints, NumInputs + NumOutputs);
+ return {Constraints, NumInputs + NumOutputs};
}
- ArrayRef<StringRef> getClobbers() const {
- return llvm::ArrayRef(Clobbers, NumClobbers);
- }
+ ArrayRef<StringRef> getClobbers() const { return {Clobbers, NumClobbers}; }
ArrayRef<Expr*> getAllExprs() const {
- return llvm::ArrayRef(reinterpret_cast<Expr **>(Exprs),
- NumInputs + NumOutputs);
+ return {reinterpret_cast<Expr **>(Exprs), NumInputs + NumOutputs};
}
StringRef getClobber(unsigned i) const { return getClobbers()[i]; }
diff --git a/clang/include/clang/AST/StmtOpenACC.h b/clang/include/clang/AST/StmtOpenACC.h
index 9ad3d8e00d98a..8b4554e996326 100644
--- a/clang/include/clang/AST/StmtOpenACC.h
+++ b/clang/include/clang/AST/StmtOpenACC.h
@@ -538,10 +538,8 @@ class OpenACCWaitConstruct final
bool hasDevNumExpr() const { return getExprs()[0]; }
Expr *getDevNumExpr() const { return getExprs()[0]; }
- llvm::ArrayRef<Expr *> getQueueIdExprs() { return getExprs().drop_front(); }
- llvm::ArrayRef<Expr *> getQueueIdExprs() const {
- return getExprs().drop_front();
- }
+ ArrayRef<Expr *> getQueueIdExprs() { return getExprs().drop_front(); }
+ ArrayRef<Expr *> getQueueIdExprs() const { return getExprs().drop_front(); }
child_range children() {
Stmt **Begin = reinterpret_cast<Stmt **>(getExprPtr());
diff --git a/clang/include/clang/AST/StmtOpenMP.h b/clang/include/clang/AST/StmtOpenMP.h
index e2fd2114026f7..2fb33d3036bca 100644
--- a/clang/include/clang/AST/StmtOpenMP.h
+++ b/clang/include/clang/AST/StmtOpenMP.h
@@ -399,9 +399,8 @@ class OMPExecutableDirective : public Stmt {
static llvm::iterator_range<used_clauses_child_iterator>
used_clauses_children(ArrayRef<OMPClause *> Clauses) {
- return {
- used_clauses_child_iterator(Clauses),
- used_clauses_child_iterator(llvm::ArrayRef(Clauses.end(), (size_t)0))};
+ return {used_clauses_child_iterator(Clauses),
+ used_clauses_child_iterator(ArrayRef(Clauses.end(), (size_t)0))};
}
/// Iterates over a filtered subrange of clauses applied to a
@@ -446,7 +445,7 @@ class OMPExecutableDirective : public Stmt {
getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
return {specific_clause_iterator<SpecificClause>(Clauses),
specific_clause_iterator<SpecificClause>(
- llvm::ArrayRef(Clauses.end(), (size_t)0))};
+ ArrayRef(Clauses.end(), (size_t)0))};
}
template <typename SpecificClause>
@@ -1069,7 +1068,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
MutableArrayRef<Expr *> getCounters() {
auto **Storage = reinterpret_cast<Expr **>(
&Data->getChildren()[getArraysOffset(getDirectiveKind())]);
- return llvm::MutableArrayRef(Storage, getLoopsNumber());
+ return {Storage, getLoopsNumber()};
}
/// Get the private counters storage.
@@ -1077,7 +1076,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
auto **Storage = reinterpret_cast<Expr **>(
&Data->getChildren()[getArraysOffset(getDirectiveKind()) +
getLoopsNumber()]);
- return llvm::MutableArrayRef(Storage, getLoopsNumber());
+ return {Storage, getLoopsNumber()};
}
/// Get the updates storage.
@@ -1085,7 +1084,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
auto **Storage = reinterpret_cast<Expr **>(
&Data->getChildren()[getArraysOffset(getDirectiveKind()) +
2 * getLoopsNumber()]);
- return llvm::MutableArrayRef(Storage, getLoopsNumber());
+ return {Storage, getLoopsNumber()};
}
/// Get the updates storage.
@@ -1093,7 +1092,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
auto **Storage = reinterpret_cast<Expr **>(
&Data->getChildren()[getArraysOffset(getDirectiveKind()) +
3 * getLoopsNumber()]);
- return llvm::MutableArrayRef(Storage, getLoopsNumber());
+ return {Storage, getLoopsNumber()};
}
/// Get the final counter updates storage.
@@ -1101,7 +1100,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
auto **Storage = reinterpret_cast<Expr **>(
&Data->getChildren()[getArraysOffset(getDirectiveKind()) +
4 * getLoopsNumber()]);
- return llvm::MutableArrayRef(Storage, getLoopsNumber());
+ return {Storage, getLoopsNumber()};
}
/// Get the dependent counters storage.
@@ -1109,7 +1108,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
auto **Storage = reinterpret_cast<Expr **>(
&Data->getChildren()[getArraysOffset(getDirectiveKind()) +
5 * getLoopsNumber()]);
- return llvm::MutableArrayRef(Storage, getLoopsNumber());
+ return {Storage, getLoopsNumber()};
}
/// Get the dependent inits storage.
@@ -1117,7 +1116,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
auto **Storage = reinterpret_cast<Expr **>(
&Data->getChildren()[getArraysOffset(getDirectiveKind()) +
6 * getLoopsNumber()]);
- return llvm::MutableArrayRef(Storage, getLoopsNumber());
+ return {Storage, getLoopsNumber()};
}
/// Get the finals conditions storage.
@@ -1125,7 +1124,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
auto **Storage = reinterpret_cast<Expr **>(
&Data->getChildren()[getArraysOffset(getDirectiveKind()) +
7 * getLoopsNumber()]);
- return llvm::MutableArrayRef(Storage, getLoopsNumber());
+ return {Storage, getLoopsNumber()};
}
protected:
diff --git a/clang/include/clang/AST/TemplateBase.h b/clang/include/clang/AST/TemplateBase.h
index 84a342ec053a1..b67036cae4261 100644
--- a/clang/include/clang/AST/TemplateBase.h
+++ b/clang/include/clang/AST/TemplateBase.h
@@ -436,7 +436,7 @@ class TemplateArgument {
/// Iterator range referencing all of the elements of a template
/// argument pack.
ArrayRef<TemplateArgument> pack_elements() const {
- return llvm::ArrayRef(pack_begin(), pack_end());
+ return {pack_begin(), pack_end()};
}
/// The number of template arguments in the given template argument
@@ -449,7 +449,7 @@ class TemplateArgument {
/// Return the array of arguments in this template argument pack.
ArrayRef<TemplateArgument> getPackAsArray() const {
assert(getKind() == Pack);
- return llvm::ArrayRef(Args.Args, Args.NumArgs);
+ return {Args.Args, Args.NumArgs};
}
/// Determines whether two template arguments are superficially the
@@ -662,7 +662,7 @@ class TemplateArgumentListInfo {
return Arguments.data();
}
- llvm::ArrayRef<TemplateArgumentLoc> arguments() const { return Arguments; }
+ ArrayRef<TemplateArgumentLoc> arguments() const { return Arguments; }
const TemplateArgumentLoc &operator[](unsigned I) const {
return Arguments[I];
@@ -708,8 +708,8 @@ struct ASTTemplateArgumentListInfo final
}
unsigned getNumTemplateArgs() const { return NumTemplateArgs; }
- llvm::ArrayRef<TemplateArgumentLoc> arguments() const {
- return llvm::ArrayRef(getTemplateArgs(), getNumTemplateArgs());
+ ArrayRef<TemplateArgumentLoc> arguments() const {
+ return {getTemplateArgs(), getNumTemplateArgs()};
}
const TemplateArgumentLoc &operator[](unsigned I) const {
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index 35a8b898d8e19..24f3ae78e857b 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -5439,7 +5439,7 @@ class FunctionProtoType final
}
ArrayRef<QualType> getParamTypes() const {
- return llvm::ArrayRef(param_type_begin(), param_type_end());
+ return {param_type_begin(), param_type_end()};
}
ExtProtoInfo getExtProtoInfo() const {
@@ -5593,7 +5593,7 @@ class FunctionProtoType final
using param_type_iterator = const QualType *;
ArrayRef<QualType> param_types() const {
- return llvm::ArrayRef(param_type_begin(), param_type_end());
+ return {param_type_begin(), param_type_end()};
}
param_type_iterator param_type_begin() const {
@@ -5607,7 +5607,7 @@ class FunctionProtoType final
using exception_iterator = const QualType *;
ArrayRef<QualType> exceptions() const {
- return llvm::ArrayRef(exception_begin(), exception_end());
+ return {exception_begin(), exception_end()};
}
exception_iterator exception_begin() const {
@@ -7610,7 +7610,7 @@ class ObjCObjectType : public Type,
/// Retrieve the type arguments of this object type as they were
/// written.
ArrayRef<QualType> getTypeArgsAsWritten() const {
- return llvm::ArrayRef(getTypeArgStorage(), ObjCObjectTypeBits.NumTypeArgs);
+ return {getTypeArgStorage(), ObjCObjectTypeBits.NumTypeArgs};
}
/// Whether this is a "__kindof" type as written.
diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h
index 53c7ea8c65df2..cf06e27758996 100644
--- a/clang/include/clang/AST/TypeLoc.h
+++ b/clang/include/clang/AST/TypeLoc.h
@@ -828,7 +828,7 @@ class ObjCTypeParamTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
}
ArrayRef<SourceLocation> getProtocolLocs() const {
- return llvm::ArrayRef(getProtocolLocArray(), getNumProtocols());
+ return {getProtocolLocArray(), getNumProtocols()};
}
void initializeLocal(ASTContext &Context, SourceLocation Loc);
@@ -1088,7 +1088,7 @@ class ObjCObjectTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
ArrayRef<SourceLocation> getProtocolLocs() const {
- return llvm::ArrayRef(getProtocolLocArray(), getNumProtocols());
+ return {getProtocolLocArray(), getNumProtocols()};
}
bool hasBaseTypeAsWritten() const {
@@ -1545,7 +1545,7 @@ class FunctionTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
}
ArrayRef<ParmVarDecl *> getParams() const {
- return llvm::ArrayRef(getParmArray(), getNumParams());
+ return {getParmArray(), getNumParams()};
}
// ParmVarDecls* are stored after Info, one for each parameter.
diff --git a/clang/include/clang/AST/TypeProperties.td b/clang/include/clang/AST/TypeProperties.td
index d7dbf1b43df26..a6157649060b1 100644
--- a/clang/include/clang/AST/TypeProperties.td
+++ b/clang/include/clang/AST/TypeProperties.td
@@ -335,7 +335,7 @@ let Class = FunctionProtoType in {
def : Property<"extParameterInfo", Array<ExtParameterInfo>> {
let Read = [{ node->hasExtParameterInfos()
? node->getExtParameterInfos()
- : llvm::ArrayRef<FunctionProtoType::ExtParameterInfo>() }];
+ : ArrayRef<FunctionProtoType::ExtParameterInfo>() }];
}
def : Property<"AArch64SMEAttributes", UInt32> {
let Read = [{ node->getAArch64SMEAttributes() }];
diff --git a/clang/lib/AST/APValue.cpp b/clang/lib/AST/APValue.cpp
index 7c33d3a165a08..c641ff6b99bab 100644
--- a/clang/lib/AST/APValue.cpp
+++ b/clang/lib/AST/APValue.cpp
@@ -1003,7 +1003,7 @@ bool APValue::hasLValuePath() const {
ArrayRef<APValue::LValuePathEntry> APValue::getLValuePath() const {
assert(isLValue() && hasLValuePath() && "Invalid accessor");
const LV &LVal = *((const LV *)(const char *)&Data);
- return llvm::ArrayRef(LVal.getPath(), LVal.PathLength);
+ return {LVal.getPath(), LVal.PathLength};
}
unsigned APValue::getLValueCallIndex() const {
@@ -1081,7 +1081,7 @@ ArrayRef<const CXXRecordDecl*> APValue::getMemberPointerPath() const {
assert(isMemberPointer() && "Invalid accessor");
const MemberPointerData &MPD =
*((const MemberPointerData *)(const char *)&Data);
- return llvm::ArrayRef(MPD.getPath(), MPD.PathLength);
+ return {MPD.getPath(), MPD.PathLength};
}
void APValue::MakeLValue() {
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 02d6570d0ea0f..e851e8c3d8143 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -6107,8 +6107,7 @@ SortAndUniqueProtocols(SmallVectorImpl<ObjCProtocolDecl *> &Protocols) {
QualType ASTContext::getObjCObjectType(QualType BaseType,
ObjCProtocolDecl * const *Protocols,
unsigned NumProtocols) const {
- return getObjCObjectType(BaseType, {},
- llvm::ArrayRef(Protocols, NumProtocols),
+ return getObjCObjectType(BaseType, {}, ArrayRef(Protocols, NumProtocols),
/*isKindOf=*/false);
}
@@ -14593,7 +14592,7 @@ static QualType getCommonSugarTypeNode(ASTContext &Ctx, const Type *X,
return QualType();
Expr *CEX = DX->getCountExpr();
Expr *CEY = DY->getCountExpr();
- llvm::ArrayRef<clang::TypeCoupledDeclRefInfo> CDX = DX->getCoupledDecls();
+ ArrayRef<clang::TypeCoupledDeclRefInfo> CDX = DX->getCoupledDecls();
if (Ctx.hasSameExpr(CEX, CEY))
return Ctx.getCountAttributedType(Ctx.getQualifiedType(Underlying), CEX,
DX->isCountInBytes(), DX->isOrNull(),
diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp
index 522abd5912dbd..20a4c3a43d2ca 100644
--- a/clang/lib/AST/ASTDiagnostic.cpp
+++ b/clang/lib/AST/ASTDiagnostic.cpp
@@ -228,7 +228,7 @@ break; \
desugarForDiagnostic(Context, Ty->getBaseType(), ShouldAKA);
QT = Context.getObjCObjectType(
BaseType, Ty->getTypeArgsAsWritten(),
- llvm::ArrayRef(Ty->qual_begin(), Ty->getNumProtocols()),
+ ArrayRef(Ty->qual_begin(), Ty->getNumProtocols()),
Ty->isKindOfTypeAsWritten());
}
}
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index 4621ebb854d8e..13f81b9a199f6 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -904,8 +904,7 @@ ASTNodeImporter::import(const TemplateArgument &From) {
if (Error Err = ImportTemplateArguments(From.pack_elements(), ToPack))
return std::move(Err);
- return TemplateArgument(
- llvm::ArrayRef(ToPack).copy(Importer.getToContext()));
+ return TemplateArgument(ArrayRef(ToPack).copy(Importer.getToContext()));
}
}
@@ -4348,7 +4347,7 @@ ExpectedDecl ASTNodeImporter::VisitIndirectFieldDecl(IndirectFieldDecl *D) {
else
return ToD.takeError();
- llvm::MutableArrayRef<NamedDecl *> CH = {NamedChain, D->getChainingSize()};
+ MutableArrayRef<NamedDecl *> CH = {NamedChain, D->getChainingSize()};
IndirectFieldDecl *ToIndirectField;
if (GetImportedOrCreateDecl(ToIndirectField, D, Importer.getToContext(), DC,
Loc, Name.getAsIdentifierInfo(), *TypeOrErr, CH))
@@ -6339,8 +6338,7 @@ ExpectedDecl ASTNodeImporter::VisitClassTemplateSpecializationDecl(
if (GetImportedOrCreateDecl<ClassTemplatePartialSpecializationDecl>(
D2, D, Importer.getToContext(), D->getTagKind(), DC, *BeginLocOrErr,
*IdLocOrErr, ToTPList, ClassTemplate,
- llvm::ArrayRef(TemplateArgs.data(), TemplateArgs.size()),
- CanonInjType,
+ ArrayRef(TemplateArgs.data(), TemplateArgs.size()), CanonInjType,
cast_or_null<ClassTemplatePartialSpecializationDecl>(PrevDecl)))
return D2;
@@ -7439,7 +7437,7 @@ ExpectedStmt ASTNodeImporter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
const unsigned NumSubExprs = E->getNumSubExprs();
llvm::SmallVector<Expr *, 8> ToSubExprs;
- llvm::ArrayRef<Expr *> FromSubExprs(E->getSubExprs(), NumSubExprs);
+ ArrayRef<Expr *> FromSubExprs(E->getSubExprs(), NumSubExprs);
ToSubExprs.resize(NumSubExprs);
if ((Err = ImportContainerChecked(FromSubExprs, ToSubExprs)))
@@ -7492,25 +7490,25 @@ ASTNodeImporter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
if (E->isResultDependent()) {
if (ToControllingExpr) {
return GenericSelectionExpr::Create(
- ToCtx, ToGenericLoc, ToControllingExpr, llvm::ArrayRef(ToAssocTypes),
- llvm::ArrayRef(ToAssocExprs), ToDefaultLoc, ToRParenLoc,
+ ToCtx, ToGenericLoc, ToControllingExpr, ArrayRef(ToAssocTypes),
+ ArrayRef(ToAssocExprs), ToDefaultLoc, ToRParenLoc,
E->containsUnexpandedParameterPack());
}
return GenericSelectionExpr::Create(
- ToCtx, ToGenericLoc, ToControllingType, llvm::ArrayRef(ToAssocTypes),
- llvm::ArrayRef(ToAssocExprs), ToDefaultLoc, ToRParenLoc,
+ ToCtx, ToGenericLoc, ToControllingType, ArrayRef(ToAssocTypes),
+ ArrayRef(ToAssocExprs), ToDefaultLoc, ToRParenLoc,
E->containsUnexpandedParameterPack());
}
if (ToControllingExpr) {
return GenericSelectionExpr::Create(
- ToCtx, ToGenericLoc, ToControllingExpr, llvm::ArrayRef(ToAssocTypes),
- llvm::ArrayRef(ToAssocExprs), ToDefaultLoc, ToRParenLoc,
+ ToCtx, ToGenericLoc, ToControllingExpr, ArrayRef(ToAssocTypes),
+ ArrayRef(ToAssocExprs), ToDefaultLoc, ToRParenLoc,
E->containsUnexpandedParameterPack(), E->getResultIndex());
}
return GenericSelectionExpr::Create(
- ToCtx, ToGenericLoc, ToControllingType, llvm::ArrayRef(ToAssocTypes),
- llvm::ArrayRef(ToAssocExprs), ToDefaultLoc, ToRParenLoc,
+ ToCtx, ToGenericLoc, ToControllingType, ArrayRef(ToAssocTypes),
+ ArrayRef(ToAssocExprs), ToDefaultLoc, ToRParenLoc,
E->containsUnexpandedParameterPack(), E->getResultIndex());
}
@@ -8636,7 +8634,7 @@ ExpectedStmt ASTNodeImporter::VisitCXXUnresolvedConstructExpr(
return CXXUnresolvedConstructExpr::Create(
Importer.getToContext(), ToType, ToTypeSourceInfo, ToLParenLoc,
- llvm::ArrayRef(ToArgs), ToRParenLoc, E->isListInitialization());
+ ArrayRef(ToArgs), ToRParenLoc, E->isListInitialization());
}
ExpectedStmt
@@ -10396,8 +10394,7 @@ ASTNodeImporter::ImportAPValue(const APValue &FromValue) {
cast<const ValueDecl>(ImpMemPtrDecl),
FromValue.isMemberPointerToDerivedMember(),
FromValue.getMemberPointerPath().size());
- llvm::ArrayRef<const CXXRecordDecl *> FromPath =
- Result.getMemberPointerPath();
+ ArrayRef<const CXXRecordDecl *> FromPath = Result.getMemberPointerPath();
for (unsigned Idx = 0; Idx < FromValue.getMemberPointerPath().size();
Idx++) {
const Decl *ImpDecl = importChecked(Err, FromPath[Idx]);
@@ -10454,8 +10451,7 @@ ASTNodeImporter::ImportAPValue(const APValue &FromValue) {
MutableArrayRef<APValue::LValuePathEntry> ToPath = Result.setLValueUninit(
Base, Offset, PathLength, FromValue.isLValueOnePastTheEnd(),
FromValue.isNullPointer());
- llvm::ArrayRef<APValue::LValuePathEntry> FromPath =
- FromValue.getLValuePath();
+ ArrayRef<APValue::LValuePathEntry> FromPath = FromValue.getLValuePath();
for (unsigned LoopIdx = 0; LoopIdx < PathLength; LoopIdx++) {
if (FromElemTy->isRecordType()) {
const Decl *FromDecl =
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index c5ac40210e477..81da16e797bce 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -4956,8 +4956,7 @@ bool Compiler<Emitter>::VisitCallExpr(const CallExpr *E) {
}
}
- SmallVector<const Expr *, 8> Args(
- llvm::ArrayRef(E->getArgs(), E->getNumArgs()));
+ SmallVector<const Expr *, 8> Args(ArrayRef(E->getArgs(), E->getNumArgs()));
bool IsAssignmentOperatorCall = false;
if (const auto *OCE = dyn_cast<CXXOperatorCallExpr>(E);
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index 1e2032feabb64..51cf0c59f0b50 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -1108,7 +1108,7 @@ bool CheckDummy(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
bool CheckNonNullArgs(InterpState &S, CodePtr OpPC, const Function *F,
const CallExpr *CE, unsigned ArgSize) {
- auto Args = llvm::ArrayRef(CE->getArgs(), CE->getNumArgs());
+ auto Args = ArrayRef(CE->getArgs(), CE->getNumArgs());
auto NonNullArgs = collectNonNullArgs(F->getDecl(), Args);
unsigned Offset = 0;
unsigned Index = 0;
diff --git a/clang/lib/AST/ByteCode/Interp.h b/clang/lib/AST/ByteCode/Interp.h
index 66d3e6d79e8b2..190d177c4f3c8 100644
--- a/clang/lib/AST/ByteCode/Interp.h
+++ b/clang/lib/AST/ByteCode/Interp.h
@@ -307,7 +307,7 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
/// Interpret an offsetof operation.
bool InterpretOffsetOf(InterpState &S, CodePtr OpPC, const OffsetOfExpr *E,
- llvm::ArrayRef<int64_t> ArrayIndices, int64_t &Result);
+ ArrayRef<int64_t> ArrayIndices, int64_t &Result);
inline bool Invalid(InterpState &S, CodePtr OpPC);
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index 5304bd77f2c06..b9fcfebefdf53 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -1478,7 +1478,7 @@ static bool interp__builtin_operator_new(InterpState &S, CodePtr OpPC,
// The std::nothrow_t arg never gets put on the stack.
if (Call->getArg(NumArgs - 1)->getType()->isNothrowT())
--NumArgs;
- auto Args = llvm::ArrayRef(Call->getArgs(), Call->getNumArgs());
+ auto Args = ArrayRef(Call->getArgs(), Call->getNumArgs());
// First arg is needed.
Args = Args.drop_front();
@@ -2626,8 +2626,7 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
}
bool InterpretOffsetOf(InterpState &S, CodePtr OpPC, const OffsetOfExpr *E,
- llvm::ArrayRef<int64_t> ArrayIndices,
- int64_t &IntResult) {
+ ArrayRef<int64_t> ArrayIndices, int64_t &IntResult) {
CharUnits Result;
unsigned N = E->getNumComponents();
assert(N > 0);
diff --git a/clang/lib/AST/ByteCode/InterpShared.cpp b/clang/lib/AST/ByteCode/InterpShared.cpp
index 6af03691f1b20..1e94dc19d03c1 100644
--- a/clang/lib/AST/ByteCode/InterpShared.cpp
+++ b/clang/lib/AST/ByteCode/InterpShared.cpp
@@ -14,7 +14,7 @@ namespace clang {
namespace interp {
llvm::BitVector collectNonNullArgs(const FunctionDecl *F,
- const llvm::ArrayRef<const Expr *> &Args) {
+ ArrayRef<const Expr *> Args) {
llvm::BitVector NonNullArgs;
if (!F)
return NonNullArgs;
diff --git a/clang/lib/AST/ByteCode/InterpShared.h b/clang/lib/AST/ByteCode/InterpShared.h
index 8c5e0bee22c92..9355fb77e143a 100644
--- a/clang/lib/AST/ByteCode/InterpShared.h
+++ b/clang/lib/AST/ByteCode/InterpShared.h
@@ -9,6 +9,7 @@
#ifndef LLVM_CLANG_LIB_AST_INTERP_SHARED_H
#define LLVM_CLANG_LIB_AST_INTERP_SHARED_H
+#include "clang/Basic/LLVM.h"
#include "llvm/ADT/BitVector.h"
namespace clang {
@@ -18,7 +19,7 @@ class Expr;
namespace interp {
llvm::BitVector collectNonNullArgs(const FunctionDecl *F,
- const llvm::ArrayRef<const Expr *> &Args);
+ ArrayRef<const Expr *> Args);
} // namespace interp
} // namespace clang
diff --git a/clang/lib/AST/CommentParser.cpp b/clang/lib/AST/CommentParser.cpp
index 12ed8e3f1b79a..e61846d241915 100644
--- a/clang/lib/AST/CommentParser.cpp
+++ b/clang/lib/AST/CommentParser.cpp
@@ -375,7 +375,7 @@ class TextTokenRetokenizer {
Pos.CurToken++;
}
- P.putBack(llvm::ArrayRef(Toks.begin() + Pos.CurToken, Toks.end()));
+ P.putBack(ArrayRef(Toks.begin() + Pos.CurToken, Toks.end()));
Pos.CurToken = Toks.size();
if (HavePartialTok)
@@ -431,7 +431,7 @@ Parser::parseCommandArgs(TextTokenRetokenizer &Retokenizer, unsigned NumArgs) {
ParsedArgs++;
}
- return llvm::ArrayRef(Args, ParsedArgs);
+ return ArrayRef(Args, ParsedArgs);
}
ArrayRef<Comment::Argument>
@@ -448,7 +448,7 @@ Parser::parseThrowCommandArgs(TextTokenRetokenizer &Retokenizer,
ParsedArgs++;
}
- return llvm::ArrayRef(Args, ParsedArgs);
+ return ArrayRef(Args, ParsedArgs);
}
ArrayRef<Comment::Argument>
@@ -466,7 +466,7 @@ Parser::parseParCommandArgs(TextTokenRetokenizer &Retokenizer,
ParsedArgs++;
}
- return llvm::ArrayRef(Args, ParsedArgs);
+ return ArrayRef(Args, ParsedArgs);
}
BlockCommandComment *Parser::parseBlockCommand() {
@@ -638,14 +638,14 @@ HTMLStartTagComment *Parser::parseHTMLStartTag() {
}
case tok::html_greater:
- S.actOnHTMLStartTagFinish(HST, S.copyArray(llvm::ArrayRef(Attrs)),
+ S.actOnHTMLStartTagFinish(HST, S.copyArray(ArrayRef(Attrs)),
Tok.getLocation(),
/* IsSelfClosing = */ false);
consumeToken();
return HST;
case tok::html_slash_greater:
- S.actOnHTMLStartTagFinish(HST, S.copyArray(llvm::ArrayRef(Attrs)),
+ S.actOnHTMLStartTagFinish(HST, S.copyArray(ArrayRef(Attrs)),
Tok.getLocation(),
/* IsSelfClosing = */ true);
consumeToken();
@@ -663,14 +663,14 @@ HTMLStartTagComment *Parser::parseHTMLStartTag() {
Tok.is(tok::html_slash_greater))
continue;
- S.actOnHTMLStartTagFinish(HST, S.copyArray(llvm::ArrayRef(Attrs)),
+ S.actOnHTMLStartTagFinish(HST, S.copyArray(ArrayRef(Attrs)),
SourceLocation(),
/* IsSelfClosing = */ false);
return HST;
default:
// Not a token from an HTML start tag. Thus HTML tag prematurely ended.
- S.actOnHTMLStartTagFinish(HST, S.copyArray(llvm::ArrayRef(Attrs)),
+ S.actOnHTMLStartTagFinish(HST, S.copyArray(ArrayRef(Attrs)),
SourceLocation(),
/* IsSelfClosing = */ false);
bool StartLineInvalid;
@@ -809,7 +809,7 @@ BlockContentComment *Parser::parseParagraphOrBlockCommand() {
break;
}
- return S.actOnParagraphComment(S.copyArray(llvm::ArrayRef(Content)));
+ return S.actOnParagraphComment(S.copyArray(ArrayRef(Content)));
}
VerbatimBlockComment *Parser::parseVerbatimBlock() {
@@ -847,12 +847,12 @@ VerbatimBlockComment *Parser::parseVerbatimBlock() {
if (Tok.is(tok::verbatim_block_end)) {
const CommandInfo *Info = Traits.getCommandInfo(Tok.getVerbatimBlockID());
S.actOnVerbatimBlockFinish(VB, Tok.getLocation(), Info->Name,
- S.copyArray(llvm::ArrayRef(Lines)));
+ S.copyArray(ArrayRef(Lines)));
consumeToken();
} else {
// Unterminated \\verbatim block
S.actOnVerbatimBlockFinish(VB, SourceLocation(), "",
- S.copyArray(llvm::ArrayRef(Lines)));
+ S.copyArray(ArrayRef(Lines)));
}
return VB;
@@ -928,7 +928,7 @@ FullComment *Parser::parseFullComment() {
while (Tok.is(tok::newline))
consumeToken();
}
- return S.actOnFullComment(S.copyArray(llvm::ArrayRef(Blocks)));
+ return S.actOnFullComment(S.copyArray(ArrayRef(Blocks)));
}
} // end namespace comments
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp
index fb745fc560d2f..36a9ebe14d7da 100644
--- a/clang/lib/AST/CommentSema.cpp
+++ b/clang/lib/AST/CommentSema.cpp
@@ -268,7 +268,7 @@ void Sema::actOnParamCommandParamNameArg(ParamCommandComment *Command,
}
auto *A = new (Allocator)
Comment::Argument{SourceRange(ArgLocBegin, ArgLocEnd), Arg};
- Command->setArgs(llvm::ArrayRef(A, 1));
+ Command->setArgs(ArrayRef(A, 1));
}
void Sema::actOnParamCommandFinish(ParamCommandComment *Command,
@@ -304,7 +304,7 @@ void Sema::actOnTParamCommandParamNameArg(TParamCommandComment *Command,
auto *A = new (Allocator)
Comment::Argument{SourceRange(ArgLocBegin, ArgLocEnd), Arg};
- Command->setArgs(llvm::ArrayRef(A, 1));
+ Command->setArgs(ArrayRef(A, 1));
if (!isTemplateOrSpecialization()) {
// We already warned that this \\tparam is not attached to a template decl.
@@ -315,7 +315,7 @@ void Sema::actOnTParamCommandParamNameArg(TParamCommandComment *Command,
ThisDeclInfo->TemplateParameters;
SmallVector<unsigned, 2> Position;
if (resolveTParamReference(Arg, TemplateParameters, &Position)) {
- Command->setPosition(copyArray(llvm::ArrayRef(Position)));
+ Command->setPosition(copyArray(ArrayRef(Position)));
TParamCommandComment *&PrevCommand = TemplateParameterDocs[Arg];
if (PrevCommand) {
SourceRange ArgRange(ArgLocBegin, ArgLocEnd);
diff --git a/clang/lib/AST/ComputeDependence.cpp b/clang/lib/AST/ComputeDependence.cpp
index fd2eefa1cf076..14ec93eb1d166 100644
--- a/clang/lib/AST/ComputeDependence.cpp
+++ b/clang/lib/AST/ComputeDependence.cpp
@@ -639,12 +639,11 @@ ExprDependence clang::computeDependence(PredefinedExpr *E) {
return toExprDependenceForImpliedType(E->getType()->getDependence());
}
-ExprDependence clang::computeDependence(CallExpr *E,
- llvm::ArrayRef<Expr *> PreArgs) {
+ExprDependence clang::computeDependence(CallExpr *E, ArrayRef<Expr *> PreArgs) {
auto D = E->getCallee()->getDependence();
if (E->getType()->isDependentType())
D |= ExprDependence::Type;
- for (auto *A : llvm::ArrayRef(E->getArgs(), E->getNumArgs())) {
+ for (auto *A : ArrayRef(E->getArgs(), E->getNumArgs())) {
if (A)
D |= A->getDependence();
}
@@ -709,7 +708,7 @@ ExprDependence clang::computeDependence(InitListExpr *E) {
ExprDependence clang::computeDependence(ShuffleVectorExpr *E) {
auto D = toExprDependenceForImpliedType(E->getType()->getDependence());
- for (auto *C : llvm::ArrayRef(E->getSubExprs(), E->getNumSubExprs()))
+ for (auto *C : ArrayRef(E->getSubExprs(), E->getNumSubExprs()))
D |= C->getDependence();
return D;
}
@@ -758,7 +757,7 @@ ExprDependence clang::computeDependence(PseudoObjectExpr *O) {
ExprDependence clang::computeDependence(AtomicExpr *A) {
auto D = ExprDependence::None;
- for (auto *E : llvm::ArrayRef(A->getSubExprs(), A->getNumSubExprs()))
+ for (auto *E : ArrayRef(A->getSubExprs(), A->getNumSubExprs()))
D |= E->getDependence();
return D;
}
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index c4376aab480cd..5cbe6310e088d 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -5607,10 +5607,11 @@ IndirectFieldDecl::IndirectFieldDecl(ASTContext &C, DeclContext *DC,
IdentifierNamespace |= IDNS_Tag;
}
-IndirectFieldDecl *
-IndirectFieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
- const IdentifierInfo *Id, QualType T,
- llvm::MutableArrayRef<NamedDecl *> CH) {
+IndirectFieldDecl *IndirectFieldDecl::Create(ASTContext &C, DeclContext *DC,
+ SourceLocation L,
+ const IdentifierInfo *Id,
+ QualType T,
+ MutableArrayRef<NamedDecl *> CH) {
return new (C, DC) IndirectFieldDecl(C, DC, L, Id, T, CH);
}
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp
index f1f31d8be78c9..ccb308e103253 100644
--- a/clang/lib/AST/DeclCXX.cpp
+++ b/clang/lib/AST/DeclCXX.cpp
@@ -1828,7 +1828,7 @@ CXXRecordDecl::getLambdaExplicitTemplateParameters() const {
const auto ExplicitEnd = llvm::partition_point(
*List, [](const NamedDecl *D) { return !D->isImplicit(); });
- return llvm::ArrayRef(List->begin(), ExplicitEnd);
+ return ArrayRef(List->begin(), ExplicitEnd);
}
Decl *CXXRecordDecl::getLambdaContextDecl() const {
@@ -3578,13 +3578,13 @@ VarDecl *BindingDecl::getHoldingVar() const {
return VD;
}
-llvm::ArrayRef<BindingDecl *> BindingDecl::getBindingPackDecls() const {
+ArrayRef<BindingDecl *> BindingDecl::getBindingPackDecls() const {
assert(Binding && "expecting a pack expr");
auto *FP = cast<FunctionParmPackExpr>(Binding);
ValueDecl *const *First = FP->getNumExpansions() > 0 ? FP->begin() : nullptr;
assert((!First || isa<BindingDecl>(*First)) && "expecting a BindingDecl");
- return llvm::ArrayRef<BindingDecl *>(
- reinterpret_cast<BindingDecl *const *>(First), FP->getNumExpansions());
+ return ArrayRef<BindingDecl *>(reinterpret_cast<BindingDecl *const *>(First),
+ FP->getNumExpansions());
}
void DecompositionDecl::anchor() {}
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index 9443857443346..9273f5816d5ac 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -118,9 +118,9 @@ namespace {
void printTemplateParameters(const TemplateParameterList *Params,
bool OmitTemplateKW = false);
- void printTemplateArguments(llvm::ArrayRef<TemplateArgument> Args,
+ void printTemplateArguments(ArrayRef<TemplateArgument> Args,
const TemplateParameterList *Params);
- void printTemplateArguments(llvm::ArrayRef<TemplateArgumentLoc> Args,
+ void printTemplateArguments(ArrayRef<TemplateArgumentLoc> Args,
const TemplateParameterList *Params);
enum class AttrPosAsWritten { Default = 0, Left, Right };
bool
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index c3722c65abf6e..b6f09d7098fdc 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -4591,7 +4591,7 @@ const IdentifierInfo *DesignatedInitExpr::Designator::getFieldName() const {
}
DesignatedInitExpr::DesignatedInitExpr(const ASTContext &C, QualType Ty,
- llvm::ArrayRef<Designator> Designators,
+ ArrayRef<Designator> Designators,
SourceLocation EqualOrColonLoc,
bool GNUSyntax,
ArrayRef<Expr *> IndexExprs, Expr *Init)
@@ -4624,12 +4624,12 @@ DesignatedInitExpr::DesignatedInitExpr(const ASTContext &C, QualType Ty,
setDependence(computeDependence(this));
}
-DesignatedInitExpr *
-DesignatedInitExpr::Create(const ASTContext &C,
- llvm::ArrayRef<Designator> Designators,
- ArrayRef<Expr*> IndexExprs,
- SourceLocation ColonOrEqualLoc,
- bool UsesColonSyntax, Expr *Init) {
+DesignatedInitExpr *DesignatedInitExpr::Create(const ASTContext &C,
+ ArrayRef<Designator> Designators,
+ ArrayRef<Expr *> IndexExprs,
+ SourceLocation ColonOrEqualLoc,
+ bool UsesColonSyntax,
+ Expr *Init) {
void *Mem = C.Allocate(totalSizeToAlloc<Stmt *>(IndexExprs.size() + 1),
alignof(DesignatedInitExpr));
return new (Mem) DesignatedInitExpr(C, C.VoidTy, Designators,
diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp
index 2b66445fe253a..5d33945007380 100644
--- a/clang/lib/AST/ExprCXX.cpp
+++ b/clang/lib/AST/ExprCXX.cpp
@@ -1787,7 +1787,7 @@ SubstNonTypeTemplateParmPackExpr::getParameterPack() const {
}
TemplateArgument SubstNonTypeTemplateParmPackExpr::getArgumentPack() const {
- return TemplateArgument(llvm::ArrayRef(Arguments, NumArguments));
+ return TemplateArgument(ArrayRef(Arguments, NumArguments));
}
FunctionParmPackExpr::FunctionParmPackExpr(QualType T, ValueDecl *ParamPack,
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index f1580255a462a..18ad326942273 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -3977,8 +3977,7 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj,
if ((ObjType.isConstQualified() || ObjType.isVolatileQualified()) &&
ObjType->isRecordType() &&
Info.isEvaluatingCtorDtor(
- Obj.Base,
- llvm::ArrayRef(Sub.Entries.begin(), Sub.Entries.begin() + I)) !=
+ Obj.Base, ArrayRef(Sub.Entries.begin(), Sub.Entries.begin() + I)) !=
ConstructionPhase::None) {
ObjType = Info.Ctx.getCanonicalType(ObjType);
ObjType.removeLocalConst();
@@ -8307,7 +8306,7 @@ class ExprEvaluatorBase
const FunctionDecl *FD = nullptr;
LValue *This = nullptr, ObjectArg;
- auto Args = llvm::ArrayRef(E->getArgs(), E->getNumArgs());
+ auto Args = ArrayRef(E->getArgs(), E->getNumArgs());
bool HasQualifier = false;
CallRef Call;
@@ -10970,7 +10969,7 @@ bool RecordExprEvaluator::VisitCXXConstructExpr(const CXXConstructExpr *E,
if (ZeroInit && !ZeroInitialization(E, T))
return false;
- auto Args = llvm::ArrayRef(E->getArgs(), E->getNumArgs());
+ auto Args = ArrayRef(E->getArgs(), E->getNumArgs());
return HandleConstructorCall(E, This, Args,
cast<CXXConstructorDecl>(Definition), Info,
Result);
diff --git a/clang/lib/AST/ExternalASTMerger.cpp b/clang/lib/AST/ExternalASTMerger.cpp
index 1c903b5104bf4..15f8531a3ab05 100644
--- a/clang/lib/AST/ExternalASTMerger.cpp
+++ b/clang/lib/AST/ExternalASTMerger.cpp
@@ -239,7 +239,7 @@ class LazyASTImporter : public ASTImporter {
ASTImporter &GetReverse() { return Reverse; }
};
-bool HasDeclOfSameType(llvm::ArrayRef<Candidate> Decls, const Candidate &C) {
+bool HasDeclOfSameType(ArrayRef<Candidate> Decls, const Candidate &C) {
if (isa<FunctionDecl>(C.first.get()))
return false;
return llvm::any_of(Decls, [&](const Candidate &D) {
@@ -390,7 +390,8 @@ void ExternalASTMerger::RecordOriginImpl(const DeclContext *ToDC, DCOrigin Origi
}
ExternalASTMerger::ExternalASTMerger(const ImporterTarget &Target,
- llvm::ArrayRef<ImporterSource> Sources) : LogStream(&llvm::nulls()), Target(Target) {
+ ArrayRef<ImporterSource> Sources)
+ : LogStream(&llvm::nulls()), Target(Target) {
SharedState = std::make_shared<ASTImporterSharedState>(
*Target.AST.getTranslationUnitDecl());
AddSources(Sources);
@@ -404,7 +405,7 @@ Decl *ExternalASTMerger::FindOriginalDecl(Decl *D) {
return nullptr;
}
-void ExternalASTMerger::AddSources(llvm::ArrayRef<ImporterSource> Sources) {
+void ExternalASTMerger::AddSources(ArrayRef<ImporterSource> Sources) {
for (const ImporterSource &S : Sources) {
assert(&S.getASTContext() != &Target.AST);
// Check that the associated merger actually imports into the source AST.
@@ -414,7 +415,7 @@ void ExternalASTMerger::AddSources(llvm::ArrayRef<ImporterSource> Sources) {
}
}
-void ExternalASTMerger::RemoveSources(llvm::ArrayRef<ImporterSource> Sources) {
+void ExternalASTMerger::RemoveSources(ArrayRef<ImporterSource> Sources) {
if (LoggingEnabled())
for (const ImporterSource &S : Sources)
logs() << "(ExternalASTMerger*)" << (void *)this
diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index 487933a748ab8..84936b72bb4fa 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/lib/AST/ItaniumMangle.cpp
@@ -6619,7 +6619,7 @@ void CXXNameMangler::mangleValueInTemplateArg(QualType T, const APValue &V,
V.getStructField(Fields.back()->getFieldIndex())))) {
Fields.pop_back();
}
- llvm::ArrayRef<CXXBaseSpecifier> Bases(RD->bases_begin(), RD->bases_end());
+ ArrayRef<CXXBaseSpecifier> Bases(RD->bases_begin(), RD->bases_end());
if (Fields.empty()) {
while (!Bases.empty() &&
isZeroInitialized(Bases.back().getType(),
diff --git a/clang/lib/AST/OpenACCClause.cpp b/clang/lib/AST/OpenACCClause.cpp
index 7283ff837b04e..60ec10a986e5e 100644
--- a/clang/lib/AST/OpenACCClause.cpp
+++ b/clang/lib/AST/OpenACCClause.cpp
@@ -109,7 +109,7 @@ OpenACCSelfClause *OpenACCSelfClause::Create(const ASTContext &C,
OpenACCSelfClause::OpenACCSelfClause(SourceLocation BeginLoc,
SourceLocation LParenLoc,
- llvm::ArrayRef<Expr *> VarList,
+ ArrayRef<Expr *> VarList,
SourceLocation EndLoc)
: OpenACCClauseWithParams(OpenACCClauseKind::Self, BeginLoc, LParenLoc,
EndLoc),
diff --git a/clang/lib/AST/ParentMapContext.cpp b/clang/lib/AST/ParentMapContext.cpp
index 6337605a07738..68dfe4d5d22cb 100644
--- a/clang/lib/AST/ParentMapContext.cpp
+++ b/clang/lib/AST/ParentMapContext.cpp
@@ -81,7 +81,8 @@ class ParentMapContext::ParentMap {
Items.push_back(Value);
}
}
- llvm::ArrayRef<DynTypedNode> view() const { return Items; }
+ ArrayRef<DynTypedNode> view() const { return Items; }
+
private:
llvm::SmallVector<DynTypedNode, 1> Items;
llvm::SmallPtrSet<const void *, 2> Dedup;
@@ -120,7 +121,7 @@ class ParentMapContext::ParentMap {
const MapTy &Map) {
auto I = Map.find(Node);
if (I == Map.end()) {
- return llvm::ArrayRef<DynTypedNode>();
+ return ArrayRef<DynTypedNode>();
}
if (const auto *V = dyn_cast<ParentVector *>(I->second)) {
return V->view();
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index 28317911d825b..f8ec3f65b7eb4 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -298,7 +298,7 @@ void StmtPrinter::VisitLabelStmt(LabelStmt *Node) {
}
void StmtPrinter::VisitAttributedStmt(AttributedStmt *Node) {
- llvm::ArrayRef<const Attr *> Attrs = Node->getAttrs();
+ ArrayRef<const Attr *> Attrs = Node->getAttrs();
for (const auto *Attr : Attrs) {
Attr->printPretty(OS, Policy);
if (Attr != Attrs.back())
diff --git a/clang/lib/AST/TemplateName.cpp b/clang/lib/AST/TemplateName.cpp
index c5861ba33f850..5b7abc4d038a9 100644
--- a/clang/lib/AST/TemplateName.cpp
+++ b/clang/lib/AST/TemplateName.cpp
@@ -59,7 +59,7 @@ void DeducedTemplateStorage::Profile(llvm::FoldingSetNodeID &ID,
TemplateArgument
SubstTemplateTemplateParmPackStorage::getArgumentPack() const {
- return TemplateArgument(llvm::ArrayRef(Arguments, Bits.Data));
+ return TemplateArgument(ArrayRef(Arguments, Bits.Data));
}
TemplateTemplateParmDecl *
More information about the cfe-commits
mailing list