[clang] a3c248d - Move from llvm::makeArrayRef to ArrayRef deduction guides - clang/ part
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 9 03:16:06 PST 2023
Author: serge-sans-paille
Date: 2023-01-09T12:15:24+01:00
New Revision: a3c248db87ebe88084386950846678c9a52dd7c0
URL: https://github.com/llvm/llvm-project/commit/a3c248db87ebe88084386950846678c9a52dd7c0
DIFF: https://github.com/llvm/llvm-project/commit/a3c248db87ebe88084386950846678c9a52dd7c0.diff
LOG: Move from llvm::makeArrayRef to ArrayRef deduction guides - clang/ part
This is a follow-up to https://reviews.llvm.org/D140896, split into
several parts as it touches a lot of files.
Differential Revision: https://reviews.llvm.org/D141139
Added:
Modified:
clang/include/clang/AST/Decl.h
clang/include/clang/AST/DeclCXX.h
clang/include/clang/AST/DeclObjC.h
clang/include/clang/AST/DeclOpenMP.h
clang/include/clang/AST/DeclTemplate.h
clang/include/clang/AST/Expr.h
clang/include/clang/AST/ExprCXX.h
clang/include/clang/AST/ExprObjC.h
clang/include/clang/AST/ExprOpenMP.h
clang/include/clang/AST/OpenMPClause.h
clang/include/clang/AST/PropertiesBase.td
clang/include/clang/AST/Stmt.h
clang/include/clang/AST/StmtOpenMP.h
clang/include/clang/AST/TemplateBase.h
clang/include/clang/AST/TemplateName.h
clang/include/clang/AST/Type.h
clang/include/clang/AST/TypeLoc.h
clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
clang/include/clang/Basic/Diagnostic.h
clang/include/clang/Basic/SyncScope.h
clang/include/clang/CodeGen/CGFunctionInfo.h
clang/include/clang/Lex/MacroInfo.h
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/DeclSpec.h
clang/include/clang/Sema/DelayedDiagnostic.h
clang/include/clang/Sema/Sema.h
clang/include/clang/Serialization/ASTRecordReader.h
clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h
clang/include/clang/Tooling/Transformer/RewriteRule.h
clang/lib/AST/APValue.cpp
clang/lib/AST/ASTContext.cpp
clang/lib/AST/ASTDiagnostic.cpp
clang/lib/AST/ASTImporter.cpp
clang/lib/AST/CommentParser.cpp
clang/lib/AST/CommentSema.cpp
clang/lib/AST/ComputeDependence.cpp
clang/lib/AST/Decl.cpp
clang/lib/AST/DeclCXX.cpp
clang/lib/AST/DeclTemplate.cpp
clang/lib/AST/ExprCXX.cpp
clang/lib/AST/ExprConstant.cpp
clang/lib/AST/OpenMPClause.cpp
clang/lib/AST/ParentMapContext.cpp
clang/lib/AST/TemplateName.cpp
clang/lib/AST/Type.cpp
clang/lib/ASTMatchers/Dynamic/Marshallers.cpp
clang/lib/Analysis/CFG.cpp
clang/lib/Analysis/CalledOnceCheck.cpp
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
clang/lib/Basic/Module.cpp
clang/lib/Basic/Targets/AArch64.cpp
clang/lib/Basic/Targets/AMDGPU.cpp
clang/lib/Basic/Targets/ARC.h
clang/lib/Basic/Targets/ARM.cpp
clang/lib/Basic/Targets/AVR.h
clang/lib/Basic/Targets/BPF.cpp
clang/lib/Basic/Targets/CSKY.cpp
clang/lib/Basic/Targets/Hexagon.cpp
clang/lib/Basic/Targets/Lanai.cpp
clang/lib/Basic/Targets/LoongArch.cpp
clang/lib/Basic/Targets/M68k.cpp
clang/lib/Basic/Targets/MSP430.cpp
clang/lib/Basic/Targets/MSP430.h
clang/lib/Basic/Targets/Mips.cpp
clang/lib/Basic/Targets/Mips.h
clang/lib/Basic/Targets/NVPTX.cpp
clang/lib/Basic/Targets/PPC.cpp
clang/lib/Basic/Targets/RISCV.cpp
clang/lib/Basic/Targets/Sparc.cpp
clang/lib/Basic/Targets/SystemZ.cpp
clang/lib/Basic/Targets/VE.cpp
clang/lib/Basic/Targets/VE.h
clang/lib/Basic/Targets/WebAssembly.cpp
clang/lib/Basic/Targets/X86.cpp
clang/lib/Basic/Targets/XCore.cpp
clang/lib/Basic/Targets/XCore.h
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/CodeGen/CGExprConstant.cpp
clang/lib/CodeGen/CGExprScalar.cpp
clang/lib/CodeGen/CGObjCGNU.cpp
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/lib/CodeGen/CodeGenFunction.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenPGO.cpp
clang/lib/CodeGen/CodeGenTypes.cpp
clang/lib/CodeGen/ConstantInitBuilder.cpp
clang/lib/CodeGen/CoverageMappingGen.cpp
clang/lib/CodeGen/MicrosoftCXXABI.cpp
clang/lib/CodeGen/TargetInfo.cpp
clang/lib/Driver/Job.cpp
clang/lib/Driver/ToolChains/Darwin.cpp
clang/lib/Format/MacroCallReconstructor.cpp
clang/lib/Frontend/ASTUnit.cpp
clang/lib/Interpreter/Interpreter.cpp
clang/lib/Lex/TokenLexer.cpp
clang/lib/Parse/ParsePragma.cpp
clang/lib/Sema/ParsedAttr.cpp
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaCodeComplete.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaExprObjC.cpp
clang/lib/Sema/SemaInit.cpp
clang/lib/Sema/SemaLookup.cpp
clang/lib/Sema/SemaOverload.cpp
clang/lib/Sema/SemaRISCVVectorLookup.cpp
clang/lib/Sema/SemaStmt.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/lib/Sema/SemaTemplateInstantiate.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/lib/Sema/SemaType.cpp
clang/lib/Sema/TreeTransform.h
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/lib/Serialization/ASTWriterDecl.cpp
clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp
clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
clang/lib/Tooling/Syntax/BuildTree.cpp
clang/lib/Tooling/Syntax/ComputeReplacements.cpp
clang/lib/Tooling/Syntax/Tokens.cpp
clang/lib/Tooling/Tooling.cpp
clang/tools/diagtool/DiagnosticNames.cpp
clang/tools/diagtool/FindDiagnosticID.cpp
clang/tools/driver/driver.cpp
clang/tools/libclang/CIndex.cpp
clang/tools/libclang/CIndexCodeCompletion.cpp
clang/tools/libclang/Indexing.cpp
clang/unittests/Driver/ToolChainTest.cpp
clang/unittests/Introspection/IntrospectionTest.cpp
clang/unittests/Lex/LexerTest.cpp
clang/unittests/Lex/PPDependencyDirectivesTest.cpp
clang/unittests/Tooling/Syntax/TokensTest.cpp
clang/unittests/Tooling/Syntax/TreeTestBase.cpp
clang/unittests/Tooling/ToolingTest.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index f84ff303f235e..3ae2703a406ee 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -3205,7 +3205,7 @@ class IndirectFieldDecl : public ValueDecl,
using chain_iterator = ArrayRef<NamedDecl *>::const_iterator;
ArrayRef<NamedDecl *> chain() const {
- return llvm::makeArrayRef(Chaining, ChainingSize);
+ return llvm::ArrayRef(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 3836a2faaaf29..11276c77490ce 100644
--- a/clang/include/clang/AST/DeclCXX.h
+++ b/clang/include/clang/AST/DeclCXX.h
@@ -357,11 +357,11 @@ class CXXRecordDecl : public RecordDecl {
}
ArrayRef<CXXBaseSpecifier> bases() const {
- return llvm::makeArrayRef(getBases(), NumBases);
+ return llvm::ArrayRef(getBases(), NumBases);
}
ArrayRef<CXXBaseSpecifier> vbases() const {
- return llvm::makeArrayRef(getVBases(), NumVBases);
+ return llvm::ArrayRef(getVBases(), NumVBases);
}
private:
@@ -3739,7 +3739,7 @@ class UsingPackDecl final
/// Get the set of using declarations that this pack expanded into. Note that
/// some of these may still be unresolved.
ArrayRef<NamedDecl *> expansions() const {
- return llvm::makeArrayRef(getTrailingObjects<NamedDecl *>(), NumExpansions);
+ return llvm::ArrayRef(getTrailingObjects<NamedDecl *>(), NumExpansions);
}
static UsingPackDecl *Create(ASTContext &C, DeclContext *DC,
@@ -4109,7 +4109,7 @@ class DecompositionDecl final
unsigned NumBindings);
ArrayRef<BindingDecl *> bindings() const {
- return llvm::makeArrayRef(getTrailingObjects<BindingDecl *>(), NumBindings);
+ return llvm::ArrayRef(getTrailingObjects<BindingDecl *>(), NumBindings);
}
void printName(raw_ostream &OS, const PrintingPolicy &Policy) const override;
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index 3ba59a296cec7..7c72ec9507bf1 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/include/clang/AST/DeclObjC.h
@@ -373,8 +373,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::makeArrayRef(const_cast<ParmVarDecl**>(getParams()),
- NumParams);
+ return llvm::ArrayRef(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 fc52e5d2f0446..30b5a92293b9c 100644
--- a/clang/include/clang/AST/DeclOpenMP.h
+++ b/clang/include/clang/AST/DeclOpenMP.h
@@ -118,7 +118,7 @@ class OMPThreadPrivateDecl final : public OMPDeclarativeDirective<Decl> {
ArrayRef<const Expr *> getVars() const {
auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
- return llvm::makeArrayRef(Storage, Data->getNumChildren());
+ return llvm::ArrayRef(Storage, Data->getNumChildren());
}
MutableArrayRef<Expr *> getVars() {
@@ -481,7 +481,7 @@ class OMPAllocateDecl final : public OMPDeclarativeDirective<Decl> {
ArrayRef<const Expr *> getVars() const {
auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
- return llvm::makeArrayRef(Storage, Data->getNumChildren());
+ return llvm::ArrayRef(Storage, Data->getNumChildren());
}
MutableArrayRef<Expr *> getVars() {
diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h
index d654fceb8c20c..b7032d00d9887 100644
--- a/clang/include/clang/AST/DeclTemplate.h
+++ b/clang/include/clang/AST/DeclTemplate.h
@@ -129,11 +129,9 @@ class TemplateParameterList final
unsigned size() const { return NumParams; }
- ArrayRef<NamedDecl*> asArray() {
- return llvm::makeArrayRef(begin(), end());
- }
+ ArrayRef<NamedDecl *> asArray() { return llvm::ArrayRef(begin(), end()); }
ArrayRef<const NamedDecl*> asArray() const {
- return llvm::makeArrayRef(begin(), size());
+ return llvm::ArrayRef(begin(), size());
}
NamedDecl* getParam(unsigned Idx) {
@@ -289,7 +287,7 @@ class TemplateArgumentList final
/// Produce this as an array ref.
ArrayRef<TemplateArgument> asArray() const {
- return llvm::makeArrayRef(data(), size());
+ return llvm::ArrayRef(data(), size());
}
/// Retrieve the number of template arguments in this
@@ -741,7 +739,7 @@ class DependentFunctionTemplateSpecializationInfo final
unsigned getNumTemplateArgs() const { return NumArgs; }
llvm::ArrayRef<TemplateArgumentLoc> arguments() const {
- return llvm::makeArrayRef(getTemplateArgs(), getNumTemplateArgs());
+ return llvm::ArrayRef(getTemplateArgs(), getNumTemplateArgs());
}
/// Returns the nth template argument.
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index bdc1bbdd7d0c3..ed76cfaa4e56a 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -3020,7 +3020,7 @@ class CallExpr : public Expr {
/// Compute and set dependence bits.
void computeDependence() {
setDependence(clang::computeDependence(
- this, llvm::makeArrayRef(
+ this, llvm::ArrayRef(
reinterpret_cast<Expr **>(getTrailingStmts() + PREARGS_START),
getNumPreArgs())));
}
@@ -3067,8 +3067,8 @@ 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::makeArrayRef(getTrailingStmts(),
- PREARGS_START + getNumPreArgs() + getNumArgs());
+ return llvm::ArrayRef(getTrailingStmts(),
+ PREARGS_START + getNumPreArgs() + getNumArgs());
}
/// Get FPOptionsOverride from trailing storage.
@@ -4834,12 +4834,10 @@ class InitListExpr : public Expr {
return reinterpret_cast<Expr * const *>(InitExprs.data());
}
- ArrayRef<Expr *> inits() {
- return llvm::makeArrayRef(getInits(), getNumInits());
- }
+ ArrayRef<Expr *> inits() { return llvm::ArrayRef(getInits(), getNumInits()); }
ArrayRef<Expr *> inits() const {
- return llvm::makeArrayRef(getInits(), getNumInits());
+ return llvm::ArrayRef(getInits(), getNumInits());
}
const Expr *getInit(unsigned Init) const {
@@ -5581,9 +5579,7 @@ class ParenListExpr final
return reinterpret_cast<Expr **>(getTrailingObjects<Stmt *>());
}
- ArrayRef<Expr *> exprs() {
- return llvm::makeArrayRef(getExprs(), getNumExprs());
- }
+ ArrayRef<Expr *> exprs() { return llvm::ArrayRef(getExprs(), getNumExprs()); }
SourceLocation getLParenLoc() const { return LParenLoc; }
SourceLocation getRParenLoc() const { return RParenLoc; }
@@ -6434,7 +6430,7 @@ class RecoveryExpr final : public Expr,
ArrayRef<Expr *> subExpressions() {
auto *B = getTrailingObjects<Expr *>();
- return llvm::makeArrayRef(B, B + NumExprs);
+ return llvm::ArrayRef(B, B + NumExprs);
}
ArrayRef<const Expr *> subExpressions() const {
diff --git a/clang/include/clang/AST/ExprCXX.h b/clang/include/clang/AST/ExprCXX.h
index a0bdf50f57ac0..ad2a5cb102905 100644
--- a/clang/include/clang/AST/ExprCXX.h
+++ b/clang/include/clang/AST/ExprCXX.h
@@ -2796,8 +2796,7 @@ class TypeTraitExpr final
/// Retrieve the argument types.
ArrayRef<TypeSourceInfo *> getArgs() const {
- return llvm::makeArrayRef(getTrailingObjects<TypeSourceInfo *>(),
- getNumArgs());
+ return llvm::ArrayRef(getTrailingObjects<TypeSourceInfo *>(), getNumArgs());
}
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
@@ -3443,8 +3442,7 @@ class ExprWithCleanups final
ArrayRef<CleanupObject> objects);
ArrayRef<CleanupObject> getObjects() const {
- return llvm::makeArrayRef(getTrailingObjects<CleanupObject>(),
- getNumObjects());
+ return llvm::ArrayRef(getTrailingObjects<CleanupObject>(), getNumObjects());
}
unsigned getNumObjects() const { return ExprWithCleanupsBits.NumObjects; }
@@ -4295,7 +4293,7 @@ class SizeOfPackExpr final
ArrayRef<TemplateArgument> getPartialArguments() const {
assert(isPartiallySubstituted());
const auto *Args = getTrailingObjects<TemplateArgument>();
- return llvm::makeArrayRef(Args, Args + Length);
+ return llvm::ArrayRef(Args, Args + Length);
}
SourceLocation getBeginLoc() const LLVM_READONLY { return OperatorLoc; }
diff --git a/clang/include/clang/AST/ExprObjC.h b/clang/include/clang/AST/ExprObjC.h
index 24b2cad51e776..0c0629cd00c68 100644
--- a/clang/include/clang/AST/ExprObjC.h
+++ b/clang/include/clang/AST/ExprObjC.h
@@ -1415,11 +1415,10 @@ class ObjCMessageExpr final
SourceLocation getSelectorLoc(unsigned Index) const {
assert(Index < getNumSelectorLocs() && "Index out of range!");
if (hasStandardSelLocs())
- return getStandardSelectorLoc(Index, getSelector(),
- getSelLocsKind() == SelLoc_StandardWithSpace,
- llvm::makeArrayRef(const_cast<Expr**>(getArgs()),
- getNumArgs()),
- RBracLoc);
+ return getStandardSelectorLoc(
+ Index, getSelector(), getSelLocsKind() == SelLoc_StandardWithSpace,
+ llvm::ArrayRef(const_cast<Expr **>(getArgs()), getNumArgs()),
+ RBracLoc);
return getStoredSelLocs()[Index];
}
diff --git a/clang/include/clang/AST/ExprOpenMP.h b/clang/include/clang/AST/ExprOpenMP.h
index be5dda9923346..be5b1f3fdd112 100644
--- a/clang/include/clang/AST/ExprOpenMP.h
+++ b/clang/include/clang/AST/ExprOpenMP.h
@@ -202,12 +202,12 @@ class OMPArrayShapingExpr final
/// Fetches the dimensions for array shaping expression.
ArrayRef<Expr *> getDimensions() const {
- return llvm::makeArrayRef(getTrailingObjects<Expr *>(), NumDims);
+ return llvm::ArrayRef(getTrailingObjects<Expr *>(), NumDims);
}
/// Fetches source ranges for the brackets os the array shaping expression.
ArrayRef<SourceRange> getBracketsRanges() const {
- return llvm::makeArrayRef(getTrailingObjects<SourceRange>(), NumDims);
+ return llvm::ArrayRef(getTrailingObjects<SourceRange>(), NumDims);
}
/// Fetches base expression of array shaping expression.
diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h
index 1446b41665688..f37da2dd707ad 100644
--- a/clang/include/clang/AST/OpenMPClause.h
+++ b/clang/include/clang/AST/OpenMPClause.h
@@ -336,7 +336,7 @@ template <class T> class OMPVarListClause : public OMPClause {
/// Fetches list of all variables in the clause.
ArrayRef<const Expr *> getVarRefs() const {
- return llvm::makeArrayRef(
+ return llvm::ArrayRef(
static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
NumVars);
}
@@ -2557,7 +2557,7 @@ class OMPPrivateClause final
return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
}
ArrayRef<const Expr *> getPrivateCopies() const {
- return llvm::makeArrayRef(varlist_end(), varlist_size());
+ return llvm::ArrayRef(varlist_end(), varlist_size());
}
public:
@@ -2666,7 +2666,7 @@ class OMPFirstprivateClause final
return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
}
ArrayRef<const Expr *> getPrivateCopies() const {
- return llvm::makeArrayRef(varlist_end(), varlist_size());
+ return llvm::ArrayRef(varlist_end(), varlist_size());
}
/// Sets the list of references to initializer variables for new
@@ -2680,7 +2680,7 @@ class OMPFirstprivateClause final
return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
}
ArrayRef<const Expr *> getInits() const {
- return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
+ return llvm::ArrayRef(getPrivateCopies().end(), varlist_size());
}
public:
@@ -2828,7 +2828,7 @@ class OMPLastprivateClause final
return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
}
ArrayRef<const Expr *> getPrivateCopies() const {
- return llvm::makeArrayRef(varlist_end(), varlist_size());
+ return llvm::ArrayRef(varlist_end(), varlist_size());
}
/// Set list of helper expressions, required for proper codegen of the
@@ -2842,7 +2842,7 @@ class OMPLastprivateClause final
return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
}
ArrayRef<const Expr *> getSourceExprs() const {
- return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
+ return llvm::ArrayRef(getPrivateCopies().end(), varlist_size());
}
/// Set list of helper expressions, required for proper codegen of the
@@ -2856,7 +2856,7 @@ class OMPLastprivateClause final
return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getDestinationExprs() const {
- return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
+ return llvm::ArrayRef(getSourceExprs().end(), varlist_size());
}
/// Set list of helper assignment expressions, required for proper
@@ -2869,7 +2869,7 @@ class OMPLastprivateClause final
return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getAssignmentOps() const {
- return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
+ return llvm::ArrayRef(getDestinationExprs().end(), varlist_size());
}
/// Sets lastprivate kind.
@@ -3157,7 +3157,7 @@ class OMPReductionClause final
return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
}
ArrayRef<const Expr *> getPrivates() const {
- return llvm::makeArrayRef(varlist_end(), varlist_size());
+ return llvm::ArrayRef(varlist_end(), varlist_size());
}
/// Set list of helper expressions, required for proper codegen of the
@@ -3170,7 +3170,7 @@ class OMPReductionClause final
return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
}
ArrayRef<const Expr *> getLHSExprs() const {
- return llvm::makeArrayRef(getPrivates().end(), varlist_size());
+ return llvm::ArrayRef(getPrivates().end(), varlist_size());
}
/// Set list of helper expressions, required for proper codegen of the
@@ -3185,7 +3185,7 @@ class OMPReductionClause final
return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getRHSExprs() const {
- return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
+ return llvm::ArrayRef(getLHSExprs().end(), varlist_size());
}
/// Set list of helper reduction expressions, required for proper
@@ -3199,7 +3199,7 @@ class OMPReductionClause final
return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getReductionOps() const {
- return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
+ return llvm::ArrayRef(getRHSExprs().end(), varlist_size());
}
/// Set list of helper copy operations for inscan reductions.
@@ -3211,7 +3211,7 @@ class OMPReductionClause final
return MutableArrayRef<Expr *>(getReductionOps().end(), varlist_size());
}
ArrayRef<const Expr *> getInscanCopyOps() const {
- return llvm::makeArrayRef(getReductionOps().end(), varlist_size());
+ return llvm::ArrayRef(getReductionOps().end(), varlist_size());
}
/// Set list of helper temp vars for inscan copy array operations.
@@ -3222,7 +3222,7 @@ class OMPReductionClause final
return MutableArrayRef<Expr *>(getInscanCopyOps().end(), varlist_size());
}
ArrayRef<const Expr *> getInscanCopyArrayTemps() const {
- return llvm::makeArrayRef(getInscanCopyOps().end(), varlist_size());
+ return llvm::ArrayRef(getInscanCopyOps().end(), varlist_size());
}
/// Set list of helper temp elements vars for inscan copy array operations.
@@ -3234,7 +3234,7 @@ class OMPReductionClause final
varlist_size());
}
ArrayRef<const Expr *> getInscanCopyArrayElems() const {
- return llvm::makeArrayRef(getInscanCopyArrayTemps().end(), varlist_size());
+ return llvm::ArrayRef(getInscanCopyArrayTemps().end(), varlist_size());
}
public:
@@ -3476,7 +3476,7 @@ class OMPTaskReductionClause final
return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
}
ArrayRef<const Expr *> getPrivates() const {
- return llvm::makeArrayRef(varlist_end(), varlist_size());
+ return llvm::ArrayRef(varlist_end(), varlist_size());
}
/// Set list of helper expressions, required for proper codegen of the clause.
@@ -3489,7 +3489,7 @@ class OMPTaskReductionClause final
return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
}
ArrayRef<const Expr *> getLHSExprs() const {
- return llvm::makeArrayRef(getPrivates().end(), varlist_size());
+ return llvm::ArrayRef(getPrivates().end(), varlist_size());
}
/// Set list of helper expressions, required for proper codegen of the clause.
@@ -3503,7 +3503,7 @@ class OMPTaskReductionClause final
return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getRHSExprs() const {
- return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
+ return llvm::ArrayRef(getLHSExprs().end(), varlist_size());
}
/// Set list of helper reduction expressions, required for proper
@@ -3517,7 +3517,7 @@ class OMPTaskReductionClause final
return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getReductionOps() const {
- return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
+ return llvm::ArrayRef(getRHSExprs().end(), varlist_size());
}
public:
@@ -3707,7 +3707,7 @@ class OMPInReductionClause final
return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
}
ArrayRef<const Expr *> getPrivates() const {
- return llvm::makeArrayRef(varlist_end(), varlist_size());
+ return llvm::ArrayRef(varlist_end(), varlist_size());
}
/// Set list of helper expressions, required for proper codegen of the clause.
@@ -3720,7 +3720,7 @@ class OMPInReductionClause final
return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
}
ArrayRef<const Expr *> getLHSExprs() const {
- return llvm::makeArrayRef(getPrivates().end(), varlist_size());
+ return llvm::ArrayRef(getPrivates().end(), varlist_size());
}
/// Set list of helper expressions, required for proper codegen of the clause.
@@ -3734,7 +3734,7 @@ class OMPInReductionClause final
return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getRHSExprs() const {
- return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
+ return llvm::ArrayRef(getLHSExprs().end(), varlist_size());
}
/// Set list of helper reduction expressions, required for proper
@@ -3748,7 +3748,7 @@ class OMPInReductionClause final
return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getReductionOps() const {
- return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
+ return llvm::ArrayRef(getRHSExprs().end(), varlist_size());
}
/// Set list of helper reduction taskgroup descriptors.
@@ -3759,7 +3759,7 @@ class OMPInReductionClause final
return MutableArrayRef<Expr *>(getReductionOps().end(), varlist_size());
}
ArrayRef<const Expr *> getTaskgroupDescriptors() const {
- return llvm::makeArrayRef(getReductionOps().end(), varlist_size());
+ return llvm::ArrayRef(getReductionOps().end(), varlist_size());
}
public:
@@ -3965,14 +3965,14 @@ class OMPLinearClause final
return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
}
ArrayRef<const Expr *> getPrivates() const {
- return llvm::makeArrayRef(varlist_end(), varlist_size());
+ return llvm::ArrayRef(varlist_end(), varlist_size());
}
MutableArrayRef<Expr *> getInits() {
return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
}
ArrayRef<const Expr *> getInits() const {
- return llvm::makeArrayRef(getPrivates().end(), varlist_size());
+ return llvm::ArrayRef(getPrivates().end(), varlist_size());
}
/// Sets the list of update expressions for linear variables.
@@ -3980,7 +3980,7 @@ class OMPLinearClause final
return MutableArrayRef<Expr *>(getInits().end(), varlist_size());
}
ArrayRef<const Expr *> getUpdates() const {
- return llvm::makeArrayRef(getInits().end(), varlist_size());
+ return llvm::ArrayRef(getInits().end(), varlist_size());
}
/// Sets the list of final update expressions for linear variables.
@@ -3988,7 +3988,7 @@ class OMPLinearClause final
return MutableArrayRef<Expr *>(getUpdates().end(), varlist_size());
}
ArrayRef<const Expr *> getFinals() const {
- return llvm::makeArrayRef(getUpdates().end(), varlist_size());
+ return llvm::ArrayRef(getUpdates().end(), varlist_size());
}
/// Gets the list of used expressions for linear variables.
@@ -3996,7 +3996,7 @@ class OMPLinearClause final
return MutableArrayRef<Expr *>(getFinals().end() + 2, varlist_size() + 1);
}
ArrayRef<const Expr *> getUsedExprs() const {
- return llvm::makeArrayRef(getFinals().end() + 2, varlist_size() + 1);
+ return llvm::ArrayRef(getFinals().end() + 2, varlist_size() + 1);
}
/// Sets the list of the copies of original linear variables.
@@ -4325,7 +4325,7 @@ class OMPCopyinClause final
return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
}
ArrayRef<const Expr *> getSourceExprs() const {
- return llvm::makeArrayRef(varlist_end(), varlist_size());
+ return llvm::ArrayRef(varlist_end(), varlist_size());
}
/// Set list of helper expressions, required for proper codegen of the
@@ -4338,7 +4338,7 @@ class OMPCopyinClause final
return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getDestinationExprs() const {
- return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
+ return llvm::ArrayRef(getSourceExprs().end(), varlist_size());
}
/// Set list of helper assignment expressions, required for proper
@@ -4352,7 +4352,7 @@ class OMPCopyinClause final
return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getAssignmentOps() const {
- return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
+ return llvm::ArrayRef(getDestinationExprs().end(), varlist_size());
}
public:
@@ -4490,7 +4490,7 @@ class OMPCopyprivateClause final
return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
}
ArrayRef<const Expr *> getSourceExprs() const {
- return llvm::makeArrayRef(varlist_end(), varlist_size());
+ return llvm::ArrayRef(varlist_end(), varlist_size());
}
/// Set list of helper expressions, required for proper codegen of the
@@ -4503,7 +4503,7 @@ class OMPCopyprivateClause final
return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getDestinationExprs() const {
- return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
+ return llvm::ArrayRef(getSourceExprs().end(), varlist_size());
}
/// Set list of helper assignment expressions, required for proper
@@ -4517,7 +4517,7 @@ class OMPCopyprivateClause final
return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
}
ArrayRef<const Expr *> getAssignmentOps() const {
- return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
+ return llvm::ArrayRef(getDestinationExprs().end(), varlist_size());
}
public:
@@ -5436,7 +5436,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::makeArrayRef<Expr *>(
+ return llvm::ArrayRef<Expr *>(
static_cast<const T *>(this)->template getTrailingObjects<Expr *>() +
OMPVarListClause<T>::varlist_size(),
OMPVarListClause<T>::varlist_size());
@@ -5934,12 +5934,12 @@ class OMPMapClause final : public OMPMappableExprListClause<OMPMapClause>,
/// Fetches ArrayRef of map-type-modifiers.
ArrayRef<OpenMPMapModifierKind> getMapTypeModifiers() const LLVM_READONLY {
- return llvm::makeArrayRef(MapTypeModifiers);
+ return llvm::ArrayRef(MapTypeModifiers);
}
/// Fetches ArrayRef of location of map-type-modifiers.
ArrayRef<SourceLocation> getMapTypeModifiersLoc() const LLVM_READONLY {
- return llvm::makeArrayRef(MapTypeModifiersLoc);
+ return llvm::ArrayRef(MapTypeModifiersLoc);
}
/// Fetches location of clause mapping kind.
@@ -6890,12 +6890,12 @@ class OMPToClause final : public OMPMappableExprListClause<OMPToClause>,
/// Fetches ArrayRef of motion-modifiers.
ArrayRef<OpenMPMotionModifierKind> getMotionModifiers() const LLVM_READONLY {
- return llvm::makeArrayRef(MotionModifiers);
+ return llvm::ArrayRef(MotionModifiers);
}
/// Fetches ArrayRef of location of motion-modifiers.
ArrayRef<SourceLocation> getMotionModifiersLoc() const LLVM_READONLY {
- return llvm::makeArrayRef(MotionModifiersLoc);
+ return llvm::ArrayRef(MotionModifiersLoc);
}
/// Get colon location.
@@ -7090,12 +7090,12 @@ class OMPFromClause final
/// Fetches ArrayRef of motion-modifiers.
ArrayRef<OpenMPMotionModifierKind> getMotionModifiers() const LLVM_READONLY {
- return llvm::makeArrayRef(MotionModifiers);
+ return llvm::ArrayRef(MotionModifiers);
}
/// Fetches ArrayRef of location of motion-modifiers.
ArrayRef<SourceLocation> getMotionModifiersLoc() const LLVM_READONLY {
- return llvm::makeArrayRef(MotionModifiersLoc);
+ return llvm::ArrayRef(MotionModifiersLoc);
}
/// Get colon location.
@@ -7190,7 +7190,7 @@ class OMPUseDevicePtrClause final
return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
}
ArrayRef<const Expr *> getPrivateCopies() const {
- return llvm::makeArrayRef(varlist_end(), varlist_size());
+ return llvm::ArrayRef(varlist_end(), varlist_size());
}
/// Sets the list of references to initializer variables for new private
@@ -7204,7 +7204,7 @@ class OMPUseDevicePtrClause final
return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
}
ArrayRef<const Expr *> getInits() const {
- return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
+ return llvm::ArrayRef(getPrivateCopies().end(), varlist_size());
}
public:
@@ -7638,7 +7638,7 @@ class OMPNontemporalClause final
return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
}
ArrayRef<const Expr *> getPrivateRefs() const {
- return llvm::makeArrayRef(varlist_end(), varlist_size());
+ return llvm::ArrayRef(varlist_end(), varlist_size());
}
public:
diff --git a/clang/include/clang/AST/PropertiesBase.td b/clang/include/clang/AST/PropertiesBase.td
index 6c7f6928305e8..ff0fb01813127 100644
--- a/clang/include/clang/AST/PropertiesBase.td
+++ b/clang/include/clang/AST/PropertiesBase.td
@@ -827,6 +827,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::makeArrayRef(ctxElements, elements.size()));
+ return TemplateArgument(llvm::ArrayRef(ctxElements, elements.size()));
}]>;
}
diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h
index 8781c70abfa26..e4a6ec975f2b0 100644
--- a/clang/include/clang/AST/Stmt.h
+++ b/clang/include/clang/AST/Stmt.h
@@ -1923,7 +1923,7 @@ class AttributedStmt final
SourceLocation getAttrLoc() const { return AttributedStmtBits.AttrLoc; }
ArrayRef<const Attr *> getAttrs() const {
- return llvm::makeArrayRef(getAttrArrayPtr(), AttributedStmtBits.NumAttrs);
+ return llvm::ArrayRef(getAttrArrayPtr(), AttributedStmtBits.NumAttrs);
}
Stmt *getSubStmt() { return SubStmt; }
@@ -3334,16 +3334,16 @@ class MSAsmStmt : public AsmStmt {
//===--- Other ---===//
ArrayRef<StringRef> getAllConstraints() const {
- return llvm::makeArrayRef(Constraints, NumInputs + NumOutputs);
+ return llvm::ArrayRef(Constraints, NumInputs + NumOutputs);
}
ArrayRef<StringRef> getClobbers() const {
- return llvm::makeArrayRef(Clobbers, NumClobbers);
+ return llvm::ArrayRef(Clobbers, NumClobbers);
}
ArrayRef<Expr*> getAllExprs() const {
- return llvm::makeArrayRef(reinterpret_cast<Expr**>(Exprs),
- NumInputs + NumOutputs);
+ return llvm::ArrayRef(reinterpret_cast<Expr **>(Exprs),
+ NumInputs + NumOutputs);
}
StringRef getClobber(unsigned i) const { return getClobbers()[i]; }
diff --git a/clang/include/clang/AST/StmtOpenMP.h b/clang/include/clang/AST/StmtOpenMP.h
index 6ed47508dc407..c4dd196a2e805 100644
--- a/clang/include/clang/AST/StmtOpenMP.h
+++ b/clang/include/clang/AST/StmtOpenMP.h
@@ -399,8 +399,9 @@ 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::makeArrayRef(Clauses.end(), 0))};
+ return {
+ used_clauses_child_iterator(Clauses),
+ used_clauses_child_iterator(llvm::ArrayRef(Clauses.end(), (size_t)0))};
}
/// Iterates over a filtered subrange of clauses applied to a
@@ -445,7 +446,7 @@ class OMPExecutableDirective : public Stmt {
getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
return {specific_clause_iterator<SpecificClause>(Clauses),
specific_clause_iterator<SpecificClause>(
- llvm::makeArrayRef(Clauses.end(), 0))};
+ llvm::ArrayRef(Clauses.end(), (size_t)0))};
}
template <typename SpecificClause>
diff --git a/clang/include/clang/AST/TemplateBase.h b/clang/include/clang/AST/TemplateBase.h
index 0fce875a2f256..6ba867d43a988 100644
--- a/clang/include/clang/AST/TemplateBase.h
+++ b/clang/include/clang/AST/TemplateBase.h
@@ -319,7 +319,7 @@ class TemplateArgument {
return APSInt(APInt(Integer.BitWidth, Integer.VAL), Integer.IsUnsigned);
unsigned NumWords = APInt::getNumWords(Integer.BitWidth);
- return APSInt(APInt(Integer.BitWidth, makeArrayRef(Integer.pVal, NumWords)),
+ return APSInt(APInt(Integer.BitWidth, ArrayRef(Integer.pVal, NumWords)),
Integer.IsUnsigned);
}
@@ -364,7 +364,7 @@ class TemplateArgument {
/// Iterator range referencing all of the elements of a template
/// argument pack.
ArrayRef<TemplateArgument> pack_elements() const {
- return llvm::makeArrayRef(pack_begin(), pack_end());
+ return llvm::ArrayRef(pack_begin(), pack_end());
}
/// The number of template arguments in the given template argument
@@ -377,7 +377,7 @@ class TemplateArgument {
/// Return the array of arguments in this template argument pack.
ArrayRef<TemplateArgument> getPackAsArray() const {
assert(getKind() == Pack);
- return llvm::makeArrayRef(Args.Args, Args.NumArgs);
+ return llvm::ArrayRef(Args.Args, Args.NumArgs);
}
/// Determines whether two template arguments are superficially the
@@ -642,7 +642,7 @@ struct ASTTemplateArgumentListInfo final
unsigned getNumTemplateArgs() const { return NumTemplateArgs; }
llvm::ArrayRef<TemplateArgumentLoc> arguments() const {
- return llvm::makeArrayRef(getTemplateArgs(), getNumTemplateArgs());
+ return llvm::ArrayRef(getTemplateArgs(), getNumTemplateArgs());
}
const TemplateArgumentLoc &operator[](unsigned I) const {
diff --git a/clang/include/clang/AST/TemplateName.h b/clang/include/clang/AST/TemplateName.h
index a642fbe1cfef0..d723356767ddc 100644
--- a/clang/include/clang/AST/TemplateName.h
+++ b/clang/include/clang/AST/TemplateName.h
@@ -126,7 +126,7 @@ class OverloadedTemplateStorage : public UncommonTemplateNameStorage {
iterator end() const { return getStorage() + Bits.Data; }
llvm::ArrayRef<NamedDecl*> decls() const {
- return llvm::makeArrayRef(begin(), end());
+ return llvm::ArrayRef(begin(), end());
}
};
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index af6dbcf3988ae..c1650724f711c 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -4234,7 +4234,7 @@ class FunctionProtoType final
}
ArrayRef<QualType> getParamTypes() const {
- return llvm::makeArrayRef(param_type_begin(), param_type_end());
+ return llvm::ArrayRef(param_type_begin(), param_type_end());
}
ExtProtoInfo getExtProtoInfo() const {
@@ -4381,7 +4381,7 @@ class FunctionProtoType final
using param_type_iterator = const QualType *;
ArrayRef<QualType> param_types() const {
- return llvm::makeArrayRef(param_type_begin(), param_type_end());
+ return llvm::ArrayRef(param_type_begin(), param_type_end());
}
param_type_iterator param_type_begin() const {
@@ -4395,7 +4395,7 @@ class FunctionProtoType final
using exception_iterator = const QualType *;
ArrayRef<QualType> exceptions() const {
- return llvm::makeArrayRef(exception_begin(), exception_end());
+ return llvm::ArrayRef(exception_begin(), exception_end());
}
exception_iterator exception_begin() const {
@@ -6132,8 +6132,7 @@ class ObjCObjectType : public Type,
/// Retrieve the type arguments of this object type as they were
/// written.
ArrayRef<QualType> getTypeArgsAsWritten() const {
- return llvm::makeArrayRef(getTypeArgStorage(),
- ObjCObjectTypeBits.NumTypeArgs);
+ return llvm::ArrayRef(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 ce2ddca830b71..72ed3cb752e0f 100644
--- a/clang/include/clang/AST/TypeLoc.h
+++ b/clang/include/clang/AST/TypeLoc.h
@@ -814,7 +814,7 @@ class ObjCTypeParamTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
}
ArrayRef<SourceLocation> getProtocolLocs() const {
- return llvm::makeArrayRef(getProtocolLocArray(), getNumProtocols());
+ return llvm::ArrayRef(getProtocolLocArray(), getNumProtocols());
}
void initializeLocal(ASTContext &Context, SourceLocation Loc);
@@ -1020,7 +1020,7 @@ class ObjCObjectTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
ArrayRef<SourceLocation> getProtocolLocs() const {
- return llvm::makeArrayRef(getProtocolLocArray(), getNumProtocols());
+ return llvm::ArrayRef(getProtocolLocArray(), getNumProtocols());
}
bool hasBaseTypeAsWritten() const {
@@ -1447,7 +1447,7 @@ class FunctionTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
}
ArrayRef<ParmVarDecl *> getParams() const {
- return llvm::makeArrayRef(getParmArray(), getNumParams());
+ return llvm::ArrayRef(getParmArray(), getNumParams());
}
// ParmVarDecls* are stored after Info, one for each parameter.
diff --git a/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h b/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
index 0befa8fd8068b..6bb99f0db7b85 100644
--- a/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
+++ b/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
@@ -1430,9 +1430,7 @@ class Branch : public Terminator {
BasicBlock *elseBlock() { return Branches[1]; }
/// Return the list of basic blocks that this terminator can branch to.
- ArrayRef<BasicBlock*> successors() {
- return llvm::makeArrayRef(Branches);
- }
+ ArrayRef<BasicBlock *> successors() { return llvm::ArrayRef(Branches); }
template <class V>
typename V::R_SExpr traverse(V &Vs, typename V::R_Ctx Ctx) {
diff --git a/clang/include/clang/Basic/Diagnostic.h b/clang/include/clang/Basic/Diagnostic.h
index 1aff5b4fa8a47..927ed14347a00 100644
--- a/clang/include/clang/Basic/Diagnostic.h
+++ b/clang/include/clang/Basic/Diagnostic.h
@@ -1722,9 +1722,7 @@ class StoredDiagnostic {
range_iterator range_end() const { return Ranges.end(); }
unsigned range_size() const { return Ranges.size(); }
- ArrayRef<CharSourceRange> getRanges() const {
- return llvm::makeArrayRef(Ranges);
- }
+ ArrayRef<CharSourceRange> getRanges() const { return llvm::ArrayRef(Ranges); }
using fixit_iterator = std::vector<FixItHint>::const_iterator;
@@ -1732,9 +1730,7 @@ class StoredDiagnostic {
fixit_iterator fixit_end() const { return FixIts.end(); }
unsigned fixit_size() const { return FixIts.size(); }
- ArrayRef<FixItHint> getFixIts() const {
- return llvm::makeArrayRef(FixIts);
- }
+ ArrayRef<FixItHint> getFixIts() const { return llvm::ArrayRef(FixIts); }
};
// Simple debug printing of StoredDiagnostic.
diff --git a/clang/include/clang/Basic/SyncScope.h b/clang/include/clang/Basic/SyncScope.h
index 34703310af2b6..7919f64c6daf9 100644
--- a/clang/include/clang/Basic/SyncScope.h
+++ b/clang/include/clang/Basic/SyncScope.h
@@ -145,7 +145,7 @@ class AtomicScopeOpenCLModel : public AtomicScopeModel {
static const unsigned Scopes[] = {
static_cast<unsigned>(WorkGroup), static_cast<unsigned>(Device),
static_cast<unsigned>(AllSVMDevices), static_cast<unsigned>(SubGroup)};
- return llvm::makeArrayRef(Scopes);
+ return llvm::ArrayRef(Scopes);
}
unsigned getFallBackValue() const override {
@@ -197,7 +197,7 @@ class AtomicScopeHIPModel : public AtomicScopeModel {
static_cast<unsigned>(SingleThread), static_cast<unsigned>(Wavefront),
static_cast<unsigned>(Workgroup), static_cast<unsigned>(Agent),
static_cast<unsigned>(System)};
- return llvm::makeArrayRef(Scopes);
+ return llvm::ArrayRef(Scopes);
}
unsigned getFallBackValue() const override {
diff --git a/clang/include/clang/CodeGen/CGFunctionInfo.h b/clang/include/clang/CodeGen/CGFunctionInfo.h
index 288097b0dc897..c042bcd9fc5f3 100644
--- a/clang/include/clang/CodeGen/CGFunctionInfo.h
+++ b/clang/include/clang/CodeGen/CGFunctionInfo.h
@@ -371,7 +371,7 @@ class ABIArgInfo {
dyn_cast<llvm::StructType>(UnpaddedCoerceAndExpandType)) {
return structTy->elements();
} else {
- return llvm::makeArrayRef(&UnpaddedCoerceAndExpandType, 1);
+ return llvm::ArrayRef(&UnpaddedCoerceAndExpandType, 1);
}
}
@@ -713,7 +713,7 @@ class CGFunctionInfo final
ArrayRef<ExtParameterInfo> getExtParameterInfos() const {
if (!HasExtParameterInfos) return {};
- return llvm::makeArrayRef(getExtParameterInfosBuffer(), NumArgs);
+ return llvm::ArrayRef(getExtParameterInfosBuffer(), NumArgs);
}
ExtParameterInfo getExtParameterInfo(unsigned argIndex) const {
assert(argIndex <= NumArgs);
diff --git a/clang/include/clang/Lex/MacroInfo.h b/clang/include/clang/Lex/MacroInfo.h
index dc7ddb1a5939e..feb41e43e3183 100644
--- a/clang/include/clang/Lex/MacroInfo.h
+++ b/clang/include/clang/Lex/MacroInfo.h
@@ -247,7 +247,7 @@ class MacroInfo {
}
bool tokens_empty() const { return NumReplacementTokens == 0; }
ArrayRef<Token> tokens() const {
- return llvm::makeArrayRef(ReplacementTokens, NumReplacementTokens);
+ return llvm::ArrayRef(ReplacementTokens, NumReplacementTokens);
}
llvm::MutableArrayRef<Token>
@@ -572,7 +572,7 @@ class ModuleMacro : public llvm::FoldingSetNode {
}
ArrayRef<ModuleMacro *> overrides() const {
- return llvm::makeArrayRef(overrides_begin(), overrides_end());
+ return llvm::ArrayRef(overrides_begin(), overrides_end());
}
/// \}
diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h
index 66caecb34fea5..67e163ca512d1 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -1233,7 +1233,7 @@ class Parser : public CodeCompletionHandler {
/// returns false.
bool SkipUntil(tok::TokenKind T,
SkipUntilFlags Flags = static_cast<SkipUntilFlags>(0)) {
- return SkipUntil(llvm::makeArrayRef(T), Flags);
+ return SkipUntil(llvm::ArrayRef(T), Flags);
}
bool SkipUntil(tok::TokenKind T1, tok::TokenKind T2,
SkipUntilFlags Flags = static_cast<SkipUntilFlags>(0)) {
diff --git a/clang/include/clang/Sema/DeclSpec.h b/clang/include/clang/Sema/DeclSpec.h
index 98f9bec16e607..69fe2c541607b 100644
--- a/clang/include/clang/Sema/DeclSpec.h
+++ b/clang/include/clang/Sema/DeclSpec.h
@@ -1513,7 +1513,7 @@ struct DeclaratorChunk {
/// prototype. Typically these are tag declarations.
ArrayRef<NamedDecl *> getDeclsInPrototype() const {
assert(ExceptionSpecType == EST_None);
- return llvm::makeArrayRef(DeclsInPrototype, NumExceptionsOrDecls);
+ return llvm::ArrayRef(DeclsInPrototype, NumExceptionsOrDecls);
}
/// Determine whether this function declarator had a
@@ -1760,7 +1760,7 @@ class DecompositionDeclarator {
}
ArrayRef<Binding> bindings() const {
- return llvm::makeArrayRef(Bindings, NumBindings);
+ return llvm::ArrayRef(Bindings, NumBindings);
}
bool isSet() const { return LSquareLoc.isValid(); }
diff --git a/clang/include/clang/Sema/DelayedDiagnostic.h b/clang/include/clang/Sema/DelayedDiagnostic.h
index 50abcc421d45c..9de7131f74c70 100644
--- a/clang/include/clang/Sema/DelayedDiagnostic.h
+++ b/clang/include/clang/Sema/DelayedDiagnostic.h
@@ -190,8 +190,8 @@ class DelayedDiagnostic {
ArrayRef<SourceLocation> getAvailabilitySelectorLocs() const {
assert(Kind == Availability && "Not an availability diagnostic.");
- return llvm::makeArrayRef(AvailabilityData.SelectorLocs,
- AvailabilityData.NumSelectorLocs);
+ return llvm::ArrayRef(AvailabilityData.SelectorLocs,
+ AvailabilityData.NumSelectorLocs);
}
AvailabilityResult getAvailabilityResult() const {
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 4714b8b7cbde6..6c0d950eb929c 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -803,8 +803,8 @@ class Sema final {
unsigned FunctionScopesStart = 0;
ArrayRef<sema::FunctionScopeInfo*> getFunctionScopes() const {
- return llvm::makeArrayRef(FunctionScopes.begin() + FunctionScopesStart,
- FunctionScopes.end());
+ return llvm::ArrayRef(FunctionScopes.begin() + FunctionScopesStart,
+ FunctionScopes.end());
}
/// Stack containing information needed when in C++2a an 'auto' is encountered
@@ -819,9 +819,9 @@ class Sema final {
unsigned InventedParameterInfosStart = 0;
ArrayRef<InventedTemplateParameterInfo> getInventedParameterInfos() const {
- return llvm::makeArrayRef(InventedParameterInfos.begin() +
- InventedParameterInfosStart,
- InventedParameterInfos.end());
+ return llvm::ArrayRef(InventedParameterInfos.begin() +
+ InventedParameterInfosStart,
+ InventedParameterInfos.end());
}
typedef LazyVector<TypedefNameDecl *, ExternalSemaSource,
diff --git a/clang/include/clang/Serialization/ASTRecordReader.h b/clang/include/clang/Serialization/ASTRecordReader.h
index 9a79b990dad2e..5a96e364cf163 100644
--- a/clang/include/clang/Serialization/ASTRecordReader.h
+++ b/clang/include/clang/Serialization/ASTRecordReader.h
@@ -74,7 +74,7 @@ class ASTRecordReader
uint64_t readInt() { return Record[Idx++]; }
ArrayRef<uint64_t> readIntArray(unsigned Len) {
- auto Array = llvm::makeArrayRef(Record).slice(Idx, Len);
+ auto Array = llvm::ArrayRef(Record).slice(Idx, Len);
Idx += Len;
return Array;
}
diff --git a/clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h b/clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h
index 0ae023b8d4e4b..aff965edb07c3 100644
--- a/clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h
+++ b/clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h
@@ -70,7 +70,7 @@ class SymbolOccurrence {
ArrayRef<SourceRange> getNameRanges() const {
if (MultipleRanges)
- return llvm::makeArrayRef(MultipleRanges.get(), NumRanges);
+ return llvm::ArrayRef(MultipleRanges.get(), NumRanges);
return SingleRange;
}
diff --git a/clang/include/clang/Tooling/Transformer/RewriteRule.h b/clang/include/clang/Tooling/Transformer/RewriteRule.h
index 4e8537c6c801d..50f460d65e7dd 100644
--- a/clang/include/clang/Tooling/Transformer/RewriteRule.h
+++ b/clang/include/clang/Tooling/Transformer/RewriteRule.h
@@ -428,13 +428,13 @@ RewriteRuleWith<void> applyFirst(ArrayRef<RewriteRuleWith<void>> Rules);
template <typename MetadataT>
RewriteRuleWith<MetadataT>
applyFirst(const std::vector<RewriteRuleWith<MetadataT>> &Rules) {
- return applyFirst(llvm::makeArrayRef(Rules));
+ return applyFirst(llvm::ArrayRef(Rules));
}
template <typename MetadataT>
RewriteRuleWith<MetadataT>
applyFirst(std::initializer_list<RewriteRuleWith<MetadataT>> Rules) {
- return applyFirst(llvm::makeArrayRef(Rules.begin(), Rules.end()));
+ return applyFirst(llvm::ArrayRef(Rules.begin(), Rules.end()));
}
/// @}
diff --git a/clang/lib/AST/APValue.cpp b/clang/lib/AST/APValue.cpp
index d583718c0eeb0..5b0a5e256e411 100644
--- a/clang/lib/AST/APValue.cpp
+++ b/clang/lib/AST/APValue.cpp
@@ -984,7 +984,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::makeArrayRef(LVal.getPath(), LVal.PathLength);
+ return llvm::ArrayRef(LVal.getPath(), LVal.PathLength);
}
unsigned APValue::getLValueCallIndex() const {
@@ -1062,7 +1062,7 @@ ArrayRef<const CXXRecordDecl*> APValue::getMemberPointerPath() const {
assert(isMemberPointer() && "Invalid accessor");
const MemberPointerData &MPD =
*((const MemberPointerData *)(const char *)&Data);
- return llvm::makeArrayRef(MPD.getPath(), MPD.PathLength);
+ return llvm::ArrayRef(MPD.getPath(), MPD.PathLength);
}
void APValue::MakeLValue() {
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 263123dbbbe0f..15a43807c3603 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -5297,7 +5297,7 @@ QualType ASTContext::getObjCObjectType(QualType BaseType,
ObjCProtocolDecl * const *Protocols,
unsigned NumProtocols) const {
return getObjCObjectType(BaseType, {},
- llvm::makeArrayRef(Protocols, NumProtocols),
+ llvm::ArrayRef(Protocols, NumProtocols),
/*isKindOf=*/false);
}
diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp
index 19923ec7f2309..08877aa12c024 100644
--- a/clang/lib/AST/ASTDiagnostic.cpp
+++ b/clang/lib/AST/ASTDiagnostic.cpp
@@ -227,7 +227,7 @@ break; \
desugarForDiagnostic(Context, Ty->getBaseType(), ShouldAKA);
QT = Context.getObjCObjectType(
BaseType, Ty->getTypeArgsAsWritten(),
- llvm::makeArrayRef(Ty->qual_begin(), Ty->getNumProtocols()),
+ llvm::ArrayRef(Ty->qual_begin(), Ty->getNumProtocols()),
Ty->isKindOfTypeAsWritten());
}
}
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index 329718c99dc65..60cafbce6f864 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -895,7 +895,7 @@ ASTNodeImporter::import(const TemplateArgument &From) {
return std::move(Err);
return TemplateArgument(
- llvm::makeArrayRef(ToPack).copy(Importer.getToContext()));
+ llvm::ArrayRef(ToPack).copy(Importer.getToContext()));
}
}
@@ -3174,10 +3174,10 @@ Error ASTNodeImporter::ImportTemplateInformation(
// Import TemplateArgumentListInfo.
TemplateArgumentListInfo ToTAInfo;
if (Error Err = ImportTemplateArgumentListInfo(
- FromInfo->getLAngleLoc(), FromInfo->getRAngleLoc(),
- llvm::makeArrayRef(
- FromInfo->getTemplateArgs(), FromInfo->getNumTemplateArgs()),
- ToTAInfo))
+ FromInfo->getLAngleLoc(), FromInfo->getRAngleLoc(),
+ llvm::ArrayRef(FromInfo->getTemplateArgs(),
+ FromInfo->getNumTemplateArgs()),
+ ToTAInfo))
return Err;
ToFD->setDependentTemplateSpecialization(Importer.getToContext(),
@@ -5916,10 +5916,10 @@ ExpectedDecl ASTNodeImporter::VisitClassTemplateSpecializationDecl(
CanonInjType = CanonInjType.getCanonicalType();
if (GetImportedOrCreateDecl<ClassTemplatePartialSpecializationDecl>(
- D2, D, Importer.getToContext(), D->getTagKind(), DC,
- *BeginLocOrErr, *IdLocOrErr, ToTPList, ClassTemplate,
- llvm::makeArrayRef(TemplateArgs.data(), TemplateArgs.size()),
- ToTAInfo, CanonInjType,
+ D2, D, Importer.getToContext(), D->getTagKind(), DC, *BeginLocOrErr,
+ *IdLocOrErr, ToTPList, ClassTemplate,
+ llvm::ArrayRef(TemplateArgs.data(), TemplateArgs.size()), ToTAInfo,
+ CanonInjType,
cast_or_null<ClassTemplatePartialSpecializationDecl>(PrevDecl)))
return D2;
@@ -7012,14 +7012,14 @@ ASTNodeImporter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
const ASTContext &ToCtx = Importer.getToContext();
if (E->isResultDependent()) {
return GenericSelectionExpr::Create(
- ToCtx, ToGenericLoc, ToControllingExpr,
- llvm::makeArrayRef(ToAssocTypes), llvm::makeArrayRef(ToAssocExprs),
- ToDefaultLoc, ToRParenLoc, E->containsUnexpandedParameterPack());
+ ToCtx, ToGenericLoc, ToControllingExpr, llvm::ArrayRef(ToAssocTypes),
+ llvm::ArrayRef(ToAssocExprs), ToDefaultLoc, ToRParenLoc,
+ E->containsUnexpandedParameterPack());
}
return GenericSelectionExpr::Create(
- ToCtx, ToGenericLoc, ToControllingExpr, llvm::makeArrayRef(ToAssocTypes),
- llvm::makeArrayRef(ToAssocExprs), ToDefaultLoc, ToRParenLoc,
+ ToCtx, ToGenericLoc, ToControllingExpr, llvm::ArrayRef(ToAssocTypes),
+ llvm::ArrayRef(ToAssocExprs), ToDefaultLoc, ToRParenLoc,
E->containsUnexpandedParameterPack(), E->getResultIndex());
}
@@ -8111,7 +8111,7 @@ ExpectedStmt ASTNodeImporter::VisitCXXUnresolvedConstructExpr(
return CXXUnresolvedConstructExpr::Create(
Importer.getToContext(), ToType, ToTypeSourceInfo, ToLParenLoc,
- llvm::makeArrayRef(ToArgs), ToRParenLoc);
+ llvm::ArrayRef(ToArgs), ToRParenLoc);
}
ExpectedStmt
diff --git a/clang/lib/AST/CommentParser.cpp b/clang/lib/AST/CommentParser.cpp
index 522bc5bda6b28..8adfd85d0160c 100644
--- a/clang/lib/AST/CommentParser.cpp
+++ b/clang/lib/AST/CommentParser.cpp
@@ -245,7 +245,7 @@ class TextTokenRetokenizer {
Pos.CurToken++;
}
- P.putBack(llvm::makeArrayRef(Toks.begin() + Pos.CurToken, Toks.end()));
+ P.putBack(llvm::ArrayRef(Toks.begin() + Pos.CurToken, Toks.end()));
Pos.CurToken = Toks.size();
if (HavePartialTok)
@@ -301,7 +301,7 @@ Parser::parseCommandArgs(TextTokenRetokenizer &Retokenizer, unsigned NumArgs) {
ParsedArgs++;
}
- return llvm::makeArrayRef(Args, ParsedArgs);
+ return llvm::ArrayRef(Args, ParsedArgs);
}
BlockCommandComment *Parser::parseBlockCommand() {
@@ -467,16 +467,14 @@ HTMLStartTagComment *Parser::parseHTMLStartTag() {
}
case tok::html_greater:
- S.actOnHTMLStartTagFinish(HST,
- S.copyArray(llvm::makeArrayRef(Attrs)),
+ S.actOnHTMLStartTagFinish(HST, S.copyArray(llvm::ArrayRef(Attrs)),
Tok.getLocation(),
/* IsSelfClosing = */ false);
consumeToken();
return HST;
case tok::html_slash_greater:
- S.actOnHTMLStartTagFinish(HST,
- S.copyArray(llvm::makeArrayRef(Attrs)),
+ S.actOnHTMLStartTagFinish(HST, S.copyArray(llvm::ArrayRef(Attrs)),
Tok.getLocation(),
/* IsSelfClosing = */ true);
consumeToken();
@@ -494,16 +492,14 @@ HTMLStartTagComment *Parser::parseHTMLStartTag() {
Tok.is(tok::html_slash_greater))
continue;
- S.actOnHTMLStartTagFinish(HST,
- S.copyArray(llvm::makeArrayRef(Attrs)),
+ S.actOnHTMLStartTagFinish(HST, S.copyArray(llvm::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::makeArrayRef(Attrs)),
+ S.actOnHTMLStartTagFinish(HST, S.copyArray(llvm::ArrayRef(Attrs)),
SourceLocation(),
/* IsSelfClosing = */ false);
bool StartLineInvalid;
@@ -642,7 +638,7 @@ BlockContentComment *Parser::parseParagraphOrBlockCommand() {
break;
}
- return S.actOnParagraphComment(S.copyArray(llvm::makeArrayRef(Content)));
+ return S.actOnParagraphComment(S.copyArray(llvm::ArrayRef(Content)));
}
VerbatimBlockComment *Parser::parseVerbatimBlock() {
@@ -679,14 +675,13 @@ 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::makeArrayRef(Lines)));
+ S.actOnVerbatimBlockFinish(VB, Tok.getLocation(), Info->Name,
+ S.copyArray(llvm::ArrayRef(Lines)));
consumeToken();
} else {
// Unterminated \\verbatim block
S.actOnVerbatimBlockFinish(VB, SourceLocation(), "",
- S.copyArray(llvm::makeArrayRef(Lines)));
+ S.copyArray(llvm::ArrayRef(Lines)));
}
return VB;
@@ -762,7 +757,7 @@ FullComment *Parser::parseFullComment() {
while (Tok.is(tok::newline))
consumeToken();
}
- return S.actOnFullComment(S.copyArray(llvm::makeArrayRef(Blocks)));
+ return S.actOnFullComment(S.copyArray(llvm::ArrayRef(Blocks)));
}
} // end namespace comments
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp
index 9b0f034458884..a4250c0b7cbb4 100644
--- a/clang/lib/AST/CommentSema.cpp
+++ b/clang/lib/AST/CommentSema.cpp
@@ -267,7 +267,7 @@ void Sema::actOnParamCommandParamNameArg(ParamCommandComment *Command,
}
auto *A = new (Allocator)
Comment::Argument{SourceRange(ArgLocBegin, ArgLocEnd), Arg};
- Command->setArgs(llvm::makeArrayRef(A, 1));
+ Command->setArgs(llvm::ArrayRef(A, 1));
}
void Sema::actOnParamCommandFinish(ParamCommandComment *Command,
@@ -303,7 +303,7 @@ void Sema::actOnTParamCommandParamNameArg(TParamCommandComment *Command,
auto *A = new (Allocator)
Comment::Argument{SourceRange(ArgLocBegin, ArgLocEnd), Arg};
- Command->setArgs(llvm::makeArrayRef(A, 1));
+ Command->setArgs(llvm::ArrayRef(A, 1));
if (!isTemplateOrSpecialization()) {
// We already warned that this \\tparam is not attached to a template decl.
@@ -314,7 +314,7 @@ void Sema::actOnTParamCommandParamNameArg(TParamCommandComment *Command,
ThisDeclInfo->TemplateParameters;
SmallVector<unsigned, 2> Position;
if (resolveTParamReference(Arg, TemplateParameters, &Position)) {
- Command->setPosition(copyArray(llvm::makeArrayRef(Position)));
+ Command->setPosition(copyArray(llvm::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 40ebde06d7718..5668c87d7c4d1 100644
--- a/clang/lib/AST/ComputeDependence.cpp
+++ b/clang/lib/AST/ComputeDependence.cpp
@@ -594,7 +594,7 @@ ExprDependence clang::computeDependence(PredefinedExpr *E) {
ExprDependence clang::computeDependence(CallExpr *E,
llvm::ArrayRef<Expr *> PreArgs) {
auto D = E->getCallee()->getDependence();
- for (auto *A : llvm::makeArrayRef(E->getArgs(), E->getNumArgs())) {
+ for (auto *A : llvm::ArrayRef(E->getArgs(), E->getNumArgs())) {
if (A)
D |= A->getDependence();
}
@@ -642,7 +642,7 @@ ExprDependence clang::computeDependence(InitListExpr *E) {
ExprDependence clang::computeDependence(ShuffleVectorExpr *E) {
auto D = toExprDependenceForImpliedType(E->getType()->getDependence());
- for (auto *C : llvm::makeArrayRef(E->getSubExprs(), E->getNumSubExprs()))
+ for (auto *C : llvm::ArrayRef(E->getSubExprs(), E->getNumSubExprs()))
D |= C->getDependence();
return D;
}
@@ -686,7 +686,7 @@ ExprDependence clang::computeDependence(PseudoObjectExpr *O) {
ExprDependence clang::computeDependence(AtomicExpr *A) {
auto D = ExprDependence::None;
- for (auto *E : llvm::makeArrayRef(A->getSubExprs(), A->getNumSubExprs()))
+ for (auto *E : llvm::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 47c1f4891a139..0e1bc2d68ebda 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -5379,8 +5379,8 @@ ArrayRef<SourceLocation> ImportDecl::getIdentifierLocs() const {
return std::nullopt;
const auto *StoredLocs = getTrailingObjects<SourceLocation>();
- return llvm::makeArrayRef(StoredLocs,
- getNumModuleIdentifiers(getImportedModule()));
+ return llvm::ArrayRef(StoredLocs,
+ getNumModuleIdentifiers(getImportedModule()));
}
SourceRange ImportDecl::getSourceRange() const {
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp
index 8f06b9b5c3312..1576c27a463fe 100644
--- a/clang/lib/AST/DeclCXX.cpp
+++ b/clang/lib/AST/DeclCXX.cpp
@@ -1637,7 +1637,7 @@ CXXRecordDecl::getLambdaExplicitTemplateParameters() const {
const auto ExplicitEnd = llvm::partition_point(
*List, [](const NamedDecl *D) { return !D->isImplicit(); });
- return llvm::makeArrayRef(List->begin(), ExplicitEnd);
+ return llvm::ArrayRef(List->begin(), ExplicitEnd);
}
Decl *CXXRecordDecl::getLambdaContextDecl() const {
diff --git a/clang/lib/AST/DeclTemplate.cpp b/clang/lib/AST/DeclTemplate.cpp
index 0b21100bb82b1..5fac054b530d2 100644
--- a/clang/lib/AST/DeclTemplate.cpp
+++ b/clang/lib/AST/DeclTemplate.cpp
@@ -365,7 +365,7 @@ ArrayRef<TemplateArgument> RedeclarableTemplateDecl::getInjectedTemplateArgs() {
CommonPtr->InjectedArgs);
}
- return llvm::makeArrayRef(CommonPtr->InjectedArgs, Params->size());
+ return llvm::ArrayRef(CommonPtr->InjectedArgs, Params->size());
}
//===----------------------------------------------------------------------===//
@@ -1515,8 +1515,8 @@ createTypePackElementParameterList(const ASTContext &C, DeclContext *DC) {
// template <std::size_t Index, typename ...T>
NamedDecl *Params[] = {Index, Ts};
return TemplateParameterList::Create(C, SourceLocation(), SourceLocation(),
- llvm::makeArrayRef(Params),
- SourceLocation(), nullptr);
+ llvm::ArrayRef(Params), SourceLocation(),
+ nullptr);
}
static TemplateParameterList *createBuiltinTemplateParameterList(
diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp
index f7674b4280ad5..a78ad16a7df78 100644
--- a/clang/lib/AST/ExprCXX.cpp
+++ b/clang/lib/AST/ExprCXX.cpp
@@ -1671,7 +1671,7 @@ SubstNonTypeTemplateParmPackExpr::getParameterPack() const {
}
TemplateArgument SubstNonTypeTemplateParmPackExpr::getArgumentPack() const {
- return TemplateArgument(llvm::makeArrayRef(Arguments, NumArguments));
+ return TemplateArgument(llvm::ArrayRef(Arguments, NumArguments));
}
FunctionParmPackExpr::FunctionParmPackExpr(QualType T, VarDecl *ParamPack,
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index a43845e53c5d0..9e0e630061a20 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -3655,9 +3655,9 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj,
if ((ObjType.isConstQualified() || ObjType.isVolatileQualified()) &&
ObjType->isRecordType() &&
Info.isEvaluatingCtorDtor(
- Obj.Base, llvm::makeArrayRef(Sub.Entries.begin(),
- Sub.Entries.begin() + I)) !=
- ConstructionPhase::None) {
+ Obj.Base,
+ llvm::ArrayRef(Sub.Entries.begin(), Sub.Entries.begin() + I)) !=
+ ConstructionPhase::None) {
ObjType = Info.Ctx.getCanonicalType(ObjType);
ObjType.removeLocalConst();
ObjType.removeLocalVolatile();
@@ -7630,7 +7630,7 @@ class ExprEvaluatorBase
const FunctionDecl *FD = nullptr;
LValue *This = nullptr, ThisVal;
- auto Args = llvm::makeArrayRef(E->getArgs(), E->getNumArgs());
+ auto Args = llvm::ArrayRef(E->getArgs(), E->getNumArgs());
bool HasQualifier = false;
CallRef Call;
@@ -10115,7 +10115,7 @@ bool RecordExprEvaluator::VisitCXXConstructExpr(const CXXConstructExpr *E,
if (ZeroInit && !ZeroInitialization(E, T))
return false;
- auto Args = llvm::makeArrayRef(E->getArgs(), E->getNumArgs());
+ auto Args = llvm::ArrayRef(E->getArgs(), E->getNumArgs());
return HandleConstructorCall(E, This, Args,
cast<CXXConstructorDecl>(Definition), Info,
Result);
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp
index dd35391f9f396..abbfdca9da362 100644
--- a/clang/lib/AST/OpenMPClause.cpp
+++ b/clang/lib/AST/OpenMPClause.cpp
@@ -367,7 +367,7 @@ void OMPOrderedClause::setLoopNumIterations(unsigned NumLoop,
}
ArrayRef<Expr *> OMPOrderedClause::getLoopNumIterations() const {
- return llvm::makeArrayRef(getTrailingObjects<Expr *>(), NumberOfLoops);
+ return llvm::ArrayRef(getTrailingObjects<Expr *>(), NumberOfLoops);
}
void OMPOrderedClause::setLoopCounter(unsigned NumLoop, Expr *Counter) {
diff --git a/clang/lib/AST/ParentMapContext.cpp b/clang/lib/AST/ParentMapContext.cpp
index 0840c573e0e45..21cfd5b1de6e9 100644
--- a/clang/lib/AST/ParentMapContext.cpp
+++ b/clang/lib/AST/ParentMapContext.cpp
@@ -99,7 +99,7 @@ class ParentMapContext::ParentMap {
return llvm::ArrayRef<DynTypedNode>();
}
if (const auto *V = I->second.template dyn_cast<ParentVector *>()) {
- return llvm::makeArrayRef(*V);
+ return llvm::ArrayRef(*V);
}
return getSingleDynTypedNodeFromParentMap(I->second);
}
@@ -252,7 +252,7 @@ class ParentMapContext::ParentMap {
const auto *S = It->second.dyn_cast<const Stmt *>();
if (!S) {
if (auto *Vec = It->second.dyn_cast<ParentVector *>())
- return llvm::makeArrayRef(*Vec);
+ return llvm::ArrayRef(*Vec);
return getSingleDynTypedNodeFromParentMap(It->second);
}
const auto *P = dyn_cast<Expr>(S);
diff --git a/clang/lib/AST/TemplateName.cpp b/clang/lib/AST/TemplateName.cpp
index c348d76ed5606..f0e3e94f43c24 100644
--- a/clang/lib/AST/TemplateName.cpp
+++ b/clang/lib/AST/TemplateName.cpp
@@ -35,7 +35,7 @@ using namespace clang;
TemplateArgument
SubstTemplateTemplateParmPackStorage::getArgumentPack() const {
- return TemplateArgument(llvm::makeArrayRef(Arguments, Bits.Data));
+ return TemplateArgument(llvm::ArrayRef(Arguments, Bits.Data));
}
TemplateTemplateParmDecl *
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index eb249ae7c6585..aec8e9596e42c 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -1076,7 +1076,7 @@ struct SimpleTransformVisitor : public TypeVisitor<Derived, QualType> {
if (exceptionChanged) {
info.ExceptionSpec.Exceptions =
- llvm::makeArrayRef(exceptionTypes).copy(Ctx);
+ llvm::ArrayRef(exceptionTypes).copy(Ctx);
}
}
@@ -1218,10 +1218,10 @@ struct SimpleTransformVisitor : public TypeVisitor<Derived, QualType> {
!typeArgChanged)
return QualType(T, 0);
- return Ctx.getObjCObjectType(baseType, typeArgs,
- llvm::makeArrayRef(T->qual_begin(),
- T->getNumProtocols()),
- T->isKindOfTypeAsWritten());
+ return Ctx.getObjCObjectType(
+ baseType, typeArgs,
+ llvm::ArrayRef(T->qual_begin(), T->getNumProtocols()),
+ T->isKindOfTypeAsWritten());
}
TRIVIAL_TYPE_CLASS(ObjCInterface)
@@ -1373,7 +1373,7 @@ struct SubstObjCTypeArgsVisitor
if (exceptionChanged) {
info.ExceptionSpec.Exceptions =
- llvm::makeArrayRef(exceptionTypes).copy(Ctx);
+ llvm::ArrayRef(exceptionTypes).copy(Ctx);
}
}
@@ -3718,7 +3718,7 @@ IdentifierInfo *SubstTemplateTypeParmPackType::getIdentifier() const {
}
TemplateArgument SubstTemplateTypeParmPackType::getArgumentPack() const {
- return TemplateArgument(llvm::makeArrayRef(Arguments, getNumArgs()));
+ return TemplateArgument(llvm::ArrayRef(Arguments, getNumArgs()));
}
void SubstTemplateTypeParmPackType::Profile(llvm::FoldingSetNodeID &ID) {
@@ -3860,7 +3860,7 @@ void ObjCObjectTypeImpl::Profile(llvm::FoldingSetNodeID &ID,
void ObjCObjectTypeImpl::Profile(llvm::FoldingSetNodeID &ID) {
Profile(ID, getBaseType(), getTypeArgsAsWritten(),
- llvm::makeArrayRef(qual_begin(), getNumProtocols()),
+ llvm::ArrayRef(qual_begin(), getNumProtocols()),
isKindOfTypeAsWritten());
}
@@ -3877,7 +3877,7 @@ void ObjCTypeParamType::Profile(llvm::FoldingSetNodeID &ID,
void ObjCTypeParamType::Profile(llvm::FoldingSetNodeID &ID) {
Profile(ID, getDecl(), getCanonicalTypeInternal(),
- llvm::makeArrayRef(qual_begin(), getNumProtocols()));
+ llvm::ArrayRef(qual_begin(), getNumProtocols()));
}
namespace {
diff --git a/clang/lib/ASTMatchers/Dynamic/Marshallers.cpp b/clang/lib/ASTMatchers/Dynamic/Marshallers.cpp
index a1943315e454b..31cb57af873c5 100644
--- a/clang/lib/ASTMatchers/Dynamic/Marshallers.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Marshallers.cpp
@@ -67,8 +67,7 @@ clang::ast_matchers::dynamic::internal::ArgTypeTraits<
#include "clang/Basic/AttrList.inc"
};
if (Value.isString())
- return ::getBestGuess(Value.getString(), llvm::makeArrayRef(Allowed),
- "attr::");
+ return ::getBestGuess(Value.getString(), llvm::ArrayRef(Allowed), "attr::");
return std::nullopt;
}
@@ -80,8 +79,7 @@ clang::ast_matchers::dynamic::internal::ArgTypeTraits<
#include "clang/AST/OperationKinds.def"
};
if (Value.isString())
- return ::getBestGuess(Value.getString(), llvm::makeArrayRef(Allowed),
- "CK_");
+ return ::getBestGuess(Value.getString(), llvm::ArrayRef(Allowed), "CK_");
return std::nullopt;
}
@@ -94,8 +92,7 @@ clang::ast_matchers::dynamic::internal::ArgTypeTraits<
#include "llvm/Frontend/OpenMP/OMP.inc"
};
if (Value.isString())
- return ::getBestGuess(Value.getString(), llvm::makeArrayRef(Allowed),
- "OMPC_");
+ return ::getBestGuess(Value.getString(), llvm::ArrayRef(Allowed), "OMPC_");
return std::nullopt;
}
@@ -108,8 +105,7 @@ clang::ast_matchers::dynamic::internal::ArgTypeTraits<
#include "clang/Basic/TokenKinds.def"
};
if (Value.isString())
- return ::getBestGuess(Value.getString(), llvm::makeArrayRef(Allowed),
- "UETT_");
+ return ::getBestGuess(Value.getString(), llvm::ArrayRef(Allowed), "UETT_");
return std::nullopt;
}
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index c3b774fafadfb..7f2c8340cdce3 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -436,8 +436,8 @@ reverse_children::reverse_children(Stmt *S) {
// Note: Fill in this switch with more cases we want to optimize.
case Stmt::InitListExprClass: {
InitListExpr *IE = cast<InitListExpr>(S);
- children = llvm::makeArrayRef(reinterpret_cast<Stmt**>(IE->getInits()),
- IE->getNumInits());
+ children = llvm::ArrayRef(reinterpret_cast<Stmt **>(IE->getInits()),
+ IE->getNumInits());
return;
}
default:
diff --git a/clang/lib/Analysis/CalledOnceCheck.cpp b/clang/lib/Analysis/CalledOnceCheck.cpp
index 4d1c2f834ea84..896562ca3bb46 100644
--- a/clang/lib/Analysis/CalledOnceCheck.cpp
+++ b/clang/lib/Analysis/CalledOnceCheck.cpp
@@ -880,8 +880,8 @@ class CalledOnceChecker : public ConstStmtVisitor<CalledOnceChecker> {
template <class CallLikeExpr>
void checkIndirectCall(const CallLikeExpr *CallOrMessage) {
// CallExpr::arguments does not interact nicely with llvm::enumerate.
- llvm::ArrayRef<const Expr *> Arguments = llvm::makeArrayRef(
- CallOrMessage->getArgs(), CallOrMessage->getNumArgs());
+ llvm::ArrayRef<const Expr *> Arguments =
+ llvm::ArrayRef(CallOrMessage->getArgs(), CallOrMessage->getNumArgs());
// Let's check if any of the call arguments is a point of interest.
for (const auto &Argument : llvm::enumerate(Arguments)) {
@@ -1157,8 +1157,8 @@ class CalledOnceChecker : public ConstStmtVisitor<CalledOnceChecker> {
bool shouldBlockArgumentBeCalledOnce(const CallLikeExpr *CallOrMessage,
const Stmt *BlockArgument) const {
// CallExpr::arguments does not interact nicely with llvm::enumerate.
- llvm::ArrayRef<const Expr *> Arguments = llvm::makeArrayRef(
- CallOrMessage->getArgs(), CallOrMessage->getNumArgs());
+ llvm::ArrayRef<const Expr *> Arguments =
+ llvm::ArrayRef(CallOrMessage->getArgs(), CallOrMessage->getNumArgs());
for (const auto &Argument : llvm::enumerate(Arguments)) {
if (Argument.value() == BlockArgument) {
diff --git a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
index 1a561b31aae9a..3e2958bfe407c 100644
--- a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
+++ b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
@@ -275,7 +275,7 @@ Environment Environment::pushCall(const CallExpr *Call) const {
}
Env.pushCallInternal(Call->getDirectCallee(),
- llvm::makeArrayRef(Call->getArgs(), Call->getNumArgs()));
+ llvm::ArrayRef(Call->getArgs(), Call->getNumArgs()));
return Env;
}
@@ -289,7 +289,7 @@ Environment Environment::pushCall(const CXXConstructExpr *Call) const {
Env.ThisPointeeLoc = Env.ReturnLoc;
Env.pushCallInternal(Call->getConstructor(),
- llvm::makeArrayRef(Call->getArgs(), Call->getNumArgs()));
+ llvm::ArrayRef(Call->getArgs(), Call->getNumArgs()));
return Env;
}
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index 2f30fa0f02adf..aa82a99143379 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -264,7 +264,7 @@ ArrayRef<const FileEntry *> Module::getTopHeaders(FileManager &FileMgr) {
TopHeaderNames.clear();
}
- return llvm::makeArrayRef(TopHeaders.begin(), TopHeaders.end());
+ return llvm::ArrayRef(TopHeaders.begin(), TopHeaders.end());
}
bool Module::directlyUses(const Module *Requested) {
diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp
index 818a6191fdd54..5db313813a76a 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -626,8 +626,8 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
}
ArrayRef<Builtin::Info> AArch64TargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::AArch64::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo, clang::AArch64::LastTSBuiltin -
+ Builtin::FirstTSBuiltin);
}
Optional<std::pair<unsigned, unsigned>>
@@ -1179,7 +1179,7 @@ const char *const AArch64TargetInfo::GCCRegNames[] = {
};
ArrayRef<const char *> AArch64TargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
const TargetInfo::GCCRegAlias AArch64TargetInfo::GCCRegAliases[] = {
@@ -1222,7 +1222,7 @@ const TargetInfo::GCCRegAlias AArch64TargetInfo::GCCRegAliases[] = {
};
ArrayRef<TargetInfo::GCCRegAlias> AArch64TargetInfo::getGCCRegAliases() const {
- return llvm::makeArrayRef(GCCRegAliases);
+ return llvm::ArrayRef(GCCRegAliases);
}
bool AArch64TargetInfo::validateAsmConstraint(
diff --git a/clang/lib/Basic/Targets/AMDGPU.cpp b/clang/lib/Basic/Targets/AMDGPU.cpp
index 7e54f23f5bf99..3d548122113ff 100644
--- a/clang/lib/Basic/Targets/AMDGPU.cpp
+++ b/clang/lib/Basic/Targets/AMDGPU.cpp
@@ -173,7 +173,7 @@ const char *const AMDGPUTargetInfo::GCCRegNames[] = {
};
ArrayRef<const char *> AMDGPUTargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
bool AMDGPUTargetInfo::initFeatureMap(
@@ -425,8 +425,8 @@ void AMDGPUTargetInfo::adjust(DiagnosticsEngine &Diags, LangOptions &Opts) {
}
ArrayRef<Builtin::Info> AMDGPUTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::AMDGPU::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo,
+ clang::AMDGPU::LastTSBuiltin - Builtin::FirstTSBuiltin);
}
void AMDGPUTargetInfo::getTargetDefines(const LangOptions &Opts,
diff --git a/clang/lib/Basic/Targets/ARC.h b/clang/lib/Basic/Targets/ARC.h
index f3640f39b4b47..3cb338a821e19 100644
--- a/clang/lib/Basic/Targets/ARC.h
+++ b/clang/lib/Basic/Targets/ARC.h
@@ -56,7 +56,7 @@ class LLVM_LIBRARY_VISIBILITY ARCTargetInfo : public TargetInfo {
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
"r24", "r25", "gp", "sp", "fp", "ilink1", "r30", "blink"};
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
diff --git a/clang/lib/Basic/Targets/ARM.cpp b/clang/lib/Basic/Targets/ARM.cpp
index b8d61985070d5..bb45505e259c9 100644
--- a/clang/lib/Basic/Targets/ARM.cpp
+++ b/clang/lib/Basic/Targets/ARM.cpp
@@ -1014,8 +1014,8 @@ static constexpr Builtin::Info BuiltinInfo[] = {
};
ArrayRef<Builtin::Info> ARMTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::ARM::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo,
+ clang::ARM::LastTSBuiltin - Builtin::FirstTSBuiltin);
}
bool ARMTargetInfo::isCLZForZeroUndef() const { return false; }
@@ -1046,7 +1046,7 @@ const char *const ARMTargetInfo::GCCRegNames[] = {
"q12", "q13", "q14", "q15"};
ArrayRef<const char *> ARMTargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
const TargetInfo::GCCRegAlias ARMTargetInfo::GCCRegAliases[] = {
@@ -1059,7 +1059,7 @@ const TargetInfo::GCCRegAlias ARMTargetInfo::GCCRegAliases[] = {
};
ArrayRef<TargetInfo::GCCRegAlias> ARMTargetInfo::getGCCRegAliases() const {
- return llvm::makeArrayRef(GCCRegAliases);
+ return llvm::ArrayRef(GCCRegAliases);
}
bool ARMTargetInfo::validateAsmConstraint(
diff --git a/clang/lib/Basic/Targets/AVR.h b/clang/lib/Basic/Targets/AVR.h
index 0b8a05d87aee1..7730bb8e51322 100644
--- a/clang/lib/Basic/Targets/AVR.h
+++ b/clang/lib/Basic/Targets/AVR.h
@@ -76,7 +76,7 @@ class LLVM_LIBRARY_VISIBILITY AVRTargetInfo : public TargetInfo {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9",
"r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19",
"r20", "r21", "r22", "r23", "r24", "r25", "X", "Y", "Z", "SP"};
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
@@ -90,7 +90,7 @@ class LLVM_LIBRARY_VISIBILITY AVRTargetInfo : public TargetInfo {
{{"r30", "r31"}, 28},
{{"SPL", "SPH"}, 29},
};
- return llvm::makeArrayRef(AddlRegNames);
+ return llvm::ArrayRef(AddlRegNames);
}
bool validateAsmConstraint(const char *&Name,
diff --git a/clang/lib/Basic/Targets/BPF.cpp b/clang/lib/Basic/Targets/BPF.cpp
index 99fed38742402..d1390540ee83d 100644
--- a/clang/lib/Basic/Targets/BPF.cpp
+++ b/clang/lib/Basic/Targets/BPF.cpp
@@ -43,8 +43,8 @@ void BPFTargetInfo::fillValidCPUList(SmallVectorImpl<StringRef> &Values) const {
}
ArrayRef<Builtin::Info> BPFTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::BPF::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo,
+ clang::BPF::LastTSBuiltin - Builtin::FirstTSBuiltin);
}
bool BPFTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
diff --git a/clang/lib/Basic/Targets/CSKY.cpp b/clang/lib/Basic/Targets/CSKY.cpp
index adcffd90ae780..f272bedc170b6 100644
--- a/clang/lib/Basic/Targets/CSKY.cpp
+++ b/clang/lib/Basic/Targets/CSKY.cpp
@@ -213,7 +213,7 @@ ArrayRef<const char *> CSKYTargetInfo::getGCCRegNames() const {
"fr31",
};
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
ArrayRef<TargetInfo::GCCRegAlias> CSKYTargetInfo::getGCCRegAliases() const {
@@ -285,7 +285,7 @@ ArrayRef<TargetInfo::GCCRegAlias> CSKYTargetInfo::getGCCRegAliases() const {
{{"vr31"}, "fr31"},
};
- return llvm::makeArrayRef(GCCRegAliases);
+ return llvm::ArrayRef(GCCRegAliases);
}
bool CSKYTargetInfo::validateAsmConstraint(
diff --git a/clang/lib/Basic/Targets/Hexagon.cpp b/clang/lib/Basic/Targets/Hexagon.cpp
index 8bc3c2b3d0cef..3207ef52147d7 100644
--- a/clang/lib/Basic/Targets/Hexagon.cpp
+++ b/clang/lib/Basic/Targets/Hexagon.cpp
@@ -187,7 +187,7 @@ const char *const HexagonTargetInfo::GCCRegNames[] = {
};
ArrayRef<const char *> HexagonTargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
const TargetInfo::GCCRegAlias HexagonTargetInfo::GCCRegAliases[] = {
@@ -197,7 +197,7 @@ const TargetInfo::GCCRegAlias HexagonTargetInfo::GCCRegAliases[] = {
};
ArrayRef<TargetInfo::GCCRegAlias> HexagonTargetInfo::getGCCRegAliases() const {
- return llvm::makeArrayRef(GCCRegAliases);
+ return llvm::ArrayRef(GCCRegAliases);
}
static constexpr Builtin::Info BuiltinInfo[] = {
@@ -255,6 +255,6 @@ void HexagonTargetInfo::fillValidCPUList(
}
ArrayRef<Builtin::Info> HexagonTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::Hexagon::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo, clang::Hexagon::LastTSBuiltin -
+ Builtin::FirstTSBuiltin);
}
diff --git a/clang/lib/Basic/Targets/Lanai.cpp b/clang/lib/Basic/Targets/Lanai.cpp
index bb1872083c098..8722a369ed87f 100644
--- a/clang/lib/Basic/Targets/Lanai.cpp
+++ b/clang/lib/Basic/Targets/Lanai.cpp
@@ -24,7 +24,7 @@ const char *const LanaiTargetInfo::GCCRegNames[] = {
};
ArrayRef<const char *> LanaiTargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
const TargetInfo::GCCRegAlias LanaiTargetInfo::GCCRegAliases[] = {
@@ -33,7 +33,7 @@ const TargetInfo::GCCRegAlias LanaiTargetInfo::GCCRegAliases[] = {
};
ArrayRef<TargetInfo::GCCRegAlias> LanaiTargetInfo::getGCCRegAliases() const {
- return llvm::makeArrayRef(GCCRegAliases);
+ return llvm::ArrayRef(GCCRegAliases);
}
bool LanaiTargetInfo::isValidCPUName(StringRef Name) const {
diff --git a/clang/lib/Basic/Targets/LoongArch.cpp b/clang/lib/Basic/Targets/LoongArch.cpp
index 4ce2be8c80742..9eab9f143ce17 100644
--- a/clang/lib/Basic/Targets/LoongArch.cpp
+++ b/clang/lib/Basic/Targets/LoongArch.cpp
@@ -32,7 +32,7 @@ ArrayRef<const char *> LoongArchTargetInfo::getGCCRegNames() const {
"$f10", "$f11", "$f12", "$f13", "$f14", "$f15", "$f16", "$f17", "$f18",
"$f19", "$f20", "$f21", "$f22", "$f23", "$f24", "$f25", "$f26", "$f27",
"$f28", "$f29", "$f30", "$f31"};
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
ArrayRef<TargetInfo::GCCRegAlias>
@@ -60,7 +60,7 @@ LoongArchTargetInfo::getGCCRegAliases() const {
{{"$fs2"}, "$f26"}, {{"$fs3"}, "$f27"}, {{"$fs4"}, "$f28"},
{{"$fs5"}, "$f29"}, {{"$fs6"}, "$f30"}, {{"$fs7"}, "$f31"},
};
- return llvm::makeArrayRef(GCCRegAliases);
+ return llvm::ArrayRef(GCCRegAliases);
}
bool LoongArchTargetInfo::validateAsmConstraint(
@@ -198,8 +198,8 @@ bool LoongArchTargetInfo::hasFeature(StringRef Feature) const {
}
ArrayRef<Builtin::Info> LoongArchTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::LoongArch::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo, clang::LoongArch::LastTSBuiltin -
+ Builtin::FirstTSBuiltin);
}
bool LoongArchTargetInfo::handleTargetFeatures(
diff --git a/clang/lib/Basic/Targets/M68k.cpp b/clang/lib/Basic/Targets/M68k.cpp
index e3215b24a3a5a..868437c62cd07 100644
--- a/clang/lib/Basic/Targets/M68k.cpp
+++ b/clang/lib/Basic/Targets/M68k.cpp
@@ -137,7 +137,7 @@ const char *const M68kTargetInfo::GCCRegNames[] = {
"pc"};
ArrayRef<const char *> M68kTargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
ArrayRef<TargetInfo::GCCRegAlias> M68kTargetInfo::getGCCRegAliases() const {
diff --git a/clang/lib/Basic/Targets/MSP430.cpp b/clang/lib/Basic/Targets/MSP430.cpp
index 90890500ae274..de8704fe97e72 100644
--- a/clang/lib/Basic/Targets/MSP430.cpp
+++ b/clang/lib/Basic/Targets/MSP430.cpp
@@ -22,7 +22,7 @@ const char *const MSP430TargetInfo::GCCRegNames[] = {
};
ArrayRef<const char *> MSP430TargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
void MSP430TargetInfo::getTargetDefines(const LangOptions &Opts,
diff --git a/clang/lib/Basic/Targets/MSP430.h b/clang/lib/Basic/Targets/MSP430.h
index 973e039cd02be..3761fc7667b8f 100644
--- a/clang/lib/Basic/Targets/MSP430.h
+++ b/clang/lib/Basic/Targets/MSP430.h
@@ -71,7 +71,7 @@ class LLVM_LIBRARY_VISIBILITY MSP430TargetInfo : public TargetInfo {
{{"r2"}, "sr"},
{{"r3"}, "cg"},
};
- return llvm::makeArrayRef(GCCRegAliases);
+ return llvm::ArrayRef(GCCRegAliases);
}
bool validateAsmConstraint(const char *&Name,
diff --git a/clang/lib/Basic/Targets/Mips.cpp b/clang/lib/Basic/Targets/Mips.cpp
index 1c0fdf0456e97..2fc7572309d59 100644
--- a/clang/lib/Basic/Targets/Mips.cpp
+++ b/clang/lib/Basic/Targets/Mips.cpp
@@ -220,8 +220,8 @@ bool MipsTargetInfo::hasFeature(StringRef Feature) const {
}
ArrayRef<Builtin::Info> MipsTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::Mips::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo,
+ clang::Mips::LastTSBuiltin - Builtin::FirstTSBuiltin);
}
unsigned MipsTargetInfo::getUnwindWordWidth() const {
diff --git a/clang/lib/Basic/Targets/Mips.h b/clang/lib/Basic/Targets/Mips.h
index 627b9f5c7ff7b..9e84dbc386ed0 100644
--- a/clang/lib/Basic/Targets/Mips.h
+++ b/clang/lib/Basic/Targets/Mips.h
@@ -225,7 +225,7 @@ class LLVM_LIBRARY_VISIBILITY MipsTargetInfo : public TargetInfo {
"$msair", "$msacsr", "$msaaccess", "$msasave", "$msamodify",
"$msarequest", "$msamap", "$msaunmap"
};
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
bool validateAsmConstraint(const char *&Name,
@@ -394,8 +394,8 @@ class LLVM_LIBRARY_VISIBILITY MipsTargetInfo : public TargetInfo {
{{"ra"}, "$31"}
};
if (ABI == "o32")
- return llvm::makeArrayRef(O32RegAliases);
- return llvm::makeArrayRef(NewABIRegAliases);
+ return llvm::ArrayRef(O32RegAliases);
+ return llvm::ArrayRef(NewABIRegAliases);
}
bool hasInt128Type() const override {
diff --git a/clang/lib/Basic/Targets/NVPTX.cpp b/clang/lib/Basic/Targets/NVPTX.cpp
index f296196f36ddd..6d06545ab9fd5 100644
--- a/clang/lib/Basic/Targets/NVPTX.cpp
+++ b/clang/lib/Basic/Targets/NVPTX.cpp
@@ -153,7 +153,7 @@ NVPTXTargetInfo::NVPTXTargetInfo(const llvm::Triple &Triple,
}
ArrayRef<const char *> NVPTXTargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
bool NVPTXTargetInfo::hasFeature(StringRef Feature) const {
@@ -263,6 +263,6 @@ void NVPTXTargetInfo::getTargetDefines(const LangOptions &Opts,
}
ArrayRef<Builtin::Info> NVPTXTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::NVPTX::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo,
+ clang::NVPTX::LastTSBuiltin - Builtin::FirstTSBuiltin);
}
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index a4add4d0126ff..7cab4451de584 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -754,7 +754,7 @@ const char *const PPCTargetInfo::GCCRegNames[] = {
};
ArrayRef<const char *> PPCTargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
const TargetInfo::GCCRegAlias PPCTargetInfo::GCCRegAliases[] = {
@@ -785,7 +785,7 @@ const TargetInfo::GCCRegAlias PPCTargetInfo::GCCRegAliases[] = {
};
ArrayRef<TargetInfo::GCCRegAlias> PPCTargetInfo::getGCCRegAliases() const {
- return llvm::makeArrayRef(GCCRegAliases);
+ return llvm::ArrayRef(GCCRegAliases);
}
// PPC ELFABIv2 DWARF Definitoin "Table 2.26. Mappings of Common Registers".
@@ -813,7 +813,7 @@ const TargetInfo::AddlRegName GCCAddlRegNames[] = {
ArrayRef<TargetInfo::AddlRegName> PPCTargetInfo::getGCCAddlRegNames() const {
if (ABI == "elfv2")
- return llvm::makeArrayRef(GCCAddlRegNames);
+ return llvm::ArrayRef(GCCAddlRegNames);
else
return TargetInfo::getGCCAddlRegNames();
}
@@ -854,6 +854,6 @@ void PPCTargetInfo::adjust(DiagnosticsEngine &Diags, LangOptions &Opts) {
}
ArrayRef<Builtin::Info> PPCTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::PPC::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo,
+ clang::PPC::LastTSBuiltin - Builtin::FirstTSBuiltin);
}
diff --git a/clang/lib/Basic/Targets/RISCV.cpp b/clang/lib/Basic/Targets/RISCV.cpp
index 9bda62ca123b5..7713398c83b20 100644
--- a/clang/lib/Basic/Targets/RISCV.cpp
+++ b/clang/lib/Basic/Targets/RISCV.cpp
@@ -41,7 +41,7 @@ ArrayRef<const char *> RISCVTargetInfo::getGCCRegNames() const {
"v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15",
"v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23",
"v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31"};
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
ArrayRef<TargetInfo::GCCRegAlias> RISCVTargetInfo::getGCCRegAliases() const {
@@ -62,7 +62,7 @@ ArrayRef<TargetInfo::GCCRegAlias> RISCVTargetInfo::getGCCRegAliases() const {
{{"fs4"}, "f20"}, {{"fs5"}, "f21"}, {{"fs6"}, "f22"}, {{"fs7"}, "f23"},
{{"fs8"}, "f24"}, {{"fs9"}, "f25"}, {{"fs10"}, "f26"}, {{"fs11"}, "f27"},
{{"ft8"}, "f28"}, {{"ft9"}, "f29"}, {{"ft10"}, "f30"}, {{"ft11"}, "f31"}};
- return llvm::makeArrayRef(GCCRegAliases);
+ return llvm::ArrayRef(GCCRegAliases);
}
bool RISCVTargetInfo::validateAsmConstraint(
@@ -216,8 +216,8 @@ static constexpr Builtin::Info BuiltinInfo[] = {
};
ArrayRef<Builtin::Info> RISCVTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::RISCV::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo,
+ clang::RISCV::LastTSBuiltin - Builtin::FirstTSBuiltin);
}
bool RISCVTargetInfo::initFeatureMap(
diff --git a/clang/lib/Basic/Targets/Sparc.cpp b/clang/lib/Basic/Targets/Sparc.cpp
index 9321024348014..4548902ca12b9 100644
--- a/clang/lib/Basic/Targets/Sparc.cpp
+++ b/clang/lib/Basic/Targets/Sparc.cpp
@@ -33,7 +33,7 @@ const char *const SparcTargetInfo::GCCRegNames[] = {
};
ArrayRef<const char *> SparcTargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
const TargetInfo::GCCRegAlias SparcTargetInfo::GCCRegAliases[] = {
@@ -48,7 +48,7 @@ const TargetInfo::GCCRegAlias SparcTargetInfo::GCCRegAliases[] = {
};
ArrayRef<TargetInfo::GCCRegAlias> SparcTargetInfo::getGCCRegAliases() const {
- return llvm::makeArrayRef(GCCRegAliases);
+ return llvm::ArrayRef(GCCRegAliases);
}
bool SparcTargetInfo::hasFeature(StringRef Feature) const {
diff --git a/clang/lib/Basic/Targets/SystemZ.cpp b/clang/lib/Basic/Targets/SystemZ.cpp
index 311c8baad2dc7..4752d07735118 100644
--- a/clang/lib/Basic/Targets/SystemZ.cpp
+++ b/clang/lib/Basic/Targets/SystemZ.cpp
@@ -46,11 +46,11 @@ const TargetInfo::AddlRegName GCCAddlRegNames[] = {
};
ArrayRef<const char *> SystemZTargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
ArrayRef<TargetInfo::AddlRegName> SystemZTargetInfo::getGCCAddlRegNames() const {
- return llvm::makeArrayRef(GCCAddlRegNames);
+ return llvm::ArrayRef(GCCAddlRegNames);
}
bool SystemZTargetInfo::validateAsmConstraint(
@@ -161,6 +161,6 @@ void SystemZTargetInfo::getTargetDefines(const LangOptions &Opts,
}
ArrayRef<Builtin::Info> SystemZTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::SystemZ::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo, clang::SystemZ::LastTSBuiltin -
+ Builtin::FirstTSBuiltin);
}
diff --git a/clang/lib/Basic/Targets/VE.cpp b/clang/lib/Basic/Targets/VE.cpp
index 667808d95d82f..0e2dd2baea25c 100644
--- a/clang/lib/Basic/Targets/VE.cpp
+++ b/clang/lib/Basic/Targets/VE.cpp
@@ -46,6 +46,6 @@ void VETargetInfo::getTargetDefines(const LangOptions &Opts,
}
ArrayRef<Builtin::Info> VETargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo,
- clang::VE::LastTSBuiltin - Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo,
+ clang::VE::LastTSBuiltin - Builtin::FirstTSBuiltin);
}
diff --git a/clang/lib/Basic/Targets/VE.h b/clang/lib/Basic/Targets/VE.h
index 27ad07a1ace94..d42d3e9199b1f 100644
--- a/clang/lib/Basic/Targets/VE.h
+++ b/clang/lib/Basic/Targets/VE.h
@@ -83,7 +83,7 @@ class LLVM_LIBRARY_VISIBILITY VETargetInfo : public TargetInfo {
"sx48", "sx49", "sx50", "sx51", "sx52", "sx53", "sx54", "sx55",
"sx56", "sx57", "sx58", "sx59", "sx60", "sx61", "sx62", "sx63",
};
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
@@ -153,7 +153,7 @@ class LLVM_LIBRARY_VISIBILITY VETargetInfo : public TargetInfo {
{{"s62"}, "sx62"},
{{"s63"}, "sx63"},
};
- return llvm::makeArrayRef(GCCRegAliases);
+ return llvm::ArrayRef(GCCRegAliases);
}
bool validateAsmConstraint(const char *&Name,
diff --git a/clang/lib/Basic/Targets/WebAssembly.cpp b/clang/lib/Basic/Targets/WebAssembly.cpp
index 36d8d5449fb35..b89140de0e8e6 100644
--- a/clang/lib/Basic/Targets/WebAssembly.cpp
+++ b/clang/lib/Basic/Targets/WebAssembly.cpp
@@ -268,8 +268,8 @@ bool WebAssemblyTargetInfo::handleTargetFeatures(
}
ArrayRef<Builtin::Info> WebAssemblyTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::WebAssembly::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo, clang::WebAssembly::LastTSBuiltin -
+ Builtin::FirstTSBuiltin);
}
void WebAssemblyTargetInfo::adjust(DiagnosticsEngine &Diags,
diff --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp
index 4a3ce3698911b..a6eea30311d3d 100644
--- a/clang/lib/Basic/Targets/X86.cpp
+++ b/clang/lib/Basic/Targets/X86.cpp
@@ -1599,19 +1599,19 @@ void X86TargetInfo::fillValidTuneCPUList(SmallVectorImpl<StringRef> &Values) con
}
ArrayRef<const char *> X86TargetInfo::getGCCRegNames() const {
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
ArrayRef<TargetInfo::AddlRegName> X86TargetInfo::getGCCAddlRegNames() const {
- return llvm::makeArrayRef(AddlRegNames);
+ return llvm::ArrayRef(AddlRegNames);
}
ArrayRef<Builtin::Info> X86_32TargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfoX86, clang::X86::LastX86CommonBuiltin -
- Builtin::FirstTSBuiltin + 1);
+ return llvm::ArrayRef(BuiltinInfoX86, clang::X86::LastX86CommonBuiltin -
+ Builtin::FirstTSBuiltin + 1);
}
ArrayRef<Builtin::Info> X86_64TargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfoX86,
- X86::LastTSBuiltin - Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfoX86,
+ X86::LastTSBuiltin - Builtin::FirstTSBuiltin);
}
diff --git a/clang/lib/Basic/Targets/XCore.cpp b/clang/lib/Basic/Targets/XCore.cpp
index d73116b056a36..e697e1090d682 100644
--- a/clang/lib/Basic/Targets/XCore.cpp
+++ b/clang/lib/Basic/Targets/XCore.cpp
@@ -33,6 +33,6 @@ void XCoreTargetInfo::getTargetDefines(const LangOptions &Opts,
}
ArrayRef<Builtin::Info> XCoreTargetInfo::getTargetBuiltins() const {
- return llvm::makeArrayRef(BuiltinInfo, clang::XCore::LastTSBuiltin -
- Builtin::FirstTSBuiltin);
+ return llvm::ArrayRef(BuiltinInfo,
+ clang::XCore::LastTSBuiltin - Builtin::FirstTSBuiltin);
}
diff --git a/clang/lib/Basic/Targets/XCore.h b/clang/lib/Basic/Targets/XCore.h
index 1cd52161535b1..8eef9de0356ea 100644
--- a/clang/lib/Basic/Targets/XCore.h
+++ b/clang/lib/Basic/Targets/XCore.h
@@ -56,7 +56,7 @@ class LLVM_LIBRARY_VISIBILITY XCoreTargetInfo : public TargetInfo {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "cp", "dp", "sp", "lr"
};
- return llvm::makeArrayRef(GCCRegNames);
+ return llvm::ArrayRef(GCCRegNames);
}
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index fa6128b2a6441..a6994688d44e1 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -4247,7 +4247,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
StringRef WideBytes = Str->getBytes();
std::string StrUtf8;
if (!convertUTF16ToUTF8String(
- makeArrayRef(WideBytes.data(), WideBytes.size()), StrUtf8)) {
+ ArrayRef(WideBytes.data(), WideBytes.size()), StrUtf8)) {
CGM.ErrorUnsupported(E, "non-UTF16 __annotation argument");
continue;
}
@@ -7135,7 +7135,7 @@ Value *CodeGenFunction::EmitCommonNeonBuiltinExpr(
for (unsigned I = 2; I < Ops.size() - 1; ++I)
Ops[I] = Builder.CreateBitCast(Ops[I], Ty);
Ops.push_back(getAlignmentValue32(PtrOp1));
- Ops[1] = Builder.CreateCall(F, makeArrayRef(Ops).slice(1), NameHint);
+ Ops[1] = Builder.CreateCall(F, ArrayRef(Ops).slice(1), NameHint);
Ty = llvm::PointerType::getUnqual(Ops[1]->getType());
Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
@@ -8272,7 +8272,7 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
// Many NEON builtins have identical semantics and uses in ARM and
// AArch64. Emit these in a single function.
- auto IntrinsicMap = makeArrayRef(ARMSIMDIntrinsicMap);
+ auto IntrinsicMap = ArrayRef(ARMSIMDIntrinsicMap);
const ARMVectorIntrinsicInfo *Builtin = findARMVectorIntrinsicInMap(
IntrinsicMap, BuiltinID, NEONSIMDIntrinsicsProvenSorted);
if (Builtin)
@@ -8566,7 +8566,7 @@ Value *CodeGenFunction::EmitARMMVEBuiltinExpr(unsigned BuiltinID,
Ops.push_back(EmitScalarExpr(Addr));
Tys.push_back(ConvertType(Addr->getType()));
- Function *F = CGM.getIntrinsic(IRIntr, makeArrayRef(Tys));
+ Function *F = CGM.getIntrinsic(IRIntr, ArrayRef(Tys));
Value *LoadResult = Builder.CreateCall(F, Ops);
Value *MvecOut = PoisonValue::get(MvecLType);
for (unsigned i = 0; i < NumVectors; ++i) {
@@ -8608,7 +8608,7 @@ Value *CodeGenFunction::EmitARMMVEBuiltinExpr(unsigned BuiltinID,
for (unsigned i = 0; i < NumVectors; i++)
Ops.push_back(Builder.CreateExtractValue(Mvec, {0, i}));
- Function *F = CGM.getIntrinsic(IRIntr, makeArrayRef(Tys));
+ Function *F = CGM.getIntrinsic(IRIntr, ArrayRef(Tys));
Value *ToReturn = nullptr;
for (unsigned i = 0; i < NumVectors; i++) {
Ops.push_back(llvm::ConstantInt::get(Int32Ty, i));
@@ -8690,29 +8690,25 @@ static Value *EmitAArch64TblBuiltinExpr(CodeGenFunction &CGF, unsigned BuiltinID
// argument that specifies the vector type, need to handle each case.
switch (BuiltinID) {
case NEON::BI__builtin_neon_vtbl1_v: {
- return packTBLDVectorList(CGF, makeArrayRef(Ops).slice(0, 1), nullptr,
- Ops[1], Ty, Intrinsic::aarch64_neon_tbl1,
- "vtbl1");
+ return packTBLDVectorList(CGF, ArrayRef(Ops).slice(0, 1), nullptr, Ops[1],
+ Ty, Intrinsic::aarch64_neon_tbl1, "vtbl1");
}
case NEON::BI__builtin_neon_vtbl2_v: {
- return packTBLDVectorList(CGF, makeArrayRef(Ops).slice(0, 2), nullptr,
- Ops[2], Ty, Intrinsic::aarch64_neon_tbl1,
- "vtbl1");
+ return packTBLDVectorList(CGF, ArrayRef(Ops).slice(0, 2), nullptr, Ops[2],
+ Ty, Intrinsic::aarch64_neon_tbl1, "vtbl1");
}
case NEON::BI__builtin_neon_vtbl3_v: {
- return packTBLDVectorList(CGF, makeArrayRef(Ops).slice(0, 3), nullptr,
- Ops[3], Ty, Intrinsic::aarch64_neon_tbl2,
- "vtbl2");
+ return packTBLDVectorList(CGF, ArrayRef(Ops).slice(0, 3), nullptr, Ops[3],
+ Ty, Intrinsic::aarch64_neon_tbl2, "vtbl2");
}
case NEON::BI__builtin_neon_vtbl4_v: {
- return packTBLDVectorList(CGF, makeArrayRef(Ops).slice(0, 4), nullptr,
- Ops[4], Ty, Intrinsic::aarch64_neon_tbl2,
- "vtbl2");
+ return packTBLDVectorList(CGF, ArrayRef(Ops).slice(0, 4), nullptr, Ops[4],
+ Ty, Intrinsic::aarch64_neon_tbl2, "vtbl2");
}
case NEON::BI__builtin_neon_vtbx1_v: {
Value *TblRes =
- packTBLDVectorList(CGF, makeArrayRef(Ops).slice(1, 1), nullptr, Ops[2],
- Ty, Intrinsic::aarch64_neon_tbl1, "vtbl1");
+ packTBLDVectorList(CGF, ArrayRef(Ops).slice(1, 1), nullptr, Ops[2], Ty,
+ Intrinsic::aarch64_neon_tbl1, "vtbl1");
llvm::Constant *EightV = ConstantInt::get(Ty, 8);
Value *CmpRes = Builder.CreateICmp(ICmpInst::ICMP_UGE, Ops[2], EightV);
@@ -8723,14 +8719,13 @@ static Value *EmitAArch64TblBuiltinExpr(CodeGenFunction &CGF, unsigned BuiltinID
return Builder.CreateOr(EltsFromInput, EltsFromTbl, "vtbx");
}
case NEON::BI__builtin_neon_vtbx2_v: {
- return packTBLDVectorList(CGF, makeArrayRef(Ops).slice(1, 2), Ops[0],
- Ops[3], Ty, Intrinsic::aarch64_neon_tbx1,
- "vtbx1");
+ return packTBLDVectorList(CGF, ArrayRef(Ops).slice(1, 2), Ops[0], Ops[3],
+ Ty, Intrinsic::aarch64_neon_tbx1, "vtbx1");
}
case NEON::BI__builtin_neon_vtbx3_v: {
Value *TblRes =
- packTBLDVectorList(CGF, makeArrayRef(Ops).slice(1, 3), nullptr, Ops[4],
- Ty, Intrinsic::aarch64_neon_tbl2, "vtbl2");
+ packTBLDVectorList(CGF, ArrayRef(Ops).slice(1, 3), nullptr, Ops[4], Ty,
+ Intrinsic::aarch64_neon_tbl2, "vtbl2");
llvm::Constant *TwentyFourV = ConstantInt::get(Ty, 24);
Value *CmpRes = Builder.CreateICmp(ICmpInst::ICMP_UGE, Ops[4],
@@ -8742,9 +8737,8 @@ static Value *EmitAArch64TblBuiltinExpr(CodeGenFunction &CGF, unsigned BuiltinID
return Builder.CreateOr(EltsFromInput, EltsFromTbl, "vtbx");
}
case NEON::BI__builtin_neon_vtbx4_v: {
- return packTBLDVectorList(CGF, makeArrayRef(Ops).slice(1, 4), Ops[0],
- Ops[5], Ty, Intrinsic::aarch64_neon_tbx2,
- "vtbx2");
+ return packTBLDVectorList(CGF, ArrayRef(Ops).slice(1, 4), Ops[0], Ops[5],
+ Ty, Intrinsic::aarch64_neon_tbx2, "vtbx2");
}
case NEON::BI__builtin_neon_vqtbl1_v:
case NEON::BI__builtin_neon_vqtbl1q_v:
@@ -10369,7 +10363,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
}
}
- auto SISDMap = makeArrayRef(AArch64SISDIntrinsicMap);
+ auto SISDMap = ArrayRef(AArch64SISDIntrinsicMap);
const ARMVectorIntrinsicInfo *Builtin = findARMVectorIntrinsicInMap(
SISDMap, BuiltinID, AArch64SISDIntrinsicsProvenSorted);
@@ -12045,7 +12039,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
Ops[3] = Builder.CreateZExt(Ops[3], Int64Ty);
- Ops[1] = Builder.CreateCall(F, makeArrayRef(Ops).slice(1), "vld2_lane");
+ Ops[1] = Builder.CreateCall(F, ArrayRef(Ops).slice(1), "vld2_lane");
Ty = llvm::PointerType::getUnqual(Ops[1]->getType());
Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
@@ -12059,7 +12053,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
Ops[3] = Builder.CreateBitCast(Ops[3], Ty);
Ops[4] = Builder.CreateZExt(Ops[4], Int64Ty);
- Ops[1] = Builder.CreateCall(F, makeArrayRef(Ops).slice(1), "vld3_lane");
+ Ops[1] = Builder.CreateCall(F, ArrayRef(Ops).slice(1), "vld3_lane");
Ty = llvm::PointerType::getUnqual(Ops[1]->getType());
Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
@@ -12074,7 +12068,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
Ops[3] = Builder.CreateBitCast(Ops[3], Ty);
Ops[4] = Builder.CreateBitCast(Ops[4], Ty);
Ops[5] = Builder.CreateZExt(Ops[5], Int64Ty);
- Ops[1] = Builder.CreateCall(F, makeArrayRef(Ops).slice(1), "vld4_lane");
+ Ops[1] = Builder.CreateCall(F, ArrayRef(Ops).slice(1), "vld4_lane");
Ty = llvm::PointerType::getUnqual(Ops[1]->getType());
Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
@@ -12374,9 +12368,8 @@ static Value *getMaskVecValue(CodeGenFunction &CGF, Value *Mask,
int Indices[4];
for (unsigned i = 0; i != NumElts; ++i)
Indices[i] = i;
- MaskVec = CGF.Builder.CreateShuffleVector(MaskVec, MaskVec,
- makeArrayRef(Indices, NumElts),
- "extract");
+ MaskVec = CGF.Builder.CreateShuffleVector(
+ MaskVec, MaskVec, ArrayRef(Indices, NumElts), "extract");
}
return MaskVec;
}
@@ -13838,8 +13831,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
for (unsigned i = 0; i != NumElts; ++i)
Indices[i] = i + Index;
- Value *Res = Builder.CreateShuffleVector(Ops[0],
- makeArrayRef(Indices, NumElts),
+ Value *Res = Builder.CreateShuffleVector(Ops[0], ArrayRef(Indices, NumElts),
"extract");
if (Ops.size() == 4)
@@ -13877,9 +13869,8 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
for (unsigned i = 0; i != DstNumElts; ++i)
Indices[i] = (i >= SrcNumElts) ? SrcNumElts + (i % SrcNumElts) : i;
- Value *Op1 = Builder.CreateShuffleVector(Ops[1],
- makeArrayRef(Indices, DstNumElts),
- "widen");
+ Value *Op1 = Builder.CreateShuffleVector(
+ Ops[1], ArrayRef(Indices, DstNumElts), "widen");
for (unsigned i = 0; i != DstNumElts; ++i) {
if (i >= Index && i < (Index + SrcNumElts))
@@ -13889,8 +13880,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
}
return Builder.CreateShuffleVector(Ops[0], Op1,
- makeArrayRef(Indices, DstNumElts),
- "insert");
+ ArrayRef(Indices, DstNumElts), "insert");
}
case X86::BI__builtin_ia32_pmovqd512_mask:
case X86::BI__builtin_ia32_pmovwb512_mask: {
@@ -13940,8 +13930,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
Indices[i] = ((Imm >> (i % 8)) & 0x1) ? NumElts + i : i;
return Builder.CreateShuffleVector(Ops[0], Ops[1],
- makeArrayRef(Indices, NumElts),
- "blend");
+ ArrayRef(Indices, NumElts), "blend");
}
case X86::BI__builtin_ia32_pshuflw:
case X86::BI__builtin_ia32_pshuflw256:
@@ -13963,7 +13952,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
Indices[l + i] = l + i;
}
- return Builder.CreateShuffleVector(Ops[0], makeArrayRef(Indices, NumElts),
+ return Builder.CreateShuffleVector(Ops[0], ArrayRef(Indices, NumElts),
"pshuflw");
}
case X86::BI__builtin_ia32_pshufhw:
@@ -13986,7 +13975,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
}
}
- return Builder.CreateShuffleVector(Ops[0], makeArrayRef(Indices, NumElts),
+ return Builder.CreateShuffleVector(Ops[0], ArrayRef(Indices, NumElts),
"pshufhw");
}
case X86::BI__builtin_ia32_pshufd:
@@ -14015,7 +14004,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
}
}
- return Builder.CreateShuffleVector(Ops[0], makeArrayRef(Indices, NumElts),
+ return Builder.CreateShuffleVector(Ops[0], ArrayRef(Indices, NumElts),
"permil");
}
case X86::BI__builtin_ia32_shufpd:
@@ -14045,8 +14034,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
}
return Builder.CreateShuffleVector(Ops[0], Ops[1],
- makeArrayRef(Indices, NumElts),
- "shufp");
+ ArrayRef(Indices, NumElts), "shufp");
}
case X86::BI__builtin_ia32_permdi256:
case X86::BI__builtin_ia32_permdf256:
@@ -14062,7 +14050,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
for (unsigned i = 0; i != 4; ++i)
Indices[l + i] = l + ((Imm >> (2 * i)) & 0x3);
- return Builder.CreateShuffleVector(Ops[0], makeArrayRef(Indices, NumElts),
+ return Builder.CreateShuffleVector(Ops[0], ArrayRef(Indices, NumElts),
"perm");
}
case X86::BI__builtin_ia32_palignr128:
@@ -14099,8 +14087,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
}
return Builder.CreateShuffleVector(Ops[1], Ops[0],
- makeArrayRef(Indices, NumElts),
- "palignr");
+ ArrayRef(Indices, NumElts), "palignr");
}
case X86::BI__builtin_ia32_alignd128:
case X86::BI__builtin_ia32_alignd256:
@@ -14120,8 +14107,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
Indices[i] = i + ShiftVal;
return Builder.CreateShuffleVector(Ops[1], Ops[0],
- makeArrayRef(Indices, NumElts),
- "valign");
+ ArrayRef(Indices, NumElts), "valign");
}
case X86::BI__builtin_ia32_shuf_f32x4_256:
case X86::BI__builtin_ia32_shuf_f64x2_256:
@@ -14149,8 +14135,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
}
return Builder.CreateShuffleVector(Ops[0], Ops[1],
- makeArrayRef(Indices, NumElts),
- "shuf");
+ ArrayRef(Indices, NumElts), "shuf");
}
case X86::BI__builtin_ia32_vperm2f128_pd256:
@@ -14189,8 +14174,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
}
return Builder.CreateShuffleVector(OutOps[0], OutOps[1],
- makeArrayRef(Indices, NumElts),
- "vperm");
+ ArrayRef(Indices, NumElts), "vperm");
}
case X86::BI__builtin_ia32_pslldqi128_byteshift:
@@ -14218,9 +14202,8 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
auto *VecTy = llvm::FixedVectorType::get(Int8Ty, NumElts);
Value *Cast = Builder.CreateBitCast(Ops[0], VecTy, "cast");
Value *Zero = llvm::Constant::getNullValue(VecTy);
- Value *SV = Builder.CreateShuffleVector(Zero, Cast,
- makeArrayRef(Indices, NumElts),
- "pslldq");
+ Value *SV = Builder.CreateShuffleVector(
+ Zero, Cast, ArrayRef(Indices, NumElts), "pslldq");
return Builder.CreateBitCast(SV, Ops[0]->getType(), "cast");
}
case X86::BI__builtin_ia32_psrldqi128_byteshift:
@@ -14248,9 +14231,8 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
auto *VecTy = llvm::FixedVectorType::get(Int8Ty, NumElts);
Value *Cast = Builder.CreateBitCast(Ops[0], VecTy, "cast");
Value *Zero = llvm::Constant::getNullValue(VecTy);
- Value *SV = Builder.CreateShuffleVector(Cast, Zero,
- makeArrayRef(Indices, NumElts),
- "psrldq");
+ Value *SV = Builder.CreateShuffleVector(
+ Cast, Zero, ArrayRef(Indices, NumElts), "psrldq");
return Builder.CreateBitCast(SV, ResultType, "cast");
}
case X86::BI__builtin_ia32_kshiftliqi:
@@ -14270,9 +14252,8 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
Indices[i] = NumElts + i - ShiftVal;
Value *Zero = llvm::Constant::getNullValue(In->getType());
- Value *SV = Builder.CreateShuffleVector(Zero, In,
- makeArrayRef(Indices, NumElts),
- "kshiftl");
+ Value *SV = Builder.CreateShuffleVector(
+ Zero, In, ArrayRef(Indices, NumElts), "kshiftl");
return Builder.CreateBitCast(SV, Ops[0]->getType());
}
case X86::BI__builtin_ia32_kshiftriqi:
@@ -14292,9 +14273,8 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
Indices[i] = i + ShiftVal;
Value *Zero = llvm::Constant::getNullValue(In->getType());
- Value *SV = Builder.CreateShuffleVector(In, Zero,
- makeArrayRef(Indices, NumElts),
- "kshiftr");
+ Value *SV = Builder.CreateShuffleVector(
+ In, Zero, ArrayRef(Indices, NumElts), "kshiftr");
return Builder.CreateBitCast(SV, Ops[0]->getType());
}
case X86::BI__builtin_ia32_movnti:
@@ -14581,14 +14561,12 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
// First extract half of each vector. This gives better codegen than
// doing it in a single shuffle.
- LHS = Builder.CreateShuffleVector(LHS, LHS,
- makeArrayRef(Indices, NumElts / 2));
- RHS = Builder.CreateShuffleVector(RHS, RHS,
- makeArrayRef(Indices, NumElts / 2));
+ LHS = Builder.CreateShuffleVector(LHS, LHS, ArrayRef(Indices, NumElts / 2));
+ RHS = Builder.CreateShuffleVector(RHS, RHS, ArrayRef(Indices, NumElts / 2));
// Concat the vectors.
// NOTE: Operands are swapped to match the intrinsic definition.
- Value *Res = Builder.CreateShuffleVector(RHS, LHS,
- makeArrayRef(Indices, NumElts));
+ Value *Res =
+ Builder.CreateShuffleVector(RHS, LHS, ArrayRef(Indices, NumElts));
return Builder.CreateBitCast(Res, Ops[0]->getType());
}
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index d863004ab9e1d..7dc105215e7db 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -543,8 +543,8 @@ void ConstantAggregateBuilder::condense(CharUnits Offset,
}
llvm::Constant *Replacement = buildFrom(
- CGM, makeArrayRef(Elems).slice(First, Length),
- makeArrayRef(Offsets).slice(First, Length), Offset, getSize(DesiredTy),
+ CGM, ArrayRef(Elems).slice(First, Length),
+ ArrayRef(Offsets).slice(First, Length), Offset, getSize(DesiredTy),
/*known to have natural layout=*/false, DesiredTy, false);
replace(Elems, First, Last, {Replacement});
replace(Offsets, First, Last, {Offset});
@@ -971,7 +971,7 @@ EmitArrayConstant(CodeGenModule &CGM, llvm::ArrayType *DesiredType,
if (CommonElementType && NonzeroLength >= 8) {
llvm::Constant *Initial = llvm::ConstantArray::get(
llvm::ArrayType::get(CommonElementType, NonzeroLength),
- makeArrayRef(Elements).take_front(NonzeroLength));
+ ArrayRef(Elements).take_front(NonzeroLength));
Elements.resize(2);
Elements[0] = Initial;
} else {
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index d8de8af0be7c3..b4c1966c69620 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -4929,8 +4929,7 @@ Value *ScalarExprEmitter::VisitBlockExpr(const BlockExpr *block) {
static Value *ConvertVec3AndVec4(CGBuilderTy &Builder, CodeGenFunction &CGF,
Value *Src, unsigned NumElementsDst) {
static constexpr int Mask[] = {0, 1, 2, -1};
- return Builder.CreateShuffleVector(Src,
- llvm::makeArrayRef(Mask, NumElementsDst));
+ return Builder.CreateShuffleVector(Src, llvm::ArrayRef(Mask, NumElementsDst));
}
// Create cast instructions for converting LLVM value \p Src to LLVM type \p
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index ea62d5d94869a..c7b193e34ea0a 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -1064,7 +1064,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep {
// Hash. Not currently initialised by the compiler.
Fields.addInt(Int32Ty, 0);
// pointer to the data string.
- auto Arr = llvm::makeArrayRef(&ToBuf[0], ToPtr+1);
+ auto Arr = llvm::ArrayRef(&ToBuf[0], ToPtr + 1);
auto *C = llvm::ConstantDataArray::get(VMContext, Arr);
auto *Buffer = new llvm::GlobalVariable(TheModule, C->getType(),
/*isConstant=*/true, llvm::GlobalValue::PrivateLinkage, C, ".str");
@@ -3851,9 +3851,9 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
llvm::Type *moduleEltTys[] = {
LongTy, LongTy, PtrToInt8Ty, symtab->getType(), IntTy
};
- llvm::StructType *moduleTy =
- llvm::StructType::get(CGM.getLLVMContext(),
- makeArrayRef(moduleEltTys).drop_back(unsigned(RuntimeVersion < 10)));
+ llvm::StructType *moduleTy = llvm::StructType::get(
+ CGM.getLLVMContext(),
+ ArrayRef(moduleEltTys).drop_back(unsigned(RuntimeVersion < 10)));
ConstantInitBuilder builder(CGM);
auto module = builder.beginStruct(moduleTy);
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 3cd0e438e317c..c0893d70340d9 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -8733,7 +8733,7 @@ class MappableExprsHandler {
std::tie(Components, MapType, MapModifiers, IsImplicit, Mapper, VarRef) =
L;
++Count;
- for (const MapData &L1 : makeArrayRef(DeclComponentLists).slice(Count)) {
+ for (const MapData &L1 : ArrayRef(DeclComponentLists).slice(Count)) {
OMPClauseMappableExprCommon::MappableExprComponentListRef Components1;
std::tie(Components1, MapType, MapModifiers, IsImplicit, Mapper,
VarRef) = L1;
@@ -11612,7 +11612,7 @@ void CGOpenMPRuntime::emitDoacrossInit(CodeGenFunction &CGF,
llvm::FunctionCallee FiniRTLFn = OMPBuilder.getOrCreateRuntimeFunction(
CGM.getModule(), OMPRTL___kmpc_doacross_fini);
CGF.EHStack.pushCleanup<DoacrossCleanupTy>(NormalAndEHCleanup, FiniRTLFn,
- llvm::makeArrayRef(FiniArgs));
+ llvm::ArrayRef(FiniArgs));
}
void CGOpenMPRuntime::emitDoacrossOrdered(CodeGenFunction &CGF,
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index cf9b704e0ae6f..081fe5eec767e 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -5327,8 +5327,8 @@ void CodeGenFunction::EmitOMPFlushDirective(const OMPFlushDirective &S) {
*this,
[&S]() -> ArrayRef<const Expr *> {
if (const auto *FlushClause = S.getSingleClause<OMPFlushClause>())
- return llvm::makeArrayRef(FlushClause->varlist_begin(),
- FlushClause->varlist_end());
+ return llvm::ArrayRef(FlushClause->varlist_begin(),
+ FlushClause->varlist_end());
return std::nullopt;
}(),
S.getBeginLoc(), AO);
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index ed79c81074507..f15c6bbc3c156 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -848,8 +848,8 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
auto FuncGroups = CGM.getCodeGenOpts().XRayTotalFunctionGroups;
if (FuncGroups > 1) {
- auto FuncName = llvm::makeArrayRef<uint8_t>(
- CurFn->getName().bytes_begin(), CurFn->getName().bytes_end());
+ auto FuncName = llvm::ArrayRef<uint8_t>(CurFn->getName().bytes_begin(),
+ CurFn->getName().bytes_end());
auto Group = crc32(FuncName) % FuncGroups;
if (Group != CGM.getCodeGenOpts().XRaySelectedFunctionGroup &&
!AlwaysXRayAttr)
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 1239147ca27ff..c8e27b2f975ca 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -5705,7 +5705,7 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) {
// String pointer.
llvm::Constant *C = nullptr;
if (isUTF16) {
- auto Arr = llvm::makeArrayRef(
+ auto Arr = llvm::ArrayRef(
reinterpret_cast<uint16_t *>(const_cast<char *>(Entry.first().data())),
Entry.first().size() / 2);
C = llvm::ConstantDataArray::get(VMContext, Arr);
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index 03531e32f1267..6ee052d6a838f 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -755,7 +755,7 @@ void PGOHash::combine(HashType Type) {
if (Count && Count % NumTypesPerWord == 0) {
using namespace llvm::support;
uint64_t Swapped = endian::byte_swap<uint64_t, little>(Working);
- MD5.update(llvm::makeArrayRef((uint8_t *)&Swapped, sizeof(Swapped)));
+ MD5.update(llvm::ArrayRef((uint8_t *)&Swapped, sizeof(Swapped)));
Working = 0;
}
@@ -781,7 +781,7 @@ uint64_t PGOHash::finalize() {
} else {
using namespace llvm::support;
uint64_t Swapped = endian::byte_swap<uint64_t, little>(Working);
- MD5.update(llvm::makeArrayRef((uint8_t *)&Swapped, sizeof(Swapped)));
+ MD5.update(llvm::ArrayRef((uint8_t *)&Swapped, sizeof(Swapped)));
}
}
@@ -965,11 +965,11 @@ void CodeGenPGO::emitCounterIncrement(CGBuilderTy &Builder, const Stmt *S,
Builder.getInt32(Counter), StepV};
if (!StepV)
Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::instrprof_increment),
- makeArrayRef(Args, 4));
+ ArrayRef(Args, 4));
else
Builder.CreateCall(
CGM.getIntrinsic(llvm::Intrinsic::instrprof_increment_step),
- makeArrayRef(Args));
+ ArrayRef(Args));
}
void CodeGenPGO::setValueProfilingFlag(llvm::Module &M) {
diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp
index 2ed794a058413..abbf71daf1d52 100644
--- a/clang/lib/CodeGen/CodeGenTypes.cpp
+++ b/clang/lib/CodeGen/CodeGenTypes.cpp
@@ -807,8 +807,8 @@ llvm::Type *CodeGenTypes::ConvertType(QualType T) {
ResultType,
llvm::ArrayType::get(CGM.Int8Ty, (atomicSize - valueSize) / 8)
};
- ResultType = llvm::StructType::get(getLLVMContext(),
- llvm::makeArrayRef(elts));
+ ResultType =
+ llvm::StructType::get(getLLVMContext(), llvm::ArrayRef(elts));
}
break;
}
diff --git a/clang/lib/CodeGen/ConstantInitBuilder.cpp b/clang/lib/CodeGen/ConstantInitBuilder.cpp
index 06d3e44f01b1a..18068a18b9204 100644
--- a/clang/lib/CodeGen/ConstantInitBuilder.cpp
+++ b/clang/lib/CodeGen/ConstantInitBuilder.cpp
@@ -268,7 +268,7 @@ llvm::Constant *ConstantAggregateBuilderBase::finishArray(llvm::Type *eltTy) {
assert((Begin < buffer.size() ||
(Begin == buffer.size() && eltTy))
&& "didn't add any array elements without element type");
- auto elts = llvm::makeArrayRef(buffer).slice(Begin);
+ auto elts = llvm::ArrayRef(buffer).slice(Begin);
if (!eltTy) eltTy = elts[0]->getType();
auto type = llvm::ArrayType::get(eltTy, elts.size());
auto constant = llvm::ConstantArray::get(type, elts);
@@ -281,7 +281,7 @@ ConstantAggregateBuilderBase::finishStruct(llvm::StructType *ty) {
markFinished();
auto &buffer = getBuffer();
- auto elts = llvm::makeArrayRef(buffer).slice(Begin);
+ auto elts = llvm::ArrayRef(buffer).slice(Begin);
if (ty == nullptr && elts.empty())
ty = llvm::StructType::get(Builder.CGM.getLLVMContext(), {}, Packed);
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp
index 6e5bc063a665e..14db4f0cbbca2 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -1630,7 +1630,7 @@ void CoverageMappingModuleGen::emitFunctionMappingRecord(
#include "llvm/ProfileData/InstrProfData.inc"
};
auto *FunctionRecordTy =
- llvm::StructType::get(Ctx, makeArrayRef(FunctionRecordTypes),
+ llvm::StructType::get(Ctx, ArrayRef(FunctionRecordTypes),
/*isPacked=*/true);
// Create the function record constant.
@@ -1638,8 +1638,8 @@ void CoverageMappingModuleGen::emitFunctionMappingRecord(
llvm::Constant *FunctionRecordVals[] = {
#include "llvm/ProfileData/InstrProfData.inc"
};
- auto *FuncRecordConstant = llvm::ConstantStruct::get(
- FunctionRecordTy, makeArrayRef(FunctionRecordVals));
+ auto *FuncRecordConstant =
+ llvm::ConstantStruct::get(FunctionRecordTy, ArrayRef(FunctionRecordVals));
// Create the function record global.
auto *FuncRecord = new llvm::GlobalVariable(
@@ -1683,7 +1683,7 @@ void CoverageMappingModuleGen::addFunctionMappingRecord(
auto I = Entry.second;
FilenameStrs[I] = normalizeFilename(Entry.first->getName());
}
- ArrayRef<std::string> FilenameRefs = llvm::makeArrayRef(FilenameStrs);
+ ArrayRef<std::string> FilenameRefs = llvm::ArrayRef(FilenameStrs);
RawCoverageMappingReader Reader(CoverageMapping, FilenameRefs, Filenames,
Expressions, Regions);
if (Reader.read())
@@ -1729,20 +1729,19 @@ void CoverageMappingModuleGen::emit() {
#include "llvm/ProfileData/InstrProfData.inc"
};
auto CovDataHeaderTy =
- llvm::StructType::get(Ctx, makeArrayRef(CovDataHeaderTypes));
+ llvm::StructType::get(Ctx, ArrayRef(CovDataHeaderTypes));
llvm::Constant *CovDataHeaderVals[] = {
#define COVMAP_HEADER(Type, LLVMType, Name, Init) Init,
#include "llvm/ProfileData/InstrProfData.inc"
};
- auto CovDataHeaderVal = llvm::ConstantStruct::get(
- CovDataHeaderTy, makeArrayRef(CovDataHeaderVals));
+ auto CovDataHeaderVal =
+ llvm::ConstantStruct::get(CovDataHeaderTy, ArrayRef(CovDataHeaderVals));
// Create the coverage data record
llvm::Type *CovDataTypes[] = {CovDataHeaderTy, FilenamesVal->getType()};
- auto CovDataTy = llvm::StructType::get(Ctx, makeArrayRef(CovDataTypes));
+ auto CovDataTy = llvm::StructType::get(Ctx, ArrayRef(CovDataTypes));
llvm::Constant *TUDataVals[] = {CovDataHeaderVal, FilenamesVal};
- auto CovDataVal =
- llvm::ConstantStruct::get(CovDataTy, makeArrayRef(TUDataVals));
+ auto CovDataVal = llvm::ConstantStruct::get(CovDataTy, ArrayRef(TUDataVals));
auto CovData = new llvm::GlobalVariable(
CGM.getModule(), CovDataTy, true, llvm::GlobalValue::PrivateLinkage,
CovDataVal, llvm::getCoverageMappingVarName());
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index 016f7ecb45561..81a383cbd35e9 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -4142,7 +4142,7 @@ MicrosoftCXXABI::getAddrOfCXXCtorClosure(const CXXConstructorDecl *CD,
CodeGenFunction::RunCleanupsScope Cleanups(CGF);
const auto *FPT = CD->getType()->castAs<FunctionProtoType>();
- CGF.EmitCallArgs(Args, FPT, llvm::makeArrayRef(ArgVec), CD, IsCopy ? 1 : 0);
+ CGF.EmitCallArgs(Args, FPT, llvm::ArrayRef(ArgVec), CD, IsCopy ? 1 : 0);
// Insert any ABI-specific implicit constructor arguments.
AddedStructorArgCounts ExtraArgs =
@@ -4350,10 +4350,10 @@ llvm::GlobalVariable *MicrosoftCXXABI::getCatchableTypeArray(QualType T) {
llvm::ArrayType *AT = llvm::ArrayType::get(CTType, NumEntries);
llvm::StructType *CTAType = getCatchableTypeArrayType(NumEntries);
llvm::Constant *Fields[] = {
- llvm::ConstantInt::get(CGM.IntTy, NumEntries), // NumEntries
+ llvm::ConstantInt::get(CGM.IntTy, NumEntries), // NumEntries
llvm::ConstantArray::get(
- AT, llvm::makeArrayRef(CatchableTypes.begin(),
- CatchableTypes.end())) // CatchableTypes
+ AT, llvm::ArrayRef(CatchableTypes.begin(),
+ CatchableTypes.end())) // CatchableTypes
};
SmallString<256> MangledName;
{
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index aec170ae55706..b871ea6dd2baf 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -9848,7 +9848,7 @@ class SparcV9ABIInfo : public ABIInfo {
// Check if Ty is a usable substitute for the coercion type.
bool isUsableType(llvm::StructType *Ty) const {
- return llvm::makeArrayRef(Elems) == Ty->elements();
+ return llvm::ArrayRef(Elems) == Ty->elements();
}
// Get the coercion type as a literal struct type.
diff --git a/clang/lib/Driver/Job.cpp b/clang/lib/Driver/Job.cpp
index af596658c5b11..ec355ceb84a9c 100644
--- a/clang/lib/Driver/Job.cpp
+++ b/clang/lib/Driver/Job.cpp
@@ -353,7 +353,7 @@ int Command::Execute(ArrayRef<std::optional<StringRef>> Redirects,
assert(Environment.back() == nullptr &&
"Environment vector should be null-terminated by now");
ArgvVectorStorage = llvm::toStringRefArray(Environment.data());
- Env = makeArrayRef(ArgvVectorStorage);
+ Env = ArrayRef(ArgvVectorStorage);
}
auto Args = llvm::toStringRefArray(Argv.data());
@@ -368,7 +368,7 @@ int Command::Execute(ArrayRef<std::optional<StringRef>> Redirects,
RedirectFilesOptional.push_back(std::nullopt);
return llvm::sys::ExecuteAndWait(Executable, Args, Env,
- makeArrayRef(RedirectFilesOptional),
+ ArrayRef(RedirectFilesOptional),
/*secondsToWait=*/0, /*memoryLimit=*/0,
ErrMsg, ExecutionFailed, &ProcStat);
}
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index ffa45d49b489a..a161355ccbc49 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -1809,7 +1809,7 @@ getDeploymentTargetFromEnvironmentVariables(const Driver &TheDriver,
};
static_assert(std::size(EnvVars) == Darwin::LastDarwinPlatform + 1,
"Missing platform");
- for (const auto &I : llvm::enumerate(llvm::makeArrayRef(EnvVars))) {
+ for (const auto &I : llvm::enumerate(llvm::ArrayRef(EnvVars))) {
if (char *Env = ::getenv(I.value()))
Targets[I.index()] = Env;
}
@@ -1840,7 +1840,7 @@ getDeploymentTargetFromEnvironmentVariables(const Driver &TheDriver,
}
}
- for (const auto &Target : llvm::enumerate(llvm::makeArrayRef(Targets))) {
+ for (const auto &Target : llvm::enumerate(llvm::ArrayRef(Targets))) {
if (!Target.value().empty())
return DarwinPlatform::createDeploymentTargetEnv(
(Darwin::DarwinPlatformKind)Target.index(), EnvVars[Target.index()],
diff --git a/clang/lib/Format/MacroCallReconstructor.cpp b/clang/lib/Format/MacroCallReconstructor.cpp
index 23b223868c2f0..1c295477a922e 100644
--- a/clang/lib/Format/MacroCallReconstructor.cpp
+++ b/clang/lib/Format/MacroCallReconstructor.cpp
@@ -273,7 +273,7 @@ void MacroCallReconstructor::startReconstruction(FormatToken *Token) {
// Note that the token's expanded from stack is inside-to-outside, and the
// expansions for which this token is not the first are the outermost ones.
ArrayRef<FormatToken *> StartedMacros =
- makeArrayRef(Token->MacroCtx->ExpandedFrom)
+ ArrayRef(Token->MacroCtx->ExpandedFrom)
.drop_back(ActiveExpansions.size());
assert(StartedMacros.size() == Token->MacroCtx->StartOfExpansion);
// We reconstruct macro calls outside-to-inside.
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index acea2bf51430a..fcfc18e56a2b4 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -1761,8 +1761,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(
CIOpts.VFS = VFS;
CIOpts.Diags = Diags;
CIOpts.ProbePrecompiled = true; // FIXME: historical default. Needed?
- CI = createInvocation(llvm::makeArrayRef(ArgBegin, ArgEnd),
- std::move(CIOpts));
+ CI = createInvocation(llvm::ArrayRef(ArgBegin, ArgEnd), std::move(CIOpts));
if (!CI)
return nullptr;
}
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index c2fccd643163f..a6f5fdc6eefc8 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -77,8 +77,7 @@ CreateCI(const llvm::opt::ArgStringList &Argv) {
TextDiagnosticBuffer *DiagsBuffer = new TextDiagnosticBuffer;
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagsBuffer);
bool Success = CompilerInvocation::CreateFromArgs(
- Clang->getInvocation(), llvm::makeArrayRef(Argv.begin(), Argv.size()),
- Diags);
+ Clang->getInvocation(), llvm::ArrayRef(Argv.begin(), Argv.size()), Diags);
// Infer the builtin include path if unspecified.
if (Clang->getHeaderSearchOpts().UseBuiltinIncludes &&
@@ -159,7 +158,7 @@ IncrementalCompilerBuilder::create(std::vector<const char *> &ClangArgv) {
driver::Driver Driver(/*MainBinaryName=*/ClangArgv[0],
llvm::sys::getProcessTriple(), Diags);
Driver.setCheckInputsExist(false); // the input comes from mem buffers
- llvm::ArrayRef<const char *> RF = llvm::makeArrayRef(ClangArgv);
+ llvm::ArrayRef<const char *> RF = llvm::ArrayRef(ClangArgv);
std::unique_ptr<driver::Compilation> Compilation(Driver.BuildCompilation(RF));
if (Compilation->getArgs().hasArg(driver::options::OPT_v))
diff --git a/clang/lib/Lex/TokenLexer.cpp b/clang/lib/Lex/TokenLexer.cpp
index 0d141c662b95f..a64a00d8460fc 100644
--- a/clang/lib/Lex/TokenLexer.cpp
+++ b/clang/lib/Lex/TokenLexer.cpp
@@ -204,7 +204,7 @@ void TokenLexer::stringifyVAOPTContents(
assert(CurTokenIdx != 0 &&
"Can not have __VAOPT__ contents begin with a ##");
Token &LHS = VAOPTTokens[CurTokenIdx - 1];
- pasteTokens(LHS, llvm::makeArrayRef(VAOPTTokens, NumVAOptTokens),
+ pasteTokens(LHS, llvm::ArrayRef(VAOPTTokens, NumVAOptTokens),
CurTokenIdx);
// Replace the token prior to the first ## in this iteration.
ConcatenatedVAOPTResultToks.back() = LHS;
@@ -722,7 +722,7 @@ bool TokenLexer::Lex(Token &Tok) {
}
bool TokenLexer::pasteTokens(Token &Tok) {
- return pasteTokens(Tok, llvm::makeArrayRef(Tokens, NumTokens), CurTokenIdx);
+ return pasteTokens(Tok, llvm::ArrayRef(Tokens, NumTokens), CurTokenIdx);
}
/// LHSTok is the LHS of a ## operator, and CurTokenIdx is the ##
diff --git a/clang/lib/Parse/ParsePragma.cpp b/clang/lib/Parse/ParsePragma.cpp
index 705026ea30f78..d157536bc02fa 100644
--- a/clang/lib/Parse/ParsePragma.cpp
+++ b/clang/lib/Parse/ParsePragma.cpp
@@ -3424,7 +3424,7 @@ static bool ParseLoopHintValue(Preprocessor &PP, Token &Tok, Token PragmaName,
ValueList.push_back(EOFTok); // Terminates expression for parsing.
markAsReinjectedForRelexing(ValueList);
- Info.Toks = llvm::makeArrayRef(ValueList).copy(PP.getPreprocessorAllocator());
+ Info.Toks = llvm::ArrayRef(ValueList).copy(PP.getPreprocessorAllocator());
Info.PragmaName = PragmaName;
Info.Option = Option;
@@ -3924,7 +3924,7 @@ void PragmaAttributeHandler::HandlePragma(Preprocessor &PP,
markAsReinjectedForRelexing(AttributeTokens);
Info->Tokens =
- llvm::makeArrayRef(AttributeTokens).copy(PP.getPreprocessorAllocator());
+ llvm::ArrayRef(AttributeTokens).copy(PP.getPreprocessorAllocator());
}
if (Tok.isNot(tok::eod))
diff --git a/clang/lib/Sema/ParsedAttr.cpp b/clang/lib/Sema/ParsedAttr.cpp
index 5560a195b6763..c1e39acb14ec2 100644
--- a/clang/lib/Sema/ParsedAttr.cpp
+++ b/clang/lib/Sema/ParsedAttr.cpp
@@ -146,7 +146,7 @@ const ParsedAttrInfo &ParsedAttrInfo::get(const AttributeCommonInfo &A) {
}
ArrayRef<const ParsedAttrInfo *> ParsedAttrInfo::getAllBuiltin() {
- return llvm::makeArrayRef(AttrInfoMap);
+ return llvm::ArrayRef(AttrInfoMap);
}
unsigned ParsedAttr::getMinArgs() const { return getInfo().NumArgs; }
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index f787d6c2255f5..3b6bfd13e5e40 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -6000,7 +6000,7 @@ bool Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall,
ThisTypeFromDecl);
}
- checkCall(FDecl, Proto, ImplicitThis, llvm::makeArrayRef(Args, NumArgs),
+ checkCall(FDecl, Proto, ImplicitThis, llvm::ArrayRef(Args, NumArgs),
IsMemberFunction, TheCall->getRParenLoc(),
TheCall->getCallee()->getSourceRange(), CallType);
@@ -6081,7 +6081,7 @@ bool Sema::CheckPointerCall(NamedDecl *NDecl, CallExpr *TheCall,
}
checkCall(NDecl, Proto, /*ThisArg=*/nullptr,
- llvm::makeArrayRef(TheCall->getArgs(), TheCall->getNumArgs()),
+ llvm::ArrayRef(TheCall->getArgs(), TheCall->getNumArgs()),
/*IsMemberFunction=*/false, TheCall->getRParenLoc(),
TheCall->getCallee()->getSourceRange(), CallType);
@@ -6094,7 +6094,7 @@ bool Sema::CheckOtherCall(CallExpr *TheCall, const FunctionProtoType *Proto) {
VariadicCallType CallType = getVariadicCallType(/*FDecl=*/nullptr, Proto,
TheCall->getCallee());
checkCall(/*FDecl=*/nullptr, Proto, /*ThisArg=*/nullptr,
- llvm::makeArrayRef(TheCall->getArgs(), TheCall->getNumArgs()),
+ llvm::ArrayRef(TheCall->getArgs(), TheCall->getNumArgs()),
/*IsMemberFunction=*/false, TheCall->getRParenLoc(),
TheCall->getCallee()->getSourceRange(), CallType);
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 3148448c906e2..9a0446e77d1e3 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -10100,7 +10100,7 @@ void Sema::CodeCompleteAvailabilityPlatformName() {
CodeCompletionContext::CCC_Other);
Results.EnterNewScope();
static const char *Platforms[] = {"macOS", "iOS", "watchOS", "tvOS"};
- for (const char *Platform : llvm::makeArrayRef(Platforms)) {
+ for (const char *Platform : llvm::ArrayRef(Platforms)) {
Results.AddResult(CodeCompletionResult(Platform));
Results.AddResult(CodeCompletionResult(Results.getAllocator().CopyString(
Twine(Platform) + "ApplicationExtension")));
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 95797215235b4..b7995dc708486 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -7644,10 +7644,8 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD,
FunctionProtoType::ExtProtoInfo EPI = Type->getExtProtoInfo();
EPI.ExceptionSpec.Type = EST_Unevaluated;
EPI.ExceptionSpec.SourceDecl = MD;
- MD->setType(Context.getFunctionType(ReturnType,
- llvm::makeArrayRef(&ArgType,
- ExpectedParams),
- EPI));
+ MD->setType(Context.getFunctionType(
+ ReturnType, llvm::ArrayRef(&ArgType, ExpectedParams), EPI));
}
}
@@ -10207,10 +10205,12 @@ void Sema::ActOnFinishCXXMemberSpecification(
Diag(AL.getLoc(), diag::warn_attribute_after_definition_ignored) << AL;
}
- ActOnFields(S, RLoc, TagDecl, llvm::makeArrayRef(
- // strict aliasing violation!
- reinterpret_cast<Decl**>(FieldCollector->getCurFields()),
- FieldCollector->getCurNumFields()), LBrac, RBrac, AttrList);
+ ActOnFields(S, RLoc, TagDecl,
+ llvm::ArrayRef(
+ // strict aliasing violation!
+ reinterpret_cast<Decl **>(FieldCollector->getCurFields()),
+ FieldCollector->getCurNumFields()),
+ LBrac, RBrac, AttrList);
CheckCompletedCXXClass(S, cast<CXXRecordDecl>(TagDecl));
}
@@ -15737,19 +15737,16 @@ bool Sema::CompleteConstructorCall(CXXConstructorDecl *Constructor,
VariadicCallType CallType =
Proto->isVariadic() ? VariadicConstructor : VariadicDoesNotApply;
SmallVector<Expr *, 8> AllArgs;
- bool Invalid = GatherArgumentsForCall(Loc, Constructor,
- Proto, 0,
- llvm::makeArrayRef(Args, NumArgs),
- AllArgs,
- CallType, AllowExplicit,
- IsListInitialization);
+ bool Invalid = GatherArgumentsForCall(
+ Loc, Constructor, Proto, 0, llvm::ArrayRef(Args, NumArgs), AllArgs,
+ CallType, AllowExplicit, IsListInitialization);
ConvertedArgs.append(AllArgs.begin(), AllArgs.end());
DiagnoseSentinelCalls(Constructor, Loc, AllArgs);
CheckConstructorCall(Constructor, DeclInitType,
- llvm::makeArrayRef(AllArgs.data(), AllArgs.size()),
- Proto, Loc);
+ llvm::ArrayRef(AllArgs.data(), AllArgs.size()), Proto,
+ Loc);
return Invalid;
}
@@ -18350,27 +18347,27 @@ bool Sema::checkThisInStaticMemberFunctionAttributes(CXXMethodDecl *Method) {
else if (const auto *G = dyn_cast<PtGuardedByAttr>(A))
Arg = G->getArg();
else if (const auto *AA = dyn_cast<AcquiredAfterAttr>(A))
- Args = llvm::makeArrayRef(AA->args_begin(), AA->args_size());
+ Args = llvm::ArrayRef(AA->args_begin(), AA->args_size());
else if (const auto *AB = dyn_cast<AcquiredBeforeAttr>(A))
- Args = llvm::makeArrayRef(AB->args_begin(), AB->args_size());
+ Args = llvm::ArrayRef(AB->args_begin(), AB->args_size());
else if (const auto *ETLF = dyn_cast<ExclusiveTrylockFunctionAttr>(A)) {
Arg = ETLF->getSuccessValue();
- Args = llvm::makeArrayRef(ETLF->args_begin(), ETLF->args_size());
+ Args = llvm::ArrayRef(ETLF->args_begin(), ETLF->args_size());
} else if (const auto *STLF = dyn_cast<SharedTrylockFunctionAttr>(A)) {
Arg = STLF->getSuccessValue();
- Args = llvm::makeArrayRef(STLF->args_begin(), STLF->args_size());
+ Args = llvm::ArrayRef(STLF->args_begin(), STLF->args_size());
} else if (const auto *LR = dyn_cast<LockReturnedAttr>(A))
Arg = LR->getArg();
else if (const auto *LE = dyn_cast<LocksExcludedAttr>(A))
- Args = llvm::makeArrayRef(LE->args_begin(), LE->args_size());
+ Args = llvm::ArrayRef(LE->args_begin(), LE->args_size());
else if (const auto *RC = dyn_cast<RequiresCapabilityAttr>(A))
- Args = llvm::makeArrayRef(RC->args_begin(), RC->args_size());
+ Args = llvm::ArrayRef(RC->args_begin(), RC->args_size());
else if (const auto *AC = dyn_cast<AcquireCapabilityAttr>(A))
- Args = llvm::makeArrayRef(AC->args_begin(), AC->args_size());
+ Args = llvm::ArrayRef(AC->args_begin(), AC->args_size());
else if (const auto *AC = dyn_cast<TryAcquireCapabilityAttr>(A))
- Args = llvm::makeArrayRef(AC->args_begin(), AC->args_size());
+ Args = llvm::ArrayRef(AC->args_begin(), AC->args_size());
else if (const auto *RC = dyn_cast<ReleaseCapabilityAttr>(A))
- Args = llvm::makeArrayRef(RC->args_begin(), RC->args_size());
+ Args = llvm::ArrayRef(RC->args_begin(), RC->args_size());
if (Arg && !Finder.TraverseStmt(Arg))
return true;
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 1fd973bb31fb6..804df3ec34556 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1623,10 +1623,9 @@ Sema::ActOnGenericSelectionExpr(SourceLocation KeyLoc,
Types[i] = nullptr;
}
- ExprResult ER = CreateGenericSelectionExpr(KeyLoc, DefaultLoc, RParenLoc,
- ControllingExpr,
- llvm::makeArrayRef(Types, NumAssocs),
- ArgExprs);
+ ExprResult ER =
+ CreateGenericSelectionExpr(KeyLoc, DefaultLoc, RParenLoc, ControllingExpr,
+ llvm::ArrayRef(Types, NumAssocs), ArgExprs);
delete [] Types;
return ER;
}
@@ -1838,7 +1837,7 @@ static ExprResult BuildCookedLiteralOperatorCall(Sema &S, Scope *Scope,
OpNameInfo.setCXXLiteralOperatorNameLoc(UDSuffixLoc);
LookupResult R(S, OpName, UDSuffixLoc, Sema::LookupOrdinaryName);
- if (S.LookupLiteralOperator(Scope, R, llvm::makeArrayRef(ArgTy, Args.size()),
+ if (S.LookupLiteralOperator(Scope, R, llvm::ArrayRef(ArgTy, Args.size()),
/*AllowRaw*/ false, /*AllowTemplate*/ false,
/*AllowStringTemplatePack*/ false,
/*DiagnoseMissing*/ true) == Sema::LOLR_Error)
@@ -7268,7 +7267,7 @@ ExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
TheCall = dyn_cast<CallExpr>(Result.get());
bool CorrectedTypos = TheCall != TheOldCall;
if (!TheCall) return Result;
- Args = llvm::makeArrayRef(TheCall->getArgs(), TheCall->getNumArgs());
+ Args = llvm::ArrayRef(TheCall->getArgs(), TheCall->getNumArgs());
// A new call expression node was created if some typos were corrected.
// However it may not have been constructed with enough storage. In this
@@ -20224,7 +20223,7 @@ bool Sema::DiagRuntimeBehavior(SourceLocation Loc, ArrayRef<const Stmt*> Stmts,
bool Sema::DiagRuntimeBehavior(SourceLocation Loc, const Stmt *Statement,
const PartialDiagnostic &PD) {
return DiagRuntimeBehavior(
- Loc, Statement ? llvm::makeArrayRef(Statement) : std::nullopt, PD);
+ Loc, Statement ? llvm::ArrayRef(Statement) : std::nullopt, PD);
}
bool Sema::CheckCallReturnType(QualType ReturnType, SourceLocation Loc,
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index f73abdbdd1972..61bd1f8f41e9c 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -3120,7 +3120,7 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name,
for (auto *P : Func->parameters())
FuncParams.push_back(
Context.getCanonicalType(P->getType().getUnqualifiedType()));
- if (llvm::makeArrayRef(FuncParams) == Params) {
+ if (llvm::ArrayRef(FuncParams) == Params) {
// Make the function visible to name lookup, even if we found it in
// an unimported module. It either is an implicitly-declared global
// allocation function, or is suppressing that function.
@@ -3143,7 +3143,7 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name,
BadAllocType = Context.getTypeDeclType(getStdBadAlloc());
assert(StdBadAlloc && "Must have std::bad_alloc declared");
EPI.ExceptionSpec.Type = EST_Dynamic;
- EPI.ExceptionSpec.Exceptions = llvm::makeArrayRef(BadAllocType);
+ EPI.ExceptionSpec.Exceptions = llvm::ArrayRef(BadAllocType);
}
if (getLangOpts().NewInfallible) {
EPI.ExceptionSpec.Type = EST_DynamicNone;
@@ -7337,8 +7337,8 @@ Expr *Sema::MaybeCreateExprWithCleanups(Expr *SubExpr) {
if (!Cleanup.exprNeedsCleanups())
return SubExpr;
- auto Cleanups = llvm::makeArrayRef(ExprCleanupObjects.begin() + FirstCleanup,
- ExprCleanupObjects.size() - FirstCleanup);
+ auto Cleanups = llvm::ArrayRef(ExprCleanupObjects.begin() + FirstCleanup,
+ ExprCleanupObjects.size() - FirstCleanup);
auto *E = ExprWithCleanups::Create(
Context, SubExpr, Cleanup.cleanupsHaveSideEffects(), Cleanups);
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index 848e9c63e1b81..9db813ed37696 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/lib/Sema/SemaExprObjC.cpp
@@ -30,7 +30,7 @@
using namespace clang;
using namespace sema;
-using llvm::makeArrayRef;
+using llvm::ArrayRef;
ExprResult Sema::ParseObjCStringLiteral(SourceLocation *AtLocs,
ArrayRef<Expr *> Strings) {
@@ -1037,12 +1037,9 @@ ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR,
if (ObjCProtocolDecl *NSCopyingPDecl =
LookupProtocol(&Context.Idents.get("NSCopying"), SR.getBegin())) {
ObjCProtocolDecl *PQ[] = {NSCopyingPDecl};
- QIDNSCopying =
- Context.getObjCObjectType(Context.ObjCBuiltinIdTy, { },
- llvm::makeArrayRef(
- (ObjCProtocolDecl**) PQ,
- 1),
- false);
+ QIDNSCopying = Context.getObjCObjectType(
+ Context.ObjCBuiltinIdTy, {},
+ llvm::ArrayRef((ObjCProtocolDecl **)PQ, 1), false);
QIDNSCopying = Context.getObjCObjectPointerType(QIDNSCopying);
}
}
@@ -1907,8 +1904,8 @@ bool Sema::CheckMessageArgumentTypes(
DiagnoseSentinelCalls(Method, SelLoc, Args);
// Do additional checkings on method.
- IsError |= CheckObjCMethodCall(
- Method, SelLoc, makeArrayRef(Args.data(), Args.size()));
+ IsError |=
+ CheckObjCMethodCall(Method, SelLoc, ArrayRef(Args.data(), Args.size()));
return IsError;
}
@@ -2631,10 +2628,10 @@ ExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo,
unsigned NumArgs = ArgsIn.size();
Expr **Args = ArgsIn.data();
assert(SuperLoc.isInvalid() && "Message to super with dependent type");
- return ObjCMessageExpr::Create(
- Context, ReceiverType, VK_PRValue, LBracLoc, ReceiverTypeInfo, Sel,
- SelectorLocs, /*Method=*/nullptr, makeArrayRef(Args, NumArgs), RBracLoc,
- isImplicit);
+ return ObjCMessageExpr::Create(Context, ReceiverType, VK_PRValue, LBracLoc,
+ ReceiverTypeInfo, Sel, SelectorLocs,
+ /*Method=*/nullptr, ArrayRef(Args, NumArgs),
+ RBracLoc, isImplicit);
}
// Find the class to which we are sending this message.
@@ -2733,21 +2730,19 @@ ExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo,
// Construct the appropriate ObjCMessageExpr.
ObjCMessageExpr *Result;
if (SuperLoc.isValid())
- Result = ObjCMessageExpr::Create(Context, ReturnType, VK, LBracLoc,
- SuperLoc, /*IsInstanceSuper=*/false,
- ReceiverType, Sel, SelectorLocs,
- Method, makeArrayRef(Args, NumArgs),
- RBracLoc, isImplicit);
+ Result = ObjCMessageExpr::Create(
+ Context, ReturnType, VK, LBracLoc, SuperLoc, /*IsInstanceSuper=*/false,
+ ReceiverType, Sel, SelectorLocs, Method, ArrayRef(Args, NumArgs),
+ RBracLoc, isImplicit);
else {
- Result = ObjCMessageExpr::Create(Context, ReturnType, VK, LBracLoc,
- ReceiverTypeInfo, Sel, SelectorLocs,
- Method, makeArrayRef(Args, NumArgs),
- RBracLoc, isImplicit);
+ Result = ObjCMessageExpr::Create(
+ Context, ReturnType, VK, LBracLoc, ReceiverTypeInfo, Sel, SelectorLocs,
+ Method, ArrayRef(Args, NumArgs), RBracLoc, isImplicit);
if (!isImplicit)
checkCocoaAPI(*this, Result);
}
if (Method)
- checkFoundationAPI(*this, SelLoc, Method, makeArrayRef(Args, NumArgs),
+ checkFoundationAPI(*this, SelLoc, Method, ArrayRef(Args, NumArgs),
ReceiverType, /*IsClassObjectCall=*/true);
return MaybeBindToTemporary(Result);
}
@@ -2886,8 +2881,8 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver,
assert(SuperLoc.isInvalid() && "Message to super with dependent type");
return ObjCMessageExpr::Create(
Context, Context.DependentTy, VK_PRValue, LBracLoc, Receiver, Sel,
- SelectorLocs, /*Method=*/nullptr, makeArrayRef(Args, NumArgs),
- RBracLoc, isImplicit);
+ SelectorLocs, /*Method=*/nullptr, ArrayRef(Args, NumArgs), RBracLoc,
+ isImplicit);
}
// If necessary, apply function/array conversion to the receiver.
@@ -3324,16 +3319,14 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver,
// Construct the appropriate ObjCMessageExpr instance.
ObjCMessageExpr *Result;
if (SuperLoc.isValid())
- Result = ObjCMessageExpr::Create(Context, ReturnType, VK, LBracLoc,
- SuperLoc, /*IsInstanceSuper=*/true,
- ReceiverType, Sel, SelectorLocs, Method,
- makeArrayRef(Args, NumArgs), RBracLoc,
- isImplicit);
+ Result = ObjCMessageExpr::Create(
+ Context, ReturnType, VK, LBracLoc, SuperLoc, /*IsInstanceSuper=*/true,
+ ReceiverType, Sel, SelectorLocs, Method, ArrayRef(Args, NumArgs),
+ RBracLoc, isImplicit);
else {
- Result = ObjCMessageExpr::Create(Context, ReturnType, VK, LBracLoc,
- Receiver, Sel, SelectorLocs, Method,
- makeArrayRef(Args, NumArgs), RBracLoc,
- isImplicit);
+ Result = ObjCMessageExpr::Create(
+ Context, ReturnType, VK, LBracLoc, Receiver, Sel, SelectorLocs, Method,
+ ArrayRef(Args, NumArgs), RBracLoc, isImplicit);
if (!isImplicit)
checkCocoaAPI(*this, Result);
}
@@ -3354,7 +3347,7 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver,
}
}
}
- checkFoundationAPI(*this, SelLoc, Method, makeArrayRef(Args, NumArgs),
+ checkFoundationAPI(*this, SelLoc, Method, ArrayRef(Args, NumArgs),
ReceiverType, IsClassObjectCall);
}
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index a92c24d577baa..225ff833ece1a 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -7095,11 +7095,11 @@ static void visitLifetimeBoundArguments(IndirectLocalPath &Path, Expr *Call,
if (auto *CE = dyn_cast<CallExpr>(Call)) {
Callee = CE->getDirectCallee();
- Args = llvm::makeArrayRef(CE->getArgs(), CE->getNumArgs());
+ Args = llvm::ArrayRef(CE->getArgs(), CE->getNumArgs());
} else {
auto *CCE = cast<CXXConstructExpr>(Call);
Callee = CCE->getConstructor();
- Args = llvm::makeArrayRef(CCE->getArgs(), CCE->getNumArgs());
+ Args = llvm::ArrayRef(CCE->getArgs(), CCE->getNumArgs());
}
if (!Callee)
return;
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 4ec8a373ed47b..dedcfb530df86 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -3485,27 +3485,27 @@ Sema::SpecialMemberOverloadResult Sema::LookupSpecialMember(CXXRecordDecl *RD,
if (CXXMethodDecl *M = dyn_cast<CXXMethodDecl>(Cand->getUnderlyingDecl())) {
if (SM == CXXCopyAssignment || SM == CXXMoveAssignment)
AddMethodCandidate(M, Cand, RD, ThisTy, Classification,
- llvm::makeArrayRef(&Arg, NumArgs), OCS, true);
+ llvm::ArrayRef(&Arg, NumArgs), OCS, true);
else if (CtorInfo)
AddOverloadCandidate(CtorInfo.Constructor, CtorInfo.FoundDecl,
- llvm::makeArrayRef(&Arg, NumArgs), OCS,
+ llvm::ArrayRef(&Arg, NumArgs), OCS,
/*SuppressUserConversions*/ true);
else
- AddOverloadCandidate(M, Cand, llvm::makeArrayRef(&Arg, NumArgs), OCS,
+ AddOverloadCandidate(M, Cand, llvm::ArrayRef(&Arg, NumArgs), OCS,
/*SuppressUserConversions*/ true);
} else if (FunctionTemplateDecl *Tmpl =
dyn_cast<FunctionTemplateDecl>(Cand->getUnderlyingDecl())) {
if (SM == CXXCopyAssignment || SM == CXXMoveAssignment)
- AddMethodTemplateCandidate(
- Tmpl, Cand, RD, nullptr, ThisTy, Classification,
- llvm::makeArrayRef(&Arg, NumArgs), OCS, true);
+ AddMethodTemplateCandidate(Tmpl, Cand, RD, nullptr, ThisTy,
+ Classification,
+ llvm::ArrayRef(&Arg, NumArgs), OCS, true);
else if (CtorInfo)
- AddTemplateOverloadCandidate(
- CtorInfo.ConstructorTmpl, CtorInfo.FoundDecl, nullptr,
- llvm::makeArrayRef(&Arg, NumArgs), OCS, true);
+ AddTemplateOverloadCandidate(CtorInfo.ConstructorTmpl,
+ CtorInfo.FoundDecl, nullptr,
+ llvm::ArrayRef(&Arg, NumArgs), OCS, true);
else
- AddTemplateOverloadCandidate(
- Tmpl, Cand, nullptr, llvm::makeArrayRef(&Arg, NumArgs), OCS, true);
+ AddTemplateOverloadCandidate(Tmpl, Cand, nullptr,
+ llvm::ArrayRef(&Arg, NumArgs), OCS, true);
} else {
assert(isa<UsingDecl>(Cand.getDecl()) &&
"illegal Kind of operator = Decl");
@@ -4948,9 +4948,9 @@ void TypoCorrectionConsumer::NamespaceSpecifierSet::addNameSpecifier(
if (NNS && !CurNameSpecifierIdentifiers.empty()) {
SmallVector<const IdentifierInfo*, 4> NewNameSpecifierIdentifiers;
getNestedNameSpecifierIdentifiers(NNS, NewNameSpecifierIdentifiers);
- NumSpecifiers = llvm::ComputeEditDistance(
- llvm::makeArrayRef(CurNameSpecifierIdentifiers),
- llvm::makeArrayRef(NewNameSpecifierIdentifiers));
+ NumSpecifiers =
+ llvm::ComputeEditDistance(llvm::ArrayRef(CurNameSpecifierIdentifiers),
+ llvm::ArrayRef(NewNameSpecifierIdentifiers));
}
SpecifierInfo SI = {Ctx, NNS, NumSpecifiers};
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 7e551823a81bf..08c66d3bd0491 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -3613,7 +3613,7 @@ IsUserDefinedConversion(Sema &S, Expr *From, QualType ToType,
if (Info.ConstructorTmpl)
S.AddTemplateOverloadCandidate(
Info.ConstructorTmpl, Info.FoundDecl,
- /*ExplicitArgs*/ nullptr, llvm::makeArrayRef(Args, NumArgs),
+ /*ExplicitArgs*/ nullptr, llvm::ArrayRef(Args, NumArgs),
CandidateSet, SuppressUserConversions,
/*PartialOverloading*/ false,
AllowExplicit == AllowedExplicit::All);
@@ -3621,8 +3621,8 @@ IsUserDefinedConversion(Sema &S, Expr *From, QualType ToType,
// Allow one user-defined conversion when user specifies a
// From->ToType conversion via an static cast (c-style, etc).
S.AddOverloadCandidate(Info.Constructor, Info.FoundDecl,
- llvm::makeArrayRef(Args, NumArgs),
- CandidateSet, SuppressUserConversions,
+ llvm::ArrayRef(Args, NumArgs), CandidateSet,
+ SuppressUserConversions,
/*PartialOverloading*/ false,
AllowExplicit == AllowedExplicit::All);
}
@@ -6845,7 +6845,7 @@ EnableIfAttr *Sema::CheckEnableIf(FunctionDecl *Function,
// very
diff icult. Ideally, we should handle them more gracefully.
if (EIA->getCond()->isValueDependent() ||
!EIA->getCond()->EvaluateWithSubstitution(
- Result, Context, Function, llvm::makeArrayRef(ConvertedArgs)))
+ Result, Context, Function, llvm::ArrayRef(ConvertedArgs)))
return EIA;
if (!Result.isInt() || !Result.getInt().getBoolValue())
@@ -15292,8 +15292,8 @@ ExprResult Sema::BuildLiteralOperatorCall(LookupResult &R,
ResultTy = ResultTy.getNonLValueExprType(Context);
UserDefinedLiteral *UDL = UserDefinedLiteral::Create(
- Context, Fn.get(), llvm::makeArrayRef(ConvArgs, Args.size()), ResultTy,
- VK, LitEndLoc, UDSuffixLoc, CurFPFeatureOverrides());
+ Context, Fn.get(), llvm::ArrayRef(ConvArgs, Args.size()), ResultTy, VK,
+ LitEndLoc, UDSuffixLoc, CurFPFeatureOverrides());
if (CheckCallReturnType(FD->getReturnType(), UDSuffixLoc, UDL, FD))
return ExprError();
diff --git a/clang/lib/Sema/SemaRISCVVectorLookup.cpp b/clang/lib/Sema/SemaRISCVVectorLookup.cpp
index 94335cba9ad8e..8e730648e8be6 100644
--- a/clang/lib/Sema/SemaRISCVVectorLookup.cpp
+++ b/clang/lib/Sema/SemaRISCVVectorLookup.cpp
@@ -66,7 +66,7 @@ static const RVVIntrinsicRecord RVVIntrinsicRecords[] = {
// Get subsequence of signature table.
static ArrayRef<PrototypeDescriptor> ProtoSeq2ArrayRef(uint16_t Index,
uint8_t Length) {
- return makeArrayRef(&RVVSignatureTable[Index], Length);
+ return ArrayRef(&RVVSignatureTable[Index], Length);
}
static QualType RVVType2Qual(ASTContext &Context, const RVVType *Type) {
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 677abfb894d0b..f15603fd0bd4a 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -382,7 +382,7 @@ void Sema::DiagnoseUnusedExprResult(const Stmt *S, unsigned DiagID) {
// type of the left operand could be used for SFINAE, so technically it is
// *used*.
if (DiagID != diag::warn_unused_comma_left_operand || !isSFINAEContext())
- DiagIfReachable(Loc, S ? llvm::makeArrayRef(S) : std::nullopt,
+ DiagIfReachable(Loc, S ? llvm::ArrayRef(S) : std::nullopt,
PDiag(DiagID) << R1 << R2);
}
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 798544b215134..40335c8b507c5 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -1799,8 +1799,7 @@ Sema::ActOnTemplateParameterList(unsigned Depth,
return TemplateParameterList::Create(
Context, TemplateLoc, LAngleLoc,
- llvm::makeArrayRef(Params.data(), Params.size()),
- RAngleLoc, RequiresClause);
+ llvm::ArrayRef(Params.data(), Params.size()), RAngleLoc, RequiresClause);
}
static void SetNestedNameSpecifier(Sema &S, TagDecl *T,
@@ -2079,8 +2078,8 @@ DeclResult Sema::CheckClassTemplate(
SetNestedNameSpecifier(*this, NewClass, SS);
if (NumOuterTemplateParamLists > 0)
NewClass->setTemplateParameterListsInfo(
- Context, llvm::makeArrayRef(OuterTemplateParamLists,
- NumOuterTemplateParamLists));
+ Context,
+ llvm::ArrayRef(OuterTemplateParamLists, NumOuterTemplateParamLists));
// Add alignment attributes if necessary; these attributes are checked when
// the ASTContext lays out the structure.
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index 6d57cd8542d6d..c77b0afdba3d8 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -916,7 +916,7 @@ class PackDeductionScope {
new (S.Context) TemplateArgument[Pack.New.size()];
std::copy(Pack.New.begin(), Pack.New.end(), ArgumentPack);
NewPack = DeducedTemplateArgument(
- TemplateArgument(llvm::makeArrayRef(ArgumentPack, Pack.New.size())),
+ TemplateArgument(llvm::ArrayRef(ArgumentPack, Pack.New.size())),
// FIXME: This is wrong, it's possible that some pack elements are
// deduced from an array bound and others are not:
// template<typename ...T, T ...V> void g(const T (&...p)[V]);
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index effb63326b38a..97571837e6148 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -953,8 +953,7 @@ void Sema::PrintInstantiationStack() {
Diags.Report(Active->PointOfInstantiation,
diag::note_building_builtin_dump_struct_call)
<< convertCallArgsToString(
- *this,
- llvm::makeArrayRef(Active->CallArgs, Active->NumCallArgs));
+ *this, llvm::ArrayRef(Active->CallArgs, Active->NumCallArgs));
break;
case CodeSynthesisContext::Memoization:
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index a645ffe1cf291..7d6f2823a19ff 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -2582,7 +2582,7 @@ Decl *TemplateDeclInstantiator::VisitCXXMethodDecl(
if (NumTempParamLists)
Method->setTemplateParameterListsInfo(
SemaRef.Context,
- llvm::makeArrayRef(TempParamLists.data(), NumTempParamLists));
+ llvm::ArrayRef(TempParamLists.data(), NumTempParamLists));
Method->setLexicalDeclContext(Owner);
Method->setObjectOfFriendDecl();
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 35161474bb640..04d34f3887def 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -1097,11 +1097,10 @@ TypeResult Sema::actOnObjCProtocolQualifierType(
SourceLocation rAngleLoc) {
// Form id<protocol-list>.
QualType Result = Context.getObjCObjectType(
- Context.ObjCBuiltinIdTy, { },
- llvm::makeArrayRef(
- (ObjCProtocolDecl * const *)protocols.data(),
- protocols.size()),
- false);
+ Context.ObjCBuiltinIdTy, {},
+ llvm::ArrayRef((ObjCProtocolDecl *const *)protocols.data(),
+ protocols.size()),
+ false);
Result = Context.getObjCObjectPointerType(Result);
TypeSourceInfo *ResultTInfo = Context.CreateTypeSourceInfo(Result);
@@ -1168,8 +1167,8 @@ TypeResult Sema::actOnObjCTypeArgsAndProtocolQualifiers(
T, BaseTypeInfo->getTypeLoc().getSourceRange().getBegin(),
TypeArgsLAngleLoc, ActualTypeArgInfos, TypeArgsRAngleLoc,
ProtocolLAngleLoc,
- llvm::makeArrayRef((ObjCProtocolDecl *const *)Protocols.data(),
- Protocols.size()),
+ llvm::ArrayRef((ObjCProtocolDecl *const *)Protocols.data(),
+ Protocols.size()),
ProtocolLocs, ProtocolRAngleLoc,
/*FailOnError=*/false,
/*Rebuilding=*/false);
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index debe783e64409..1724ae5c720aa 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -6051,8 +6051,8 @@ QualType TreeTransform<Derived>::TransformFunctionProtoType(
if (auto NewExtParamInfos =
ExtParamInfos.getPointerOrNull(ParamTypes.size())) {
if (!EPI.ExtParameterInfos ||
- llvm::makeArrayRef(EPI.ExtParameterInfos, TL.getNumParams())
- != llvm::makeArrayRef(NewExtParamInfos, ParamTypes.size())) {
+ llvm::ArrayRef(EPI.ExtParameterInfos, TL.getNumParams()) !=
+ llvm::ArrayRef(NewExtParamInfos, ParamTypes.size())) {
EPIChanged = true;
}
EPI.ExtParameterInfos = NewExtParamInfos;
@@ -6063,7 +6063,7 @@ QualType TreeTransform<Derived>::TransformFunctionProtoType(
QualType Result = TL.getType();
if (getDerived().AlwaysRebuild() || ResultType != T->getReturnType() ||
- T->getParamTypes() != llvm::makeArrayRef(ParamTypes) || EPIChanged) {
+ T->getParamTypes() != llvm::ArrayRef(ParamTypes) || EPIChanged) {
Result = getDerived().RebuildFunctionProtoType(ResultType, ParamTypes, EPI);
if (Result.isNull())
return QualType();
@@ -7212,12 +7212,10 @@ TreeTransform<Derived>::TransformObjCTypeParamType(TypeLocBuilder &TLB,
QualType Result = TL.getType();
if (getDerived().AlwaysRebuild() ||
OTP != T->getDecl()) {
- Result = getDerived().RebuildObjCTypeParamType(OTP,
- TL.getProtocolLAngleLoc(),
- llvm::makeArrayRef(TL.getTypePtr()->qual_begin(),
- TL.getNumProtocols()),
- TL.getProtocolLocs(),
- TL.getProtocolRAngleLoc());
+ Result = getDerived().RebuildObjCTypeParamType(
+ OTP, TL.getProtocolLAngleLoc(),
+ llvm::ArrayRef(TL.getTypePtr()->qual_begin(), TL.getNumProtocols()),
+ TL.getProtocolLocs(), TL.getProtocolRAngleLoc());
if (Result.isNull())
return QualType();
}
@@ -7337,7 +7335,7 @@ TreeTransform<Derived>::TransformObjCObjectType(TypeLocBuilder &TLB,
Result = getDerived().RebuildObjCObjectType(
BaseType, TL.getBeginLoc(), TL.getTypeArgsLAngleLoc(), NewTypeArgInfos,
TL.getTypeArgsRAngleLoc(), TL.getProtocolLAngleLoc(),
- llvm::makeArrayRef(TL.getTypePtr()->qual_begin(), TL.getNumProtocols()),
+ llvm::ArrayRef(TL.getTypePtr()->qual_begin(), TL.getNumProtocols()),
TL.getProtocolLocs(), TL.getProtocolRAngleLoc());
if (Result.isNull())
@@ -7900,8 +7898,7 @@ TreeTransform<Derived>::TransformGCCAsmStmt(GCCAsmStmt *S) {
template<typename Derived>
StmtResult
TreeTransform<Derived>::TransformMSAsmStmt(MSAsmStmt *S) {
- ArrayRef<Token> AsmToks =
- llvm::makeArrayRef(S->getAsmToks(), S->getNumAsmToks());
+ ArrayRef<Token> AsmToks = llvm::ArrayRef(S->getAsmToks(), S->getNumAsmToks());
bool HadError = false, HadChange = false;
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 35632d91a90e9..c47a56b075f9b 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -1224,7 +1224,7 @@ bool ASTReader::ReadLexicalDeclContextStorage(ModuleFile &M,
auto &Lex = LexicalDecls[DC];
if (!Lex.first) {
Lex = std::make_pair(
- &M, llvm::makeArrayRef(
+ &M, llvm::ArrayRef(
reinterpret_cast<const llvm::support::unaligned_uint32_t *>(
Blob.data()),
Blob.size() / 4));
@@ -1548,8 +1548,8 @@ bool ASTReader::ReadSLocEntry(int ID) {
if (NumFileDecls && ContextObj) {
const DeclID *FirstDecl = F->FileSortedDecls + Record[6];
assert(F->FileSortedDecls && "FILE_SORTED_DECLS not encountered yet ?");
- FileDeclIDs[FID] = FileDeclsInfo(F, llvm::makeArrayRef(FirstDecl,
- NumFileDecls));
+ FileDeclIDs[FID] =
+ FileDeclsInfo(F, llvm::ArrayRef(FirstDecl, NumFileDecls));
}
const SrcMgr::ContentCache &ContentCache =
@@ -1683,7 +1683,7 @@ Token ASTReader::ReadToken(ModuleFile &F, const RecordDataImpl &Record,
Toks.reserve(NumTokens);
for (unsigned I = 0; I < NumTokens; ++I)
Toks.push_back(ReadToken(F, Record, Idx));
- Info->Toks = llvm::makeArrayRef(Toks).copy(PP.getPreprocessorAllocator());
+ Info->Toks = llvm::ArrayRef(Toks).copy(PP.getPreprocessorAllocator());
Tok.setAnnotationValue(static_cast<void *>(Info));
break;
}
@@ -8035,8 +8035,8 @@ void ASTReader::UpdateSema() {
PragmaAlignPackStack.front().PushLocation);
DropFirst = true;
}
- for (const auto &Entry : llvm::makeArrayRef(PragmaAlignPackStack)
- .drop_front(DropFirst ? 1 : 0)) {
+ for (const auto &Entry :
+ llvm::ArrayRef(PragmaAlignPackStack).drop_front(DropFirst ? 1 : 0)) {
SemaObj->AlignPackStack.Stack.emplace_back(
Entry.SlotLabel, Entry.Value, Entry.Location, Entry.PushLocation);
}
@@ -8067,7 +8067,7 @@ void ASTReader::UpdateSema() {
DropFirst = true;
}
for (const auto &Entry :
- llvm::makeArrayRef(FpPragmaStack).drop_front(DropFirst ? 1 : 0))
+ llvm::ArrayRef(FpPragmaStack).drop_front(DropFirst ? 1 : 0))
SemaObj->FpPragmaStack.Stack.emplace_back(
Entry.SlotLabel, Entry.Value, Entry.Location, Entry.PushLocation);
if (FpPragmaCurrentLocation.isInvalid()) {
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 6299a48708f7d..f00ec3daa5e6f 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -5307,7 +5307,7 @@ void ASTWriter::WriteDeclUpdatesBlocks(RecordDataImpl &OffsetsRecord) {
break;
case UPD_ADDED_ATTR_TO_RECORD:
- Record.AddAttributes(llvm::makeArrayRef(Update.getAttr()));
+ Record.AddAttributes(llvm::ArrayRef(Update.getAttr()));
break;
}
}
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index c117a29723a77..a63d010b17ca4 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -223,7 +223,7 @@ namespace clang {
ArrayRef<DeclID> LazySpecializations;
if (auto *LS = Common->LazySpecializations)
- LazySpecializations = llvm::makeArrayRef(LS + 1, LS[0]);
+ LazySpecializations = llvm::ArrayRef(LS + 1, LS[0]);
// Add a slot to the record for the number of specializations.
unsigned I = Record.size();
@@ -907,7 +907,7 @@ void ASTDeclWriter::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {
Record.push_back(D->NumIvarInitializers);
if (D->NumIvarInitializers)
Record.AddCXXCtorInitializers(
- llvm::makeArrayRef(D->init_begin(), D->init_end()));
+ llvm::ArrayRef(D->init_begin(), D->init_end()));
Code = serialization::DECL_OBJC_IMPLEMENTATION;
}
@@ -2522,8 +2522,7 @@ void ASTRecordWriter::AddFunctionDefinition(const FunctionDecl *FD) {
if (auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
Record->push_back(CD->getNumCtorInitializers());
if (CD->getNumCtorInitializers())
- AddCXXCtorInitializers(
- llvm::makeArrayRef(CD->init_begin(), CD->init_end()));
+ AddCXXCtorInitializers(llvm::ArrayRef(CD->init_begin(), CD->init_end()));
}
AddStmt(FD->getBody());
}
diff --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
index 4b0da86a4f7be..5af355aaacb7b 100644
--- a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
+++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
@@ -372,7 +372,7 @@ static bool forEachDriverJob(
Argv.push_back(Arg.c_str());
const std::unique_ptr<driver::Compilation> Compilation(
- Driver->BuildCompilation(llvm::makeArrayRef(Argv)));
+ Driver->BuildCompilation(llvm::ArrayRef(Argv)));
if (!Compilation)
return false;
diff --git a/clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp b/clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp
index 9c825428f2ea7..e67ffb0370956 100644
--- a/clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp
+++ b/clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp
@@ -116,7 +116,7 @@ int main(int argc, const char **argv) {
"ast-api-dump-tool", OFS);
std::unique_ptr<clang::driver::Compilation> Comp(
- Driver->BuildCompilation(llvm::makeArrayRef(Argv)));
+ Driver->BuildCompilation(llvm::ArrayRef(Argv)));
if (!Comp)
return 1;
diff --git a/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp b/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
index 0322d02817cdf..5e424cc7cd77b 100644
--- a/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
+++ b/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
@@ -147,7 +147,7 @@ struct TransferableCommand {
TmpArgv.push_back(S.c_str());
ClangCLMode = !TmpArgv.empty() &&
driver::IsClangCL(driver::getDriverMode(
- TmpArgv.front(), llvm::makeArrayRef(TmpArgv).slice(1)));
+ TmpArgv.front(), llvm::ArrayRef(TmpArgv).slice(1)));
ArgList = {TmpArgv.begin(), TmpArgv.end()};
}
diff --git a/clang/lib/Tooling/Syntax/BuildTree.cpp b/clang/lib/Tooling/Syntax/BuildTree.cpp
index 041cc4f939d9b..cd02619894950 100644
--- a/clang/lib/Tooling/Syntax/BuildTree.cpp
+++ b/clang/lib/Tooling/Syntax/BuildTree.cpp
@@ -469,7 +469,7 @@ class syntax::TreeBuilder {
assert(Last.isValid());
assert(First == Last ||
TBTM.sourceManager().isBeforeInTranslationUnit(First, Last));
- return llvm::makeArrayRef(findToken(First), std::next(findToken(Last)));
+ return llvm::ArrayRef(findToken(First), std::next(findToken(Last)));
}
ArrayRef<syntax::Token>
@@ -552,7 +552,7 @@ class syntax::TreeBuilder {
assert(Tokens.back().kind() != tok::eof);
// We never consume 'eof', so looking at the next token is ok.
if (Tokens.back().kind() != tok::semi && Tokens.end()->kind() == tok::semi)
- return llvm::makeArrayRef(Tokens.begin(), Tokens.end() + 1);
+ return llvm::ArrayRef(Tokens.begin(), Tokens.end() + 1);
return Tokens;
}
@@ -768,7 +768,7 @@ class BuildTreeVisitor : public RecursiveASTVisitor<BuildTreeVisitor> {
// Build TemplateDeclaration nodes if we had template parameters.
auto ConsumeTemplateParameters = [&](const TemplateParameterList &L) {
const auto *TemplateKW = Builder.findToken(L.getTemplateLoc());
- auto R = llvm::makeArrayRef(TemplateKW, DeclarationRange.end());
+ auto R = llvm::ArrayRef(TemplateKW, DeclarationRange.end());
Result =
foldTemplateDeclaration(R, TemplateKW, DeclarationRange, nullptr);
DeclarationRange = R;
@@ -1639,7 +1639,7 @@ class BuildTreeVisitor : public RecursiveASTVisitor<BuildTreeVisitor> {
auto Return = Builder.getRange(ReturnedType.getSourceRange());
const auto *Arrow = Return.begin() - 1;
assert(Arrow->kind() == tok::arrow);
- auto Tokens = llvm::makeArrayRef(Arrow, Return.end());
+ auto Tokens = llvm::ArrayRef(Arrow, Return.end());
Builder.markChildToken(Arrow, syntax::NodeRole::ArrowToken);
if (ReturnDeclarator)
Builder.markChild(ReturnDeclarator, syntax::NodeRole::Declarator);
diff --git a/clang/lib/Tooling/Syntax/ComputeReplacements.cpp b/clang/lib/Tooling/Syntax/ComputeReplacements.cpp
index 08e09e4ebdbf3..fe9a9df73cb3a 100644
--- a/clang/lib/Tooling/Syntax/ComputeReplacements.cpp
+++ b/clang/lib/Tooling/Syntax/ComputeReplacements.cpp
@@ -31,7 +31,7 @@ void enumerateTokenSpans(const syntax::Tree *Root,
process(Root);
// Report the last span to the user.
if (SpanBegin)
- Callback(llvm::makeArrayRef(SpanBegin, SpanEnd), SpanIsOriginal);
+ Callback(llvm::ArrayRef(SpanBegin, SpanEnd), SpanIsOriginal);
}
private:
@@ -52,7 +52,7 @@ void enumerateTokenSpans(const syntax::Tree *Root,
}
// Report the current span to the user.
if (SpanBegin)
- Callback(llvm::makeArrayRef(SpanBegin, SpanEnd), SpanIsOriginal);
+ Callback(llvm::ArrayRef(SpanBegin, SpanEnd), SpanIsOriginal);
// Start recording a new span.
SpanBegin = STM.getToken(L->getTokenKey());
SpanEnd = SpanBegin + 1;
@@ -118,17 +118,17 @@ syntax::computeReplacements(const TokenBufferTokenManager &TBTM,
// We are looking at a span of original tokens.
if (NextOriginal != Tokens.begin()) {
// There is a gap, record a replacement or deletion.
- emitReplacement(llvm::makeArrayRef(NextOriginal, Tokens.begin()));
+ emitReplacement(llvm::ArrayRef(NextOriginal, Tokens.begin()));
} else {
// No gap, but we may have pending insertions. Emit them now.
- emitReplacement(llvm::makeArrayRef(NextOriginal, /*Length=*/0));
+ emitReplacement(llvm::ArrayRef(NextOriginal, /*Length=*/(size_t)0));
}
NextOriginal = Tokens.end();
});
// We might have pending replacements at the end of file. If so, emit them.
- emitReplacement(llvm::makeArrayRef(
- NextOriginal, Buffer.expandedTokens().drop_back().end()));
+ emitReplacement(
+ llvm::ArrayRef(NextOriginal, Buffer.expandedTokens().drop_back().end()));
return Replacements;
}
diff --git a/clang/lib/Tooling/Syntax/Tokens.cpp b/clang/lib/Tooling/Syntax/Tokens.cpp
index 500d074e9d4ba..d0c82018f82bc 100644
--- a/clang/lib/Tooling/Syntax/Tokens.cpp
+++ b/clang/lib/Tooling/Syntax/Tokens.cpp
@@ -425,8 +425,8 @@ TokenBuffer::expandedForSpelled(llvm::ArrayRef<syntax::Token> Spelled) const {
// Avoid returning empty ranges.
if (ExpandedBegin == ExpandedEnd)
return {};
- return {llvm::makeArrayRef(ExpandedTokens.data() + ExpandedBegin,
- ExpandedTokens.data() + ExpandedEnd)};
+ return {llvm::ArrayRef(ExpandedTokens.data() + ExpandedBegin,
+ ExpandedTokens.data() + ExpandedEnd)};
}
llvm::ArrayRef<syntax::Token> TokenBuffer::spelledTokens(FileID FID) const {
@@ -496,7 +496,7 @@ TokenBuffer::spelledForExpanded(llvm::ArrayRef<syntax::Token> Expanded) const {
return std::nullopt;
if (LastMapping && LastMapping->EndExpanded != LastExpanded)
return std::nullopt;
- return llvm::makeArrayRef(
+ return llvm::ArrayRef(
FirstMapping ? File.SpelledTokens.data() + FirstMapping->BeginSpelled
: FirstSpelled,
LastMapping ? File.SpelledTokens.data() + LastMapping->EndSpelled
@@ -506,10 +506,10 @@ TokenBuffer::spelledForExpanded(llvm::ArrayRef<syntax::Token> Expanded) const {
TokenBuffer::Expansion TokenBuffer::makeExpansion(const MarkedFile &F,
const Mapping &M) const {
Expansion E;
- E.Spelled = llvm::makeArrayRef(F.SpelledTokens.data() + M.BeginSpelled,
- F.SpelledTokens.data() + M.EndSpelled);
- E.Expanded = llvm::makeArrayRef(ExpandedTokens.data() + M.BeginExpanded,
- ExpandedTokens.data() + M.EndExpanded);
+ E.Spelled = llvm::ArrayRef(F.SpelledTokens.data() + M.BeginSpelled,
+ F.SpelledTokens.data() + M.EndSpelled);
+ E.Expanded = llvm::ArrayRef(ExpandedTokens.data() + M.BeginExpanded,
+ ExpandedTokens.data() + M.EndExpanded);
return E;
}
@@ -574,8 +574,8 @@ syntax::spelledTokensTouching(SourceLocation Loc,
bool AcceptRight = Right != Tokens.end() && Right->location() <= Loc;
bool AcceptLeft =
Right != Tokens.begin() && (Right - 1)->endLocation() >= Loc;
- return llvm::makeArrayRef(Right - (AcceptLeft ? 1 : 0),
- Right + (AcceptRight ? 1 : 0));
+ return llvm::ArrayRef(Right - (AcceptLeft ? 1 : 0),
+ Right + (AcceptRight ? 1 : 0));
}
llvm::ArrayRef<syntax::Token>
@@ -982,7 +982,7 @@ std::string TokenBuffer::dumpForTests() const {
OS << "expanded tokens:\n"
<< " ";
// (!) we do not show '<eof>'.
- DumpTokens(OS, llvm::makeArrayRef(ExpandedTokens).drop_back());
+ DumpTokens(OS, llvm::ArrayRef(ExpandedTokens).drop_back());
OS << "\n";
std::vector<FileID> Keys;
diff --git a/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp
index a76046ae79193..8966c12ef7c17 100644
--- a/clang/lib/Tooling/Tooling.cpp
+++ b/clang/lib/Tooling/Tooling.cpp
@@ -364,7 +364,7 @@ bool ToolInvocation::run() {
// We already have a cc1, just create an invocation.
if (CommandLine.size() >= 2 && CommandLine[1] == "-cc1") {
- ArrayRef<const char *> CC1Args = makeArrayRef(Argv).drop_front();
+ ArrayRef<const char *> CC1Args = ArrayRef(Argv).drop_front();
std::unique_ptr<CompilerInvocation> Invocation(
newInvocation(&*Diagnostics, CC1Args, BinaryName));
if (Diagnostics->hasErrorOccurred())
@@ -382,7 +382,7 @@ bool ToolInvocation::run() {
if (!Files->getFileSystemOpts().WorkingDir.empty())
Driver->setCheckInputsExist(false);
const std::unique_ptr<driver::Compilation> Compilation(
- Driver->BuildCompilation(llvm::makeArrayRef(Argv)));
+ Driver->BuildCompilation(llvm::ArrayRef(Argv)));
if (!Compilation)
return false;
const llvm::opt::ArgStringList *const CC1Args = getCC1Arguments(
diff --git a/clang/tools/diagtool/DiagnosticNames.cpp b/clang/tools/diagtool/DiagnosticNames.cpp
index a3f49783c1c41..852b8c226e885 100644
--- a/clang/tools/diagtool/DiagnosticNames.cpp
+++ b/clang/tools/diagtool/DiagnosticNames.cpp
@@ -20,7 +20,7 @@ static const DiagnosticRecord BuiltinDiagnosticsByName[] = {
};
llvm::ArrayRef<DiagnosticRecord> diagtool::getBuiltinDiagnosticsByName() {
- return llvm::makeArrayRef(BuiltinDiagnosticsByName);
+ return llvm::ArrayRef(BuiltinDiagnosticsByName);
}
@@ -103,5 +103,5 @@ GroupRecord::diagnostics() const {
}
llvm::ArrayRef<GroupRecord> diagtool::getDiagnosticGroups() {
- return llvm::makeArrayRef(OptionTable);
+ return llvm::ArrayRef(OptionTable);
}
diff --git a/clang/tools/diagtool/FindDiagnosticID.cpp b/clang/tools/diagtool/FindDiagnosticID.cpp
index eafd20c8c7301..328ebff5ed24d 100644
--- a/clang/tools/diagtool/FindDiagnosticID.cpp
+++ b/clang/tools/diagtool/FindDiagnosticID.cpp
@@ -47,7 +47,7 @@ int FindDiagnosticID::run(unsigned int argc, char **argv,
std::vector<const char *> Args;
Args.push_back("diagtool find-diagnostic-id");
- for (const char *A : llvm::makeArrayRef(argv, argc))
+ for (const char *A : llvm::ArrayRef(argv, argc))
Args.push_back(A);
llvm::cl::HideUnrelatedOptions(FindDiagnosticIDOptions);
diff --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp
index 0d46f5ec8d1fa..a4a9d8e7e7efb 100644
--- a/clang/tools/driver/driver.cpp
+++ b/clang/tools/driver/driver.cpp
@@ -357,12 +357,11 @@ static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV) {
StringRef Tool = ArgV[1];
void *GetExecutablePathVP = (void *)(intptr_t)GetExecutablePath;
if (Tool == "-cc1")
- return cc1_main(makeArrayRef(ArgV).slice(1), ArgV[0], GetExecutablePathVP);
+ return cc1_main(ArrayRef(ArgV).slice(1), ArgV[0], GetExecutablePathVP);
if (Tool == "-cc1as")
- return cc1as_main(makeArrayRef(ArgV).slice(2), ArgV[0],
- GetExecutablePathVP);
+ return cc1as_main(ArrayRef(ArgV).slice(2), ArgV[0], GetExecutablePathVP);
if (Tool == "-cc1gen-reproducer")
- return cc1gen_reproducer_main(makeArrayRef(ArgV).slice(2), ArgV[0],
+ return cc1gen_reproducer_main(ArrayRef(ArgV).slice(2), ArgV[0],
GetExecutablePathVP);
// Reject unknown tools.
llvm::errs() << "error: unknown integrated tool '" << Tool << "'. "
@@ -394,7 +393,7 @@ int clang_main(int Argc, char **Argv) {
// Finally, our -cc1 tools don't care which tokenization mode we use because
// response files written by clang will tokenize the same way in either mode.
bool ClangCLMode =
- IsClangCL(getDriverMode(Args[0], llvm::makeArrayRef(Args).slice(1)));
+ IsClangCL(getDriverMode(Args[0], llvm::ArrayRef(Args).slice(1)));
enum { Default, POSIX, Windows } RSPQuoting = Default;
for (const char *F : Args) {
if (strcmp(F, "--rsp-quoting=posix") == 0)
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 057fa594cc24e..7889873ef36eb 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -3798,7 +3798,7 @@ clang_parseTranslationUnit_Impl(CXIndex CIdx, const char *source_filename,
// Configure the diagnostics.
std::unique_ptr<DiagnosticOptions> DiagOpts = CreateAndPopulateDiagOpts(
- llvm::makeArrayRef(command_line_args, num_command_line_args));
+ llvm::ArrayRef(command_line_args, num_command_line_args));
IntrusiveRefCntPtr<DiagnosticsEngine> Diags(
CompilerInstance::createDiagnostics(DiagOpts.release()));
@@ -3881,7 +3881,7 @@ clang_parseTranslationUnit_Impl(CXIndex CIdx, const char *source_filename,
LibclangInvocationReporter InvocationReporter(
*CXXIdx, LibclangInvocationReporter::OperationKind::ParseOperation,
- options, llvm::makeArrayRef(*Args), /*InvocationArgs=*/std::nullopt,
+ options, llvm::ArrayRef(*Args), /*InvocationArgs=*/std::nullopt,
unsaved_files);
std::unique_ptr<ASTUnit> Unit(ASTUnit::LoadFromCommandLine(
Args->data(), Args->data() + Args->size(),
@@ -3968,7 +3968,7 @@ enum CXErrorCode clang_parseTranslationUnit2FullArgv(
noteBottomOfStack();
result = clang_parseTranslationUnit_Impl(
CIdx, source_filename, command_line_args, num_command_line_args,
- llvm::makeArrayRef(unsaved_files, num_unsaved_files), options, out_TU);
+ llvm::ArrayRef(unsaved_files, num_unsaved_files), options, out_TU);
};
llvm::CrashRecoveryContext CRC;
@@ -4499,7 +4499,7 @@ int clang_reparseTranslationUnit(CXTranslationUnit TU,
CXErrorCode result;
auto ReparseTranslationUnitImpl = [=, &result]() {
result = clang_reparseTranslationUnit_Impl(
- TU, llvm::makeArrayRef(unsaved_files, num_unsaved_files), options);
+ TU, llvm::ArrayRef(unsaved_files, num_unsaved_files), options);
};
llvm::CrashRecoveryContext CRC;
@@ -8387,9 +8387,8 @@ int clang_getCursorPlatformAvailability(CXCursor cursor, int *always_deprecated,
getCursorPlatformAvailabilityForDecl(D, always_deprecated, deprecated_message,
always_unavailable, unavailable_message,
AvailabilityAttrs);
- for (const auto &Avail :
- llvm::enumerate(llvm::makeArrayRef(AvailabilityAttrs)
- .take_front(availability_size))) {
+ for (const auto &Avail : llvm::enumerate(
+ llvm::ArrayRef(AvailabilityAttrs).take_front(availability_size))) {
availability[Avail.index()].Platform =
cxstring::createDup(Avail.value()->getPlatform()->getName());
availability[Avail.index()].Introduced =
diff --git a/clang/tools/libclang/CIndexCodeCompletion.cpp b/clang/tools/libclang/CIndexCodeCompletion.cpp
index 0d75970f2f652..d7df36dc7b85d 100644
--- a/clang/tools/libclang/CIndexCodeCompletion.cpp
+++ b/clang/tools/libclang/CIndexCodeCompletion.cpp
@@ -869,7 +869,7 @@ CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
auto CodeCompleteAtImpl = [=, &result]() {
result = clang_codeCompleteAt_Impl(
TU, complete_filename, complete_line, complete_column,
- llvm::makeArrayRef(unsaved_files, num_unsaved_files), options);
+ llvm::ArrayRef(unsaved_files, num_unsaved_files), options);
};
llvm::CrashRecoveryContext CRC;
diff --git a/clang/tools/libclang/Indexing.cpp b/clang/tools/libclang/Indexing.cpp
index 1be313dfff09c..24ca98d4de416 100644
--- a/clang/tools/libclang/Indexing.cpp
+++ b/clang/tools/libclang/Indexing.cpp
@@ -903,9 +903,8 @@ int clang_indexSourceFileFullArgv(
result = clang_indexSourceFile_Impl(
idxAction, client_data, index_callbacks, index_callbacks_size,
index_options, source_filename, command_line_args,
- num_command_line_args,
- llvm::makeArrayRef(unsaved_files, num_unsaved_files), out_TU,
- TU_options);
+ num_command_line_args, llvm::ArrayRef(unsaved_files, num_unsaved_files),
+ out_TU, TU_options);
};
llvm::CrashRecoveryContext CRC;
diff --git a/clang/unittests/Driver/ToolChainTest.cpp b/clang/unittests/Driver/ToolChainTest.cpp
index f8d38a2d4a7e9..068c583eb89b5 100644
--- a/clang/unittests/Driver/ToolChainTest.cpp
+++ b/clang/unittests/Driver/ToolChainTest.cpp
@@ -370,7 +370,7 @@ TEST(ToolChainTest, PostCallback) {
TEST(GetDriverMode, PrefersLastDriverMode) {
static constexpr const char *Args[] = {"clang-cl", "--driver-mode=foo",
"--driver-mode=bar", "foo.cpp"};
- EXPECT_EQ(getDriverMode(Args[0], llvm::makeArrayRef(Args).slice(1)), "bar");
+ EXPECT_EQ(getDriverMode(Args[0], llvm::ArrayRef(Args).slice(1)), "bar");
}
struct SimpleDiagnosticConsumer : public DiagnosticConsumer {
diff --git a/clang/unittests/Introspection/IntrospectionTest.cpp b/clang/unittests/Introspection/IntrospectionTest.cpp
index 5f5b231b008a3..22321f241f3fc 100644
--- a/clang/unittests/Introspection/IntrospectionTest.cpp
+++ b/clang/unittests/Introspection/IntrospectionTest.cpp
@@ -305,7 +305,7 @@ STRING_LOCATION_STDPAIR(MethodDecl, getTypeSpecStartLoc())
// clang-format off
EXPECT_EQ(
- llvm::makeArrayRef(ExpectedRanges),
+ llvm::ArrayRef(ExpectedRanges),
(ArrayRef<std::pair<std::string, SourceRange>>{
STRING_LOCATION_STDPAIR(MethodDecl, getExceptionSpecSourceRange()),
STRING_LOCATION_STDPAIR(MethodDecl, getNameInfo().getSourceRange()),
@@ -384,7 +384,7 @@ void ns::A::foo() {}
llvm::sort(ExpectedLocations);
EXPECT_EQ(
- llvm::makeArrayRef(ExpectedLocations),
+ llvm::ArrayRef(ExpectedLocations),
(ArrayRef<std::pair<std::string, SourceLocation>>{
STRING_LOCATION_STDPAIR(NNS, getBeginLoc()),
STRING_LOCATION_STDPAIR(NNS, getEndLoc()),
@@ -962,7 +962,7 @@ struct D : Templ<T...> {
// clang-format off
EXPECT_EQ(
- llvm::makeArrayRef(ExpectedLocations),
+ llvm::ArrayRef(ExpectedLocations),
(ArrayRef<std::pair<std::string, SourceLocation>>{
STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getLAngleLoc()),
STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getRAngleLoc()),
@@ -1329,7 +1329,7 @@ int foo();
// clang-format off
EXPECT_EQ(
- llvm::makeArrayRef(ExpectedLocations),
+ llvm::ArrayRef(ExpectedLocations),
(ArrayRef<std::pair<std::string, SourceLocation>>{
STRING_LOCATION_STDPAIR(TL, getAs<clang::FunctionTypeLoc>().getLParenLoc()),
STRING_LOCATION_STDPAIR(TL, getAs<clang::FunctionTypeLoc>().getLocalRangeBegin()),
@@ -1393,7 +1393,7 @@ int* i;
// clang-format off
EXPECT_EQ(
- llvm::makeArrayRef(ExpectedLocations),
+ llvm::ArrayRef(ExpectedLocations),
(ArrayRef<std::pair<std::string, SourceLocation>>{
STRING_LOCATION_STDPAIR(TL, getAs<clang::PointerTypeLoc>().getPointeeLoc().getAs<clang::BuiltinTypeLoc>().getBuiltinLoc()),
STRING_LOCATION_STDPAIR(TL, getAs<clang::PointerTypeLoc>().getPointeeLoc().getAs<clang::BuiltinTypeLoc>().getNameLoc()),
@@ -1505,7 +1505,7 @@ class Foo
// clang-format off
EXPECT_EQ(
- llvm::makeArrayRef(ExpectedLocations),
+ llvm::ArrayRef(ExpectedLocations),
(ArrayRef<std::pair<std::string, SourceLocation>>{
STRING_LOCATION_STDPAIR((&NI), getBeginLoc()),
STRING_LOCATION_STDPAIR((&NI), getEndLoc()),
@@ -1571,20 +1571,19 @@ void foo()
llvm::sort(ExpectedLocations);
EXPECT_EQ(
- llvm::makeArrayRef(ExpectedLocations),
+ llvm::ArrayRef(ExpectedLocations),
(ArrayRef<std::pair<std::string, SourceLocation>>{
- STRING_LOCATION_STDPAIR(Member, getBeginLoc()),
- STRING_LOCATION_STDPAIR(Member, getEndLoc()),
- STRING_LOCATION_STDPAIR(Member, getExprLoc()),
- STRING_LOCATION_STDPAIR(Member, getLAngleLoc()),
- STRING_LOCATION_STDPAIR(Member, getMemberLoc()),
- STRING_LOCATION_STDPAIR(Member, getMemberNameInfo().getBeginLoc()),
- STRING_LOCATION_STDPAIR(Member, getMemberNameInfo().getEndLoc()),
- STRING_LOCATION_STDPAIR(Member, getMemberNameInfo().getLoc()),
- STRING_LOCATION_STDPAIR(Member, getOperatorLoc()),
- STRING_LOCATION_STDPAIR(Member, getRAngleLoc()),
- STRING_LOCATION_STDPAIR(Member, getTemplateKeywordLoc())
- }));
+ STRING_LOCATION_STDPAIR(Member, getBeginLoc()),
+ STRING_LOCATION_STDPAIR(Member, getEndLoc()),
+ STRING_LOCATION_STDPAIR(Member, getExprLoc()),
+ STRING_LOCATION_STDPAIR(Member, getLAngleLoc()),
+ STRING_LOCATION_STDPAIR(Member, getMemberLoc()),
+ STRING_LOCATION_STDPAIR(Member, getMemberNameInfo().getBeginLoc()),
+ STRING_LOCATION_STDPAIR(Member, getMemberNameInfo().getEndLoc()),
+ STRING_LOCATION_STDPAIR(Member, getMemberNameInfo().getLoc()),
+ STRING_LOCATION_STDPAIR(Member, getOperatorLoc()),
+ STRING_LOCATION_STDPAIR(Member, getRAngleLoc()),
+ STRING_LOCATION_STDPAIR(Member, getTemplateKeywordLoc())}));
auto ExpectedRanges = FormatExpected<SourceRange>(Result.RangeAccessors);
@@ -1624,7 +1623,7 @@ class Foo
llvm::sort(ExpectedLocations);
- EXPECT_EQ(llvm::makeArrayRef(ExpectedLocations),
+ EXPECT_EQ(llvm::ArrayRef(ExpectedLocations),
(ArrayRef<std::pair<std::string, SourceLocation>>{
STRING_LOCATION_STDPAIR((&NI), getBeginLoc()),
STRING_LOCATION_STDPAIR((&NI), getEndLoc()),
@@ -1666,7 +1665,7 @@ long double operator"" _identity ( long double val )
llvm::sort(ExpectedLocations);
- EXPECT_EQ(llvm::makeArrayRef(ExpectedLocations),
+ EXPECT_EQ(llvm::ArrayRef(ExpectedLocations),
(ArrayRef<std::pair<std::string, SourceLocation>>{
STRING_LOCATION_STDPAIR((&NI), getBeginLoc()),
STRING_LOCATION_STDPAIR((&NI), getCXXLiteralOperatorNameLoc()),
diff --git a/clang/unittests/Lex/LexerTest.cpp b/clang/unittests/Lex/LexerTest.cpp
index c5982b859289a..44ae368372b19 100644
--- a/clang/unittests/Lex/LexerTest.cpp
+++ b/clang/unittests/Lex/LexerTest.cpp
@@ -650,7 +650,7 @@ TEST_F(LexerTest, RawAndNormalLexSameForLineComments) {
SrcBuffer.data(), SrcBuffer.data(),
SrcBuffer.data() + SrcBuffer.size());
- auto ToksView = llvm::makeArrayRef(Toks);
+ auto ToksView = llvm::ArrayRef(Toks);
clang::Token T;
EXPECT_FALSE(ToksView.empty());
while (!L.LexFromRawLexer(T)) {
diff --git a/clang/unittests/Lex/PPDependencyDirectivesTest.cpp b/clang/unittests/Lex/PPDependencyDirectivesTest.cpp
index b41d9658dca32..542fe73301cf0 100644
--- a/clang/unittests/Lex/PPDependencyDirectivesTest.cpp
+++ b/clang/unittests/Lex/PPDependencyDirectivesTest.cpp
@@ -112,7 +112,7 @@ TEST_F(PPDependencyDirectivesTest, MacroGuard) {
Input, DepDirectivesObjects.back()->Tokens,
DepDirectivesObjects.back()->Directives);
EXPECT_FALSE(Err);
- return llvm::makeArrayRef(DepDirectivesObjects.back()->Directives);
+ return llvm::ArrayRef(DepDirectivesObjects.back()->Directives);
};
auto PPOpts = std::make_shared<PreprocessorOptions>();
diff --git a/clang/unittests/Tooling/Syntax/TokensTest.cpp b/clang/unittests/Tooling/Syntax/TokensTest.cpp
index 1f19994bb29d3..e034250d9e480 100644
--- a/clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ b/clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -191,7 +191,7 @@ class TokenCollectorTest : public ::testing::Test {
llvm::ArrayRef<T> Range, Eq F) {
assert(Subrange.size() >= 1);
if (Range.size() < Subrange.size())
- return llvm::makeArrayRef(Range.end(), Range.end());
+ return llvm::ArrayRef(Range.end(), Range.end());
for (auto Begin = Range.begin(), Last = Range.end() - Subrange.size();
Begin <= Last; ++Begin) {
auto It = Begin;
@@ -200,10 +200,10 @@ class TokenCollectorTest : public ::testing::Test {
if (!F(*ItSub, *It))
goto continue_outer;
}
- return llvm::makeArrayRef(Begin, It);
+ return llvm::ArrayRef(Begin, It);
continue_outer:;
}
- return llvm::makeArrayRef(Range.end(), Range.end());
+ return llvm::ArrayRef(Range.end(), Range.end());
}
/// Finds a subrange in \p Tokens that match the tokens specified in \p Query.
@@ -222,15 +222,14 @@ class TokenCollectorTest : public ::testing::Test {
return Q == T.text(*SourceMgr);
};
// Find a match.
- auto Found =
- findSubrange(llvm::makeArrayRef(QueryTokens), Tokens, TextMatches);
+ auto Found = findSubrange(llvm::ArrayRef(QueryTokens), Tokens, TextMatches);
if (Found.begin() == Tokens.end()) {
ADD_FAILURE() << "could not find the subrange for " << Query;
std::abort();
}
// Check that the match is unique.
- if (findSubrange(llvm::makeArrayRef(QueryTokens),
- llvm::makeArrayRef(Found.end(), Tokens.end()), TextMatches)
+ if (findSubrange(llvm::ArrayRef(QueryTokens),
+ llvm::ArrayRef(Found.end(), Tokens.end()), TextMatches)
.begin() != Tokens.end()) {
ADD_FAILURE() << "match is not unique for " << Query;
std::abort();
@@ -838,10 +837,10 @@ TEST_F(TokenBufferTest, ExpansionsOverlapping) {
Buffer.expansionStartingAt(Foo2.data()),
ValueIs(IsExpansion(SameRange(Foo2.drop_back()),
SameRange(findExpanded("3 + 4 2").drop_back()))));
- EXPECT_THAT(Buffer.expansionsOverlapping(
- llvm::makeArrayRef(Foo1.begin(), Foo2.end())),
- ElementsAre(IsExpansion(SameRange(Foo1.drop_back()), _),
- IsExpansion(SameRange(Foo2.drop_back()), _)));
+ EXPECT_THAT(
+ Buffer.expansionsOverlapping(llvm::ArrayRef(Foo1.begin(), Foo2.end())),
+ ElementsAre(IsExpansion(SameRange(Foo1.drop_back()), _),
+ IsExpansion(SameRange(Foo2.drop_back()), _)));
// Function-like macro expansions.
recordTokens(R"cpp(
@@ -866,7 +865,7 @@ TEST_F(TokenBufferTest, ExpansionsOverlapping) {
for (const auto &T : ID2.drop_front())
EXPECT_EQ(Buffer.expansionStartingAt(&T), std::nullopt);
- EXPECT_THAT(Buffer.expansionsOverlapping(llvm::makeArrayRef(
+ EXPECT_THAT(Buffer.expansionsOverlapping(llvm::ArrayRef(
findSpelled("1 + 2").data(), findSpelled("4").data())),
ElementsAre(IsExpansion(SameRange(ID1), _),
IsExpansion(SameRange(ID2), _)));
diff --git a/clang/unittests/Tooling/Syntax/TreeTestBase.cpp b/clang/unittests/Tooling/Syntax/TreeTestBase.cpp
index 25f9e195ba3bc..4da4d6ce171c4 100644
--- a/clang/unittests/Tooling/Syntax/TreeTestBase.cpp
+++ b/clang/unittests/Tooling/Syntax/TreeTestBase.cpp
@@ -39,10 +39,10 @@ ArrayRef<syntax::Token> tokens(syntax::Node *N,
const TokenBufferTokenManager &STM) {
assert(N->isOriginal() && "tokens of modified nodes are not well-defined");
if (auto *L = dyn_cast<syntax::Leaf>(N))
- return llvm::makeArrayRef(STM.getToken(L->getTokenKey()), 1);
+ return llvm::ArrayRef(STM.getToken(L->getTokenKey()), 1);
auto *T = cast<syntax::Tree>(N);
- return llvm::makeArrayRef(STM.getToken(T->findFirstLeaf()->getTokenKey()),
- STM.getToken(T->findLastLeaf()->getTokenKey()) + 1);
+ return llvm::ArrayRef(STM.getToken(T->findFirstLeaf()->getTokenKey()),
+ STM.getToken(T->findLastLeaf()->getTokenKey()) + 1);
}
} // namespace
diff --git a/clang/unittests/Tooling/ToolingTest.cpp b/clang/unittests/Tooling/ToolingTest.cpp
index a476a9e3b510f..164962766ba50 100644
--- a/clang/unittests/Tooling/ToolingTest.cpp
+++ b/clang/unittests/Tooling/ToolingTest.cpp
@@ -395,7 +395,7 @@ struct CommandLineExtractorTest : public ::testing::Test {
const llvm::opt::ArgStringList *
extractCC1Arguments(llvm::ArrayRef<const char *> Argv) {
const std::unique_ptr<driver::Compilation> Compilation(
- Driver.BuildCompilation(llvm::makeArrayRef(Argv)));
+ Driver.BuildCompilation(llvm::ArrayRef(Argv)));
return getCC1Arguments(Diags.get(), Compilation.get());
}
More information about the cfe-commits
mailing list