From a3c248db87ebe88084386950846678c9a52dd7c0 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Fri, 6 Jan 2023 16:56:23 +0100 Subject: [PATCH] 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 --- clang/include/clang/AST/Decl.h | 2 +- clang/include/clang/AST/DeclCXX.h | 8 +- clang/include/clang/AST/DeclObjC.h | 3 +- clang/include/clang/AST/DeclOpenMP.h | 4 +- clang/include/clang/AST/DeclTemplate.h | 10 +- clang/include/clang/AST/Expr.h | 18 ++- clang/include/clang/AST/ExprCXX.h | 8 +- clang/include/clang/AST/ExprObjC.h | 9 +- clang/include/clang/AST/ExprOpenMP.h | 4 +- clang/include/clang/AST/OpenMPClause.h | 90 +++++++-------- clang/include/clang/AST/PropertiesBase.td | 2 +- clang/include/clang/AST/Stmt.h | 10 +- clang/include/clang/AST/StmtOpenMP.h | 7 +- clang/include/clang/AST/TemplateBase.h | 8 +- clang/include/clang/AST/TemplateName.h | 2 +- clang/include/clang/AST/Type.h | 9 +- clang/include/clang/AST/TypeLoc.h | 6 +- .../clang/Analysis/Analyses/ThreadSafetyTIL.h | 4 +- clang/include/clang/Basic/Diagnostic.h | 8 +- clang/include/clang/Basic/SyncScope.h | 4 +- clang/include/clang/CodeGen/CGFunctionInfo.h | 4 +- clang/include/clang/Lex/MacroInfo.h | 4 +- clang/include/clang/Parse/Parser.h | 2 +- clang/include/clang/Sema/DeclSpec.h | 4 +- clang/include/clang/Sema/DelayedDiagnostic.h | 4 +- clang/include/clang/Sema/Sema.h | 10 +- .../include/clang/Serialization/ASTRecordReader.h | 2 +- .../Tooling/Refactoring/Rename/SymbolOccurrences.h | 2 +- .../clang/Tooling/Transformer/RewriteRule.h | 4 +- clang/lib/AST/APValue.cpp | 4 +- clang/lib/AST/ASTContext.cpp | 2 +- clang/lib/AST/ASTDiagnostic.cpp | 2 +- clang/lib/AST/ASTImporter.cpp | 30 ++--- clang/lib/AST/CommentParser.cpp | 27 ++--- clang/lib/AST/CommentSema.cpp | 6 +- clang/lib/AST/ComputeDependence.cpp | 6 +- clang/lib/AST/Decl.cpp | 4 +- clang/lib/AST/DeclCXX.cpp | 2 +- clang/lib/AST/DeclTemplate.cpp | 6 +- clang/lib/AST/ExprCXX.cpp | 2 +- clang/lib/AST/ExprConstant.cpp | 10 +- clang/lib/AST/OpenMPClause.cpp | 2 +- clang/lib/AST/ParentMapContext.cpp | 4 +- clang/lib/AST/TemplateName.cpp | 2 +- clang/lib/AST/Type.cpp | 18 +-- clang/lib/ASTMatchers/Dynamic/Marshallers.cpp | 12 +- clang/lib/Analysis/CFG.cpp | 4 +- clang/lib/Analysis/CalledOnceCheck.cpp | 8 +- .../Analysis/FlowSensitive/DataflowEnvironment.cpp | 4 +- clang/lib/Basic/Module.cpp | 2 +- clang/lib/Basic/Targets/AArch64.cpp | 8 +- clang/lib/Basic/Targets/AMDGPU.cpp | 6 +- clang/lib/Basic/Targets/ARC.h | 2 +- clang/lib/Basic/Targets/ARM.cpp | 8 +- clang/lib/Basic/Targets/AVR.h | 4 +- clang/lib/Basic/Targets/BPF.cpp | 4 +- clang/lib/Basic/Targets/CSKY.cpp | 4 +- clang/lib/Basic/Targets/Hexagon.cpp | 8 +- clang/lib/Basic/Targets/Lanai.cpp | 4 +- clang/lib/Basic/Targets/LoongArch.cpp | 8 +- clang/lib/Basic/Targets/M68k.cpp | 2 +- clang/lib/Basic/Targets/MSP430.cpp | 2 +- clang/lib/Basic/Targets/MSP430.h | 2 +- clang/lib/Basic/Targets/Mips.cpp | 4 +- clang/lib/Basic/Targets/Mips.h | 6 +- clang/lib/Basic/Targets/NVPTX.cpp | 6 +- clang/lib/Basic/Targets/PPC.cpp | 10 +- clang/lib/Basic/Targets/RISCV.cpp | 8 +- clang/lib/Basic/Targets/Sparc.cpp | 4 +- clang/lib/Basic/Targets/SystemZ.cpp | 8 +- clang/lib/Basic/Targets/VE.cpp | 4 +- clang/lib/Basic/Targets/VE.h | 4 +- clang/lib/Basic/Targets/WebAssembly.cpp | 4 +- clang/lib/Basic/Targets/X86.cpp | 12 +- clang/lib/Basic/Targets/XCore.cpp | 4 +- clang/lib/Basic/Targets/XCore.h | 2 +- clang/lib/CodeGen/CGBuiltin.cpp | 128 +++++++++------------ clang/lib/CodeGen/CGExprConstant.cpp | 6 +- clang/lib/CodeGen/CGExprScalar.cpp | 3 +- clang/lib/CodeGen/CGObjCGNU.cpp | 8 +- clang/lib/CodeGen/CGOpenMPRuntime.cpp | 4 +- clang/lib/CodeGen/CGStmtOpenMP.cpp | 4 +- clang/lib/CodeGen/CodeGenFunction.cpp | 4 +- clang/lib/CodeGen/CodeGenModule.cpp | 2 +- clang/lib/CodeGen/CodeGenPGO.cpp | 8 +- clang/lib/CodeGen/CodeGenTypes.cpp | 4 +- clang/lib/CodeGen/ConstantInitBuilder.cpp | 4 +- clang/lib/CodeGen/CoverageMappingGen.cpp | 19 ++- clang/lib/CodeGen/MicrosoftCXXABI.cpp | 8 +- clang/lib/CodeGen/TargetInfo.cpp | 2 +- clang/lib/Driver/Job.cpp | 4 +- clang/lib/Driver/ToolChains/Darwin.cpp | 4 +- clang/lib/Format/MacroCallReconstructor.cpp | 2 +- clang/lib/Frontend/ASTUnit.cpp | 3 +- clang/lib/Interpreter/Interpreter.cpp | 5 +- clang/lib/Lex/TokenLexer.cpp | 4 +- clang/lib/Parse/ParsePragma.cpp | 4 +- clang/lib/Sema/ParsedAttr.cpp | 2 +- clang/lib/Sema/SemaChecking.cpp | 6 +- clang/lib/Sema/SemaCodeComplete.cpp | 2 +- clang/lib/Sema/SemaDeclCXX.cpp | 47 ++++---- clang/lib/Sema/SemaExpr.cpp | 13 +-- clang/lib/Sema/SemaExprCXX.cpp | 8 +- clang/lib/Sema/SemaExprObjC.cpp | 63 +++++----- clang/lib/Sema/SemaInit.cpp | 4 +- clang/lib/Sema/SemaLookup.cpp | 28 ++--- clang/lib/Sema/SemaOverload.cpp | 12 +- clang/lib/Sema/SemaRISCVVectorLookup.cpp | 2 +- clang/lib/Sema/SemaStmt.cpp | 2 +- clang/lib/Sema/SemaTemplate.cpp | 7 +- clang/lib/Sema/SemaTemplateDeduction.cpp | 2 +- clang/lib/Sema/SemaTemplateInstantiate.cpp | 3 +- clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 2 +- clang/lib/Sema/SemaType.cpp | 13 +-- clang/lib/Sema/TreeTransform.h | 21 ++-- clang/lib/Serialization/ASTReader.cpp | 14 +-- clang/lib/Serialization/ASTWriter.cpp | 2 +- clang/lib/Serialization/ASTWriterDecl.cpp | 7 +- .../DependencyScanningWorker.cpp | 2 +- clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp | 2 +- .../Tooling/InterpolatingCompilationDatabase.cpp | 2 +- clang/lib/Tooling/Syntax/BuildTree.cpp | 8 +- clang/lib/Tooling/Syntax/ComputeReplacements.cpp | 12 +- clang/lib/Tooling/Syntax/Tokens.cpp | 20 ++-- clang/lib/Tooling/Tooling.cpp | 4 +- clang/tools/diagtool/DiagnosticNames.cpp | 4 +- clang/tools/diagtool/FindDiagnosticID.cpp | 2 +- clang/tools/driver/driver.cpp | 9 +- clang/tools/libclang/CIndex.cpp | 13 +-- clang/tools/libclang/CIndexCodeCompletion.cpp | 2 +- clang/tools/libclang/Indexing.cpp | 5 +- clang/unittests/Driver/ToolChainTest.cpp | 2 +- .../unittests/Introspection/IntrospectionTest.cpp | 41 ++++--- clang/unittests/Lex/LexerTest.cpp | 2 +- clang/unittests/Lex/PPDependencyDirectivesTest.cpp | 2 +- clang/unittests/Tooling/Syntax/TokensTest.cpp | 23 ++-- clang/unittests/Tooling/Syntax/TreeTestBase.cpp | 6 +- clang/unittests/Tooling/ToolingTest.cpp | 2 +- 138 files changed, 563 insertions(+), 637 deletions(-) diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h index f84ff30..3ae2703 100644 --- a/clang/include/clang/AST/Decl.h +++ b/clang/include/clang/AST/Decl.h @@ -3205,7 +3205,7 @@ public: using chain_iterator = ArrayRef::const_iterator; ArrayRef 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 3836a2f..11276c7 100644 --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -357,11 +357,11 @@ private: } ArrayRef bases() const { - return llvm::makeArrayRef(getBases(), NumBases); + return llvm::ArrayRef(getBases(), NumBases); } ArrayRef vbases() const { - return llvm::makeArrayRef(getVBases(), NumVBases); + return llvm::ArrayRef(getVBases(), NumVBases); } private: @@ -3739,7 +3739,7 @@ public: /// Get the set of using declarations that this pack expanded into. Note that /// some of these may still be unresolved. ArrayRef expansions() const { - return llvm::makeArrayRef(getTrailingObjects(), NumExpansions); + return llvm::ArrayRef(getTrailingObjects(), NumExpansions); } static UsingPackDecl *Create(ASTContext &C, DeclContext *DC, @@ -4109,7 +4109,7 @@ public: unsigned NumBindings); ArrayRef bindings() const { - return llvm::makeArrayRef(getTrailingObjects(), NumBindings); + return llvm::ArrayRef(getTrailingObjects(), 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 3ba59a2..7c72ec9 100644 --- a/clang/include/clang/AST/DeclObjC.h +++ b/clang/include/clang/AST/DeclObjC.h @@ -373,8 +373,7 @@ public: // ArrayRef access to formal parameters. This should eventually // replace the iterator interface above. ArrayRef parameters() const { - return llvm::makeArrayRef(const_cast(getParams()), - NumParams); + return llvm::ArrayRef(const_cast(getParams()), NumParams); } ParmVarDecl *getParamDecl(unsigned Idx) { diff --git a/clang/include/clang/AST/DeclOpenMP.h b/clang/include/clang/AST/DeclOpenMP.h index fc52e5d..30b5a92 100644 --- a/clang/include/clang/AST/DeclOpenMP.h +++ b/clang/include/clang/AST/DeclOpenMP.h @@ -118,7 +118,7 @@ class OMPThreadPrivateDecl final : public OMPDeclarativeDirective { ArrayRef getVars() const { auto **Storage = reinterpret_cast(Data->getChildren().data()); - return llvm::makeArrayRef(Storage, Data->getNumChildren()); + return llvm::ArrayRef(Storage, Data->getNumChildren()); } MutableArrayRef getVars() { @@ -481,7 +481,7 @@ class OMPAllocateDecl final : public OMPDeclarativeDirective { ArrayRef getVars() const { auto **Storage = reinterpret_cast(Data->getChildren().data()); - return llvm::makeArrayRef(Storage, Data->getNumChildren()); + return llvm::ArrayRef(Storage, Data->getNumChildren()); } MutableArrayRef getVars() { diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h index d654fce..b7032d00 100644 --- a/clang/include/clang/AST/DeclTemplate.h +++ b/clang/include/clang/AST/DeclTemplate.h @@ -129,11 +129,9 @@ public: unsigned size() const { return NumParams; } - ArrayRef asArray() { - return llvm::makeArrayRef(begin(), end()); - } + ArrayRef asArray() { return llvm::ArrayRef(begin(), end()); } ArrayRef asArray() const { - return llvm::makeArrayRef(begin(), size()); + return llvm::ArrayRef(begin(), size()); } NamedDecl* getParam(unsigned Idx) { @@ -289,7 +287,7 @@ public: /// Produce this as an array ref. ArrayRef asArray() const { - return llvm::makeArrayRef(data(), size()); + return llvm::ArrayRef(data(), size()); } /// Retrieve the number of template arguments in this @@ -741,7 +739,7 @@ public: unsigned getNumTemplateArgs() const { return NumArgs; } llvm::ArrayRef 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 bdc1bbd..ed76cfa 100644 --- a/clang/include/clang/AST/Expr.h +++ b/clang/include/clang/AST/Expr.h @@ -3020,7 +3020,7 @@ public: /// Compute and set dependence bits. void computeDependence() { setDependence(clang::computeDependence( - this, llvm::makeArrayRef( + this, llvm::ArrayRef( reinterpret_cast(getTrailingStmts() + PREARGS_START), getNumPreArgs()))); } @@ -3067,8 +3067,8 @@ public: /// interface. This provides efficient reverse iteration of the /// subexpressions. This is currently used for CFG construction. ArrayRef 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 @@ public: return reinterpret_cast(InitExprs.data()); } - ArrayRef inits() { - return llvm::makeArrayRef(getInits(), getNumInits()); - } + ArrayRef inits() { return llvm::ArrayRef(getInits(), getNumInits()); } ArrayRef inits() const { - return llvm::makeArrayRef(getInits(), getNumInits()); + return llvm::ArrayRef(getInits(), getNumInits()); } const Expr *getInit(unsigned Init) const { @@ -5581,9 +5579,7 @@ public: return reinterpret_cast(getTrailingObjects()); } - ArrayRef exprs() { - return llvm::makeArrayRef(getExprs(), getNumExprs()); - } + ArrayRef exprs() { return llvm::ArrayRef(getExprs(), getNumExprs()); } SourceLocation getLParenLoc() const { return LParenLoc; } SourceLocation getRParenLoc() const { return RParenLoc; } @@ -6434,7 +6430,7 @@ public: ArrayRef subExpressions() { auto *B = getTrailingObjects(); - return llvm::makeArrayRef(B, B + NumExprs); + return llvm::ArrayRef(B, B + NumExprs); } ArrayRef subExpressions() const { diff --git a/clang/include/clang/AST/ExprCXX.h b/clang/include/clang/AST/ExprCXX.h index a0bdf50..ad2a5cb 100644 --- a/clang/include/clang/AST/ExprCXX.h +++ b/clang/include/clang/AST/ExprCXX.h @@ -2796,8 +2796,7 @@ public: /// Retrieve the argument types. ArrayRef getArgs() const { - return llvm::makeArrayRef(getTrailingObjects(), - getNumArgs()); + return llvm::ArrayRef(getTrailingObjects(), getNumArgs()); } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } @@ -3443,8 +3442,7 @@ public: ArrayRef objects); ArrayRef getObjects() const { - return llvm::makeArrayRef(getTrailingObjects(), - getNumObjects()); + return llvm::ArrayRef(getTrailingObjects(), getNumObjects()); } unsigned getNumObjects() const { return ExprWithCleanupsBits.NumObjects; } @@ -4295,7 +4293,7 @@ public: ArrayRef getPartialArguments() const { assert(isPartiallySubstituted()); const auto *Args = getTrailingObjects(); - 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 24b2cad..0c0629c 100644 --- a/clang/include/clang/AST/ExprObjC.h +++ b/clang/include/clang/AST/ExprObjC.h @@ -1415,11 +1415,10 @@ public: 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(getArgs()), - getNumArgs()), - RBracLoc); + return getStandardSelectorLoc( + Index, getSelector(), getSelLocsKind() == SelLoc_StandardWithSpace, + llvm::ArrayRef(const_cast(getArgs()), getNumArgs()), + RBracLoc); return getStoredSelLocs()[Index]; } diff --git a/clang/include/clang/AST/ExprOpenMP.h b/clang/include/clang/AST/ExprOpenMP.h index be5dda9..be5b1f3 100644 --- a/clang/include/clang/AST/ExprOpenMP.h +++ b/clang/include/clang/AST/ExprOpenMP.h @@ -202,12 +202,12 @@ public: /// Fetches the dimensions for array shaping expression. ArrayRef getDimensions() const { - return llvm::makeArrayRef(getTrailingObjects(), NumDims); + return llvm::ArrayRef(getTrailingObjects(), NumDims); } /// Fetches source ranges for the brackets os the array shaping expression. ArrayRef getBracketsRanges() const { - return llvm::makeArrayRef(getTrailingObjects(), NumDims); + return llvm::ArrayRef(getTrailingObjects(), 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 1446b41..f37da2d 100644 --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -336,7 +336,7 @@ public: /// Fetches list of all variables in the clause. ArrayRef getVarRefs() const { - return llvm::makeArrayRef( + return llvm::ArrayRef( static_cast(this)->template getTrailingObjects(), NumVars); } @@ -2557,7 +2557,7 @@ class OMPPrivateClause final return MutableArrayRef(varlist_end(), varlist_size()); } ArrayRef 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(varlist_end(), varlist_size()); } ArrayRef 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(getPrivateCopies().end(), varlist_size()); } ArrayRef 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(varlist_end(), varlist_size()); } ArrayRef 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(getPrivateCopies().end(), varlist_size()); } ArrayRef 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(getSourceExprs().end(), varlist_size()); } ArrayRef 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(getDestinationExprs().end(), varlist_size()); } ArrayRef 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(varlist_end(), varlist_size()); } ArrayRef 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(getPrivates().end(), varlist_size()); } ArrayRef 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(getLHSExprs().end(), varlist_size()); } ArrayRef 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(getRHSExprs().end(), varlist_size()); } ArrayRef 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(getReductionOps().end(), varlist_size()); } ArrayRef 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(getInscanCopyOps().end(), varlist_size()); } ArrayRef 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 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(varlist_end(), varlist_size()); } ArrayRef 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(getPrivates().end(), varlist_size()); } ArrayRef 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(getLHSExprs().end(), varlist_size()); } ArrayRef 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(getRHSExprs().end(), varlist_size()); } ArrayRef 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(varlist_end(), varlist_size()); } ArrayRef 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(getPrivates().end(), varlist_size()); } ArrayRef 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(getLHSExprs().end(), varlist_size()); } ArrayRef 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(getRHSExprs().end(), varlist_size()); } ArrayRef 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(getReductionOps().end(), varlist_size()); } ArrayRef 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(varlist_end(), varlist_size()); } ArrayRef getPrivates() const { - return llvm::makeArrayRef(varlist_end(), varlist_size()); + return llvm::ArrayRef(varlist_end(), varlist_size()); } MutableArrayRef getInits() { return MutableArrayRef(getPrivates().end(), varlist_size()); } ArrayRef 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(getInits().end(), varlist_size()); } ArrayRef 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(getUpdates().end(), varlist_size()); } ArrayRef 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(getFinals().end() + 2, varlist_size() + 1); } ArrayRef 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(varlist_end(), varlist_size()); } ArrayRef 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(getSourceExprs().end(), varlist_size()); } ArrayRef 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(getDestinationExprs().end(), varlist_size()); } ArrayRef 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(varlist_end(), varlist_size()); } ArrayRef 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(getSourceExprs().end(), varlist_size()); } ArrayRef 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(getDestinationExprs().end(), varlist_size()); } ArrayRef getAssignmentOps() const { - return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size()); + return llvm::ArrayRef(getDestinationExprs().end(), varlist_size()); } public: @@ -5436,7 +5436,7 @@ protected: ArrayRef getUDMapperRefs() const { assert(SupportsMapper && "Must be a clause that is possible to have user-defined mappers"); - return llvm::makeArrayRef( + return llvm::ArrayRef( static_cast(this)->template getTrailingObjects() + OMPVarListClause::varlist_size(), OMPVarListClause::varlist_size()); @@ -5934,12 +5934,12 @@ public: /// Fetches ArrayRef of map-type-modifiers. ArrayRef getMapTypeModifiers() const LLVM_READONLY { - return llvm::makeArrayRef(MapTypeModifiers); + return llvm::ArrayRef(MapTypeModifiers); } /// Fetches ArrayRef of location of map-type-modifiers. ArrayRef getMapTypeModifiersLoc() const LLVM_READONLY { - return llvm::makeArrayRef(MapTypeModifiersLoc); + return llvm::ArrayRef(MapTypeModifiersLoc); } /// Fetches location of clause mapping kind. @@ -6890,12 +6890,12 @@ public: /// Fetches ArrayRef of motion-modifiers. ArrayRef getMotionModifiers() const LLVM_READONLY { - return llvm::makeArrayRef(MotionModifiers); + return llvm::ArrayRef(MotionModifiers); } /// Fetches ArrayRef of location of motion-modifiers. ArrayRef getMotionModifiersLoc() const LLVM_READONLY { - return llvm::makeArrayRef(MotionModifiersLoc); + return llvm::ArrayRef(MotionModifiersLoc); } /// Get colon location. @@ -7090,12 +7090,12 @@ public: /// Fetches ArrayRef of motion-modifiers. ArrayRef getMotionModifiers() const LLVM_READONLY { - return llvm::makeArrayRef(MotionModifiers); + return llvm::ArrayRef(MotionModifiers); } /// Fetches ArrayRef of location of motion-modifiers. ArrayRef getMotionModifiersLoc() const LLVM_READONLY { - return llvm::makeArrayRef(MotionModifiersLoc); + return llvm::ArrayRef(MotionModifiersLoc); } /// Get colon location. @@ -7190,7 +7190,7 @@ class OMPUseDevicePtrClause final return MutableArrayRef(varlist_end(), varlist_size()); } ArrayRef 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(getPrivateCopies().end(), varlist_size()); } ArrayRef 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(varlist_end(), varlist_size()); } ArrayRef 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 6c7f692..ff0fb01 100644 --- a/clang/include/clang/AST/PropertiesBase.td +++ b/clang/include/clang/AST/PropertiesBase.td @@ -827,6 +827,6 @@ let Class = PropertyTypeCase 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 8781c70..e4a6ec9 100644 --- a/clang/include/clang/AST/Stmt.h +++ b/clang/include/clang/AST/Stmt.h @@ -1923,7 +1923,7 @@ public: SourceLocation getAttrLoc() const { return AttributedStmtBits.AttrLoc; } ArrayRef getAttrs() const { - return llvm::makeArrayRef(getAttrArrayPtr(), AttributedStmtBits.NumAttrs); + return llvm::ArrayRef(getAttrArrayPtr(), AttributedStmtBits.NumAttrs); } Stmt *getSubStmt() { return SubStmt; } @@ -3334,16 +3334,16 @@ public: //===--- Other ---===// ArrayRef getAllConstraints() const { - return llvm::makeArrayRef(Constraints, NumInputs + NumOutputs); + return llvm::ArrayRef(Constraints, NumInputs + NumOutputs); } ArrayRef getClobbers() const { - return llvm::makeArrayRef(Clobbers, NumClobbers); + return llvm::ArrayRef(Clobbers, NumClobbers); } ArrayRef getAllExprs() const { - return llvm::makeArrayRef(reinterpret_cast(Exprs), - NumInputs + NumOutputs); + return llvm::ArrayRef(reinterpret_cast(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 6ed4750..c4dd196 100644 --- a/clang/include/clang/AST/StmtOpenMP.h +++ b/clang/include/clang/AST/StmtOpenMP.h @@ -399,8 +399,9 @@ public: static llvm::iterator_range used_clauses_children(ArrayRef 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 @@ public: getClausesOfKind(ArrayRef Clauses) { return {specific_clause_iterator(Clauses), specific_clause_iterator( - llvm::makeArrayRef(Clauses.end(), 0))}; + llvm::ArrayRef(Clauses.end(), (size_t)0))}; } template diff --git a/clang/include/clang/AST/TemplateBase.h b/clang/include/clang/AST/TemplateBase.h index 0fce875..6ba867d 100644 --- a/clang/include/clang/AST/TemplateBase.h +++ b/clang/include/clang/AST/TemplateBase.h @@ -319,7 +319,7 @@ public: 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 @@ public: /// Iterator range referencing all of the elements of a template /// argument pack. ArrayRef 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 @@ public: /// Return the array of arguments in this template argument pack. ArrayRef 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 @@ public: unsigned getNumTemplateArgs() const { return NumTemplateArgs; } llvm::ArrayRef 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 a642fbe..d723356 100644 --- a/clang/include/clang/AST/TemplateName.h +++ b/clang/include/clang/AST/TemplateName.h @@ -126,7 +126,7 @@ public: iterator end() const { return getStorage() + Bits.Data; } llvm::ArrayRef 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 af6dbcf..c165072 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -4234,7 +4234,7 @@ public: } ArrayRef 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 @@ public: using param_type_iterator = const QualType *; ArrayRef 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 @@ public: using exception_iterator = const QualType *; ArrayRef 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 @@ public: /// Retrieve the type arguments of this object type as they were /// written. ArrayRef 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 ce2ddca..72ed3cb 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/include/clang/AST/TypeLoc.h @@ -814,7 +814,7 @@ public: } ArrayRef getProtocolLocs() const { - return llvm::makeArrayRef(getProtocolLocArray(), getNumProtocols()); + return llvm::ArrayRef(getProtocolLocArray(), getNumProtocols()); } void initializeLocal(ASTContext &Context, SourceLocation Loc); @@ -1020,7 +1020,7 @@ public: ArrayRef getProtocolLocs() const { - return llvm::makeArrayRef(getProtocolLocArray(), getNumProtocols()); + return llvm::ArrayRef(getProtocolLocArray(), getNumProtocols()); } bool hasBaseTypeAsWritten() const { @@ -1447,7 +1447,7 @@ public: } ArrayRef 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 0befa8f..6bb99f0 100644 --- a/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h +++ b/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h @@ -1430,9 +1430,7 @@ public: BasicBlock *elseBlock() { return Branches[1]; } /// Return the list of basic blocks that this terminator can branch to. - ArrayRef successors() { - return llvm::makeArrayRef(Branches); - } + ArrayRef successors() { return llvm::ArrayRef(Branches); } template 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 1aff5b4..927ed14 100644 --- a/clang/include/clang/Basic/Diagnostic.h +++ b/clang/include/clang/Basic/Diagnostic.h @@ -1722,9 +1722,7 @@ public: range_iterator range_end() const { return Ranges.end(); } unsigned range_size() const { return Ranges.size(); } - ArrayRef getRanges() const { - return llvm::makeArrayRef(Ranges); - } + ArrayRef getRanges() const { return llvm::ArrayRef(Ranges); } using fixit_iterator = std::vector::const_iterator; @@ -1732,9 +1730,7 @@ public: fixit_iterator fixit_end() const { return FixIts.end(); } unsigned fixit_size() const { return FixIts.size(); } - ArrayRef getFixIts() const { - return llvm::makeArrayRef(FixIts); - } + ArrayRef 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 3470331..7919f64 100644 --- a/clang/include/clang/Basic/SyncScope.h +++ b/clang/include/clang/Basic/SyncScope.h @@ -145,7 +145,7 @@ public: static const unsigned Scopes[] = { static_cast(WorkGroup), static_cast(Device), static_cast(AllSVMDevices), static_cast(SubGroup)}; - return llvm::makeArrayRef(Scopes); + return llvm::ArrayRef(Scopes); } unsigned getFallBackValue() const override { @@ -197,7 +197,7 @@ public: static_cast(SingleThread), static_cast(Wavefront), static_cast(Workgroup), static_cast(Agent), static_cast(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 288097b..c042bcd 100644 --- a/clang/include/clang/CodeGen/CGFunctionInfo.h +++ b/clang/include/clang/CodeGen/CGFunctionInfo.h @@ -371,7 +371,7 @@ public: dyn_cast(UnpaddedCoerceAndExpandType)) { return structTy->elements(); } else { - return llvm::makeArrayRef(&UnpaddedCoerceAndExpandType, 1); + return llvm::ArrayRef(&UnpaddedCoerceAndExpandType, 1); } } @@ -713,7 +713,7 @@ public: ArrayRef 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 dc7ddb1..feb41e4 100644 --- a/clang/include/clang/Lex/MacroInfo.h +++ b/clang/include/clang/Lex/MacroInfo.h @@ -247,7 +247,7 @@ public: } bool tokens_empty() const { return NumReplacementTokens == 0; } ArrayRef tokens() const { - return llvm::makeArrayRef(ReplacementTokens, NumReplacementTokens); + return llvm::ArrayRef(ReplacementTokens, NumReplacementTokens); } llvm::MutableArrayRef @@ -572,7 +572,7 @@ public: } ArrayRef 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 66caecb..67e163c 100644 --- a/clang/include/clang/Parse/Parser.h +++ b/clang/include/clang/Parse/Parser.h @@ -1233,7 +1233,7 @@ public: /// returns false. bool SkipUntil(tok::TokenKind T, SkipUntilFlags Flags = static_cast(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(0)) { diff --git a/clang/include/clang/Sema/DeclSpec.h b/clang/include/clang/Sema/DeclSpec.h index 98f9bec..69fe2c5 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 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 @@ public: } ArrayRef 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 50abcc4..9de7131 100644 --- a/clang/include/clang/Sema/DelayedDiagnostic.h +++ b/clang/include/clang/Sema/DelayedDiagnostic.h @@ -190,8 +190,8 @@ public: ArrayRef 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 4714b8b..6c0d950 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -803,8 +803,8 @@ public: unsigned FunctionScopesStart = 0; ArrayRef 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 @@ public: unsigned InventedParameterInfosStart = 0; ArrayRef getInventedParameterInfos() const { - return llvm::makeArrayRef(InventedParameterInfos.begin() + - InventedParameterInfosStart, - InventedParameterInfos.end()); + return llvm::ArrayRef(InventedParameterInfos.begin() + + InventedParameterInfosStart, + InventedParameterInfos.end()); } typedef LazyVector 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 0ae023b..aff965e 100644 --- a/clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h +++ b/clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h @@ -70,7 +70,7 @@ public: ArrayRef 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 4e8537c6..50f460d 100644 --- a/clang/include/clang/Tooling/Transformer/RewriteRule.h +++ b/clang/include/clang/Tooling/Transformer/RewriteRule.h @@ -428,13 +428,13 @@ RewriteRuleWith applyFirst(ArrayRef> Rules); template RewriteRuleWith applyFirst(const std::vector> &Rules) { - return applyFirst(llvm::makeArrayRef(Rules)); + return applyFirst(llvm::ArrayRef(Rules)); } template RewriteRuleWith applyFirst(std::initializer_list> 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 d583718..5b0a5e2 100644 --- a/clang/lib/AST/APValue.cpp +++ b/clang/lib/AST/APValue.cpp @@ -984,7 +984,7 @@ bool APValue::hasLValuePath() const { ArrayRef 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 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 263123d..15a4380 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 19923ec..08877aa 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 329718c..60cafbc 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( - 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(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 522bc5b..8adfd85 100644 --- a/clang/lib/AST/CommentParser.cpp +++ b/clang/lib/AST/CommentParser.cpp @@ -245,7 +245,7 @@ public: 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 9b0f034..a4250c0 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 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 40ebde0..5668c87 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 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 47c1f48..0e1bc2d 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -5379,8 +5379,8 @@ ArrayRef ImportDecl::getIdentifierLocs() const { return std::nullopt; const auto *StoredLocs = getTrailingObjects(); - 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 8f06b9b..1576c27 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 0b21100..5fac054 100644 --- a/clang/lib/AST/DeclTemplate.cpp +++ b/clang/lib/AST/DeclTemplate.cpp @@ -365,7 +365,7 @@ ArrayRef 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 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 f7674b4..a78ad16 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 a43845e..9e0e630 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 @@ public: 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(Definition), Info, Result); diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp index dd35391..abbfdca 100644 --- a/clang/lib/AST/OpenMPClause.cpp +++ b/clang/lib/AST/OpenMPClause.cpp @@ -367,7 +367,7 @@ void OMPOrderedClause::setLoopNumIterations(unsigned NumLoop, } ArrayRef OMPOrderedClause::getLoopNumIterations() const { - return llvm::makeArrayRef(getTrailingObjects(), NumberOfLoops); + return llvm::ArrayRef(getTrailingObjects(), NumberOfLoops); } void OMPOrderedClause::setLoopCounter(unsigned NumLoop, Expr *Counter) { diff --git a/clang/lib/AST/ParentMapContext.cpp b/clang/lib/AST/ParentMapContext.cpp index 0840c57..21cfd5b 100644 --- a/clang/lib/AST/ParentMapContext.cpp +++ b/clang/lib/AST/ParentMapContext.cpp @@ -99,7 +99,7 @@ class ParentMapContext::ParentMap { return llvm::ArrayRef(); } if (const auto *V = I->second.template dyn_cast()) { - return llvm::makeArrayRef(*V); + return llvm::ArrayRef(*V); } return getSingleDynTypedNodeFromParentMap(I->second); } @@ -252,7 +252,7 @@ public: const auto *S = It->second.dyn_cast(); if (!S) { if (auto *Vec = It->second.dyn_cast()) - return llvm::makeArrayRef(*Vec); + return llvm::ArrayRef(*Vec); return getSingleDynTypedNodeFromParentMap(It->second); } const auto *P = dyn_cast(S); diff --git a/clang/lib/AST/TemplateName.cpp b/clang/lib/AST/TemplateName.cpp index c348d76..f0e3e94 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 eb249ae..aec8e95 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -1076,7 +1076,7 @@ public: if (exceptionChanged) { info.ExceptionSpec.Exceptions = - llvm::makeArrayRef(exceptionTypes).copy(Ctx); + llvm::ArrayRef(exceptionTypes).copy(Ctx); } } @@ -1218,10 +1218,10 @@ public: !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 a194331..31cb57a 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 c3b774f..7f2c834 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(S); - children = llvm::makeArrayRef(reinterpret_cast(IE->getInits()), - IE->getNumInits()); + children = llvm::ArrayRef(reinterpret_cast(IE->getInits()), + IE->getNumInits()); return; } default: diff --git a/clang/lib/Analysis/CalledOnceCheck.cpp b/clang/lib/Analysis/CalledOnceCheck.cpp index 4d1c2f8..896562c 100644 --- a/clang/lib/Analysis/CalledOnceCheck.cpp +++ b/clang/lib/Analysis/CalledOnceCheck.cpp @@ -880,8 +880,8 @@ private: template void checkIndirectCall(const CallLikeExpr *CallOrMessage) { // CallExpr::arguments does not interact nicely with llvm::enumerate. - llvm::ArrayRef Arguments = llvm::makeArrayRef( - CallOrMessage->getArgs(), CallOrMessage->getNumArgs()); + llvm::ArrayRef 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 @@ private: bool shouldBlockArgumentBeCalledOnce(const CallLikeExpr *CallOrMessage, const Stmt *BlockArgument) const { // CallExpr::arguments does not interact nicely with llvm::enumerate. - llvm::ArrayRef Arguments = llvm::makeArrayRef( - CallOrMessage->getArgs(), CallOrMessage->getNumArgs()); + llvm::ArrayRef 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 1a561b3..3e2958b 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 2f30fa0..aa82a99 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -264,7 +264,7 @@ ArrayRef 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 818a619..5db3138 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 AArch64TargetInfo::getTargetBuiltins() const { - return llvm::makeArrayRef(BuiltinInfo, clang::AArch64::LastTSBuiltin - - Builtin::FirstTSBuiltin); + return llvm::ArrayRef(BuiltinInfo, clang::AArch64::LastTSBuiltin - + Builtin::FirstTSBuiltin); } Optional> @@ -1179,7 +1179,7 @@ const char *const AArch64TargetInfo::GCCRegNames[] = { }; ArrayRef 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 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 7e54f23..3d54812 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 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 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 f3640f3..3cb338a 100644 --- a/clang/lib/Basic/Targets/ARC.h +++ b/clang/lib/Basic/Targets/ARC.h @@ -56,7 +56,7 @@ public: "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 getGCCRegAliases() const override { diff --git a/clang/lib/Basic/Targets/ARM.cpp b/clang/lib/Basic/Targets/ARM.cpp index b8d6198..bb45505 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 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 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 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 0b8a05d..7730bb8 100644 --- a/clang/lib/Basic/Targets/AVR.h +++ b/clang/lib/Basic/Targets/AVR.h @@ -76,7 +76,7 @@ public: "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 getGCCRegAliases() const override { @@ -90,7 +90,7 @@ public: {{"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 99fed38..d139054 100644 --- a/clang/lib/Basic/Targets/BPF.cpp +++ b/clang/lib/Basic/Targets/BPF.cpp @@ -43,8 +43,8 @@ void BPFTargetInfo::fillValidCPUList(SmallVectorImpl &Values) const { } ArrayRef 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 &Features, diff --git a/clang/lib/Basic/Targets/CSKY.cpp b/clang/lib/Basic/Targets/CSKY.cpp index adcffd9..f272bed 100644 --- a/clang/lib/Basic/Targets/CSKY.cpp +++ b/clang/lib/Basic/Targets/CSKY.cpp @@ -213,7 +213,7 @@ ArrayRef CSKYTargetInfo::getGCCRegNames() const { "fr31", }; - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } ArrayRef CSKYTargetInfo::getGCCRegAliases() const { @@ -285,7 +285,7 @@ ArrayRef 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 8bc3c2b..3207ef5 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 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 HexagonTargetInfo::getGCCRegAliases() const { - return llvm::makeArrayRef(GCCRegAliases); + return llvm::ArrayRef(GCCRegAliases); } static constexpr Builtin::Info BuiltinInfo[] = { @@ -255,6 +255,6 @@ void HexagonTargetInfo::fillValidCPUList( } ArrayRef 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 bb18720..8722a36 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 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 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 4ce2be8..9eab9f1 100644 --- a/clang/lib/Basic/Targets/LoongArch.cpp +++ b/clang/lib/Basic/Targets/LoongArch.cpp @@ -32,7 +32,7 @@ ArrayRef 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 @@ -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 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 e3215b2..868437c 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 M68kTargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } ArrayRef M68kTargetInfo::getGCCRegAliases() const { diff --git a/clang/lib/Basic/Targets/MSP430.cpp b/clang/lib/Basic/Targets/MSP430.cpp index 9089050..de8704f 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 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 973e039..3761fc7 100644 --- a/clang/lib/Basic/Targets/MSP430.h +++ b/clang/lib/Basic/Targets/MSP430.h @@ -71,7 +71,7 @@ public: {{"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 1c0fdf0..2fc7572 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 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 627b9f5..9e84dbc 100644 --- a/clang/lib/Basic/Targets/Mips.h +++ b/clang/lib/Basic/Targets/Mips.h @@ -225,7 +225,7 @@ public: "$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 @@ public: {{"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 f296196..6d06545 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 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 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 a4add4d..7cab445 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 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 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 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 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 9bda62c..7713398 100644 --- a/clang/lib/Basic/Targets/RISCV.cpp +++ b/clang/lib/Basic/Targets/RISCV.cpp @@ -41,7 +41,7 @@ ArrayRef 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 RISCVTargetInfo::getGCCRegAliases() const { @@ -62,7 +62,7 @@ ArrayRef 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 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 9321024..4548902 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 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 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 311c8ba..4752d07 100644 --- a/clang/lib/Basic/Targets/SystemZ.cpp +++ b/clang/lib/Basic/Targets/SystemZ.cpp @@ -46,11 +46,11 @@ const TargetInfo::AddlRegName GCCAddlRegNames[] = { }; ArrayRef SystemZTargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } ArrayRef 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 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 667808d..0e2dd2b 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 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 27ad07a..d42d3e9 100644 --- a/clang/lib/Basic/Targets/VE.h +++ b/clang/lib/Basic/Targets/VE.h @@ -83,7 +83,7 @@ public: "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 getGCCRegAliases() const override { @@ -153,7 +153,7 @@ public: {{"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 36d8d54..b89140d 100644 --- a/clang/lib/Basic/Targets/WebAssembly.cpp +++ b/clang/lib/Basic/Targets/WebAssembly.cpp @@ -268,8 +268,8 @@ bool WebAssemblyTargetInfo::handleTargetFeatures( } ArrayRef 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 4a3ce36..a6eea30 100644 --- a/clang/lib/Basic/Targets/X86.cpp +++ b/clang/lib/Basic/Targets/X86.cpp @@ -1599,19 +1599,19 @@ void X86TargetInfo::fillValidTuneCPUList(SmallVectorImpl &Values) con } ArrayRef X86TargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } ArrayRef X86TargetInfo::getGCCAddlRegNames() const { - return llvm::makeArrayRef(AddlRegNames); + return llvm::ArrayRef(AddlRegNames); } ArrayRef 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 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 d73116b..e697e10 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 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 1cd5216..8eef9de 100644 --- a/clang/lib/Basic/Targets/XCore.h +++ b/clang/lib/Basic/Targets/XCore.h @@ -56,7 +56,7 @@ public: "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 getGCCRegAliases() const override { diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index fa6128b2..a699468 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 d863004..7dc1052 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 d8de8af..b4c1966 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 ea62d5d..c7b193e 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 3cd0e43..c0893d7 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp @@ -8733,7 +8733,7 @@ public: 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(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 cf9b704..081fe5e 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 { if (const auto *FlushClause = S.getSingleClause()) - 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 ed79c81..f15c6bb 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( - CurFn->getName().bytes_begin(), CurFn->getName().bytes_end()); + auto FuncName = llvm::ArrayRef(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 1239147..c8e27b2 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(const_cast(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 03531e3..6ee052d 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(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(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 2ed794a..abbf71d 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 06d3e44..18068a1 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 6e5bc06..14db4f0 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 FilenameRefs = llvm::makeArrayRef(FilenameStrs); + ArrayRef 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 016f7ec..81a383c 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(); - 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 aec170a..b871ea6 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -9848,7 +9848,7 @@ private: // 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 af59665..ec355ce 100644 --- a/clang/lib/Driver/Job.cpp +++ b/clang/lib/Driver/Job.cpp @@ -353,7 +353,7 @@ int Command::Execute(ArrayRef> 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> 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 ffa45d4..a161355 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 23b2238..1c29547 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 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 acea2bf..fcfc18e 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 c2fccd6..a6f5fdc 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 &ClangArgv) { driver::Driver Driver(/*MainBinaryName=*/ClangArgv[0], llvm::sys::getProcessTriple(), Diags); Driver.setCheckInputsExist(false); // the input comes from mem buffers - llvm::ArrayRef RF = llvm::makeArrayRef(ClangArgv); + llvm::ArrayRef RF = llvm::ArrayRef(ClangArgv); std::unique_ptr 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 0d141c6..a64a00d 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 705026e..d157536 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 5560a19..c1e39ac 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 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 f787d6c..3b6bfd1 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 3148448..9a0446e 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 9579721..b7995dc 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(FieldCollector->getCurFields()), - FieldCollector->getCurNumFields()), LBrac, RBrac, AttrList); + ActOnFields(S, RLoc, TagDecl, + llvm::ArrayRef( + // strict aliasing violation! + reinterpret_cast(FieldCollector->getCurFields()), + FieldCollector->getCurNumFields()), + LBrac, RBrac, AttrList); CheckCompletedCXXClass(S, cast(TagDecl)); } @@ -15737,19 +15737,16 @@ bool Sema::CompleteConstructorCall(CXXConstructorDecl *Constructor, VariadicCallType CallType = Proto->isVariadic() ? VariadicConstructor : VariadicDoesNotApply; SmallVector 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(A)) Arg = G->getArg(); else if (const auto *AA = dyn_cast(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(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(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(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(A)) Arg = LR->getArg(); else if (const auto *LE = dyn_cast(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(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(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(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(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 1fd973b..804df3e 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(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 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 f73abdb..61bd1f8 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 848e9c6..9db813e 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 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 a92c24d..225ff83 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(Call)) { Callee = CE->getDirectCallee(); - Args = llvm::makeArrayRef(CE->getArgs(), CE->getNumArgs()); + Args = llvm::ArrayRef(CE->getArgs(), CE->getNumArgs()); } else { auto *CCE = cast(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 4ec8a37..dedcfb5 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(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(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(Cand.getDecl()) && "illegal Kind of operator = Decl"); @@ -4948,9 +4948,9 @@ void TypoCorrectionConsumer::NamespaceSpecifierSet::addNameSpecifier( if (NNS && !CurNameSpecifierIdentifiers.empty()) { SmallVector 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 7e55182..08c66d3 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 difficult. 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 94335cb..8e73064 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 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 677abfb..f15603f 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 798544b..40335c8 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 6d57cd8..c77b0af 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -916,7 +916,7 @@ public: 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 void g(const T (&...p)[V]); diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index effb6332..9757183 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 a645ffe..7d6f282 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 3516147..04d34f3 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -1097,11 +1097,10 @@ TypeResult Sema::actOnObjCProtocolQualifierType( SourceLocation rAngleLoc) { // Form id. 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 debe783..1724ae5 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -6051,8 +6051,8 @@ QualType TreeTransform::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::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::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::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::TransformGCCAsmStmt(GCCAsmStmt *S) { template StmtResult TreeTransform::TransformMSAsmStmt(MSAsmStmt *S) { - ArrayRef AsmToks = - llvm::makeArrayRef(S->getAsmToks(), S->getNumAsmToks()); + ArrayRef 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 35632d9..c47a56b 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( 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(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 6299a48..f00ec3d 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 c117a29..a63d010 100644 --- a/clang/lib/Serialization/ASTWriterDecl.cpp +++ b/clang/lib/Serialization/ASTWriterDecl.cpp @@ -223,7 +223,7 @@ namespace clang { ArrayRef 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(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 4b0da86..5af355a 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 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 9c82542..e67ffb0 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 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 0322d02..5e424cc 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 041cc4f..cd02619 100644 --- a/clang/lib/Tooling/Syntax/BuildTree.cpp +++ b/clang/lib/Tooling/Syntax/BuildTree.cpp @@ -469,7 +469,7 @@ public: 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 @@ -552,7 +552,7 @@ private: 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 @@ public: // 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 @@ private: 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 08e09e4..fe9a9df 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 500d074..d0c8201 100644 --- a/clang/lib/Tooling/Syntax/Tokens.cpp +++ b/clang/lib/Tooling/Syntax/Tokens.cpp @@ -425,8 +425,8 @@ TokenBuffer::expandedForSpelled(llvm::ArrayRef 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 TokenBuffer::spelledTokens(FileID FID) const { @@ -496,7 +496,7 @@ TokenBuffer::spelledForExpanded(llvm::ArrayRef 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 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 @@ -982,7 +982,7 @@ std::string TokenBuffer::dumpForTests() const { OS << "expanded tokens:\n" << " "; // (!) we do not show ''. - DumpTokens(OS, llvm::makeArrayRef(ExpandedTokens).drop_back()); + DumpTokens(OS, llvm::ArrayRef(ExpandedTokens).drop_back()); OS << "\n"; std::vector Keys; diff --git a/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp index a76046a..8966c12 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 CC1Args = makeArrayRef(Argv).drop_front(); + ArrayRef CC1Args = ArrayRef(Argv).drop_front(); std::unique_ptr 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 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 a3f4978..852b8c2 100644 --- a/clang/tools/diagtool/DiagnosticNames.cpp +++ b/clang/tools/diagtool/DiagnosticNames.cpp @@ -20,7 +20,7 @@ static const DiagnosticRecord BuiltinDiagnosticsByName[] = { }; llvm::ArrayRef diagtool::getBuiltinDiagnosticsByName() { - return llvm::makeArrayRef(BuiltinDiagnosticsByName); + return llvm::ArrayRef(BuiltinDiagnosticsByName); } @@ -103,5 +103,5 @@ GroupRecord::diagnostics() const { } llvm::ArrayRef 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 eafd20c..328ebff 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 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 0d46f5e..a4a9d8e 100644 --- a/clang/tools/driver/driver.cpp +++ b/clang/tools/driver/driver.cpp @@ -357,12 +357,11 @@ static int ExecuteCC1Tool(SmallVectorImpl &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 057fa59..7889873 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 DiagOpts = CreateAndPopulateDiagOpts( - llvm::makeArrayRef(command_line_args, num_command_line_args)); + llvm::ArrayRef(command_line_args, num_command_line_args)); IntrusiveRefCntPtr 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 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 0d75970..d7df36d 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 1be313d..24ca98d 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 f8d38a2..068c583 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 5f5b231..22321f2 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>{ 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>{ STRING_LOCATION_STDPAIR(NNS, getBeginLoc()), STRING_LOCATION_STDPAIR(NNS, getEndLoc()), @@ -962,7 +962,7 @@ struct D : Templ { // clang-format off EXPECT_EQ( - llvm::makeArrayRef(ExpectedLocations), + llvm::ArrayRef(ExpectedLocations), (ArrayRef>{ STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs().getNamedTypeLoc().getAs().getLAngleLoc()), STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs().getNamedTypeLoc().getAs().getRAngleLoc()), @@ -1329,7 +1329,7 @@ int foo(); // clang-format off EXPECT_EQ( - llvm::makeArrayRef(ExpectedLocations), + llvm::ArrayRef(ExpectedLocations), (ArrayRef>{ STRING_LOCATION_STDPAIR(TL, getAs().getLParenLoc()), STRING_LOCATION_STDPAIR(TL, getAs().getLocalRangeBegin()), @@ -1393,7 +1393,7 @@ int* i; // clang-format off EXPECT_EQ( - llvm::makeArrayRef(ExpectedLocations), + llvm::ArrayRef(ExpectedLocations), (ArrayRef>{ STRING_LOCATION_STDPAIR(TL, getAs().getPointeeLoc().getAs().getBuiltinLoc()), STRING_LOCATION_STDPAIR(TL, getAs().getPointeeLoc().getAs().getNameLoc()), @@ -1505,7 +1505,7 @@ class Foo // clang-format off EXPECT_EQ( - llvm::makeArrayRef(ExpectedLocations), + llvm::ArrayRef(ExpectedLocations), (ArrayRef>{ 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>{ - 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(Result.RangeAccessors); @@ -1624,7 +1623,7 @@ class Foo llvm::sort(ExpectedLocations); - EXPECT_EQ(llvm::makeArrayRef(ExpectedLocations), + EXPECT_EQ(llvm::ArrayRef(ExpectedLocations), (ArrayRef>{ 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>{ 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 c5982b8..44ae368 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 b41d965..542fe73 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(); diff --git a/clang/unittests/Tooling/Syntax/TokensTest.cpp b/clang/unittests/Tooling/Syntax/TokensTest.cpp index 1f19994..e034250 100644 --- a/clang/unittests/Tooling/Syntax/TokensTest.cpp +++ b/clang/unittests/Tooling/Syntax/TokensTest.cpp @@ -191,7 +191,7 @@ public: llvm::ArrayRef 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 @@ public: 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 @@ public: 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 25f9e19..4da4d6c 100644 --- a/clang/unittests/Tooling/Syntax/TreeTestBase.cpp +++ b/clang/unittests/Tooling/Syntax/TreeTestBase.cpp @@ -39,10 +39,10 @@ ArrayRef tokens(syntax::Node *N, const TokenBufferTokenManager &STM) { assert(N->isOriginal() && "tokens of modified nodes are not well-defined"); if (auto *L = dyn_cast(N)) - return llvm::makeArrayRef(STM.getToken(L->getTokenKey()), 1); + return llvm::ArrayRef(STM.getToken(L->getTokenKey()), 1); auto *T = cast(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 a476a9e..1649627 100644 --- a/clang/unittests/Tooling/ToolingTest.cpp +++ b/clang/unittests/Tooling/ToolingTest.cpp @@ -395,7 +395,7 @@ public: const llvm::opt::ArgStringList * extractCC1Arguments(llvm::ArrayRef Argv) { const std::unique_ptr Compilation( - Driver.BuildCompilation(llvm::makeArrayRef(Argv))); + Driver.BuildCompilation(llvm::ArrayRef(Argv))); return getCC1Arguments(Diags.get(), Compilation.get()); } -- 2.7.4