Index: bolt/tools/bat-dump/bat-dump.cpp =================================================================== --- bolt/tools/bat-dump/bat-dump.cpp +++ bolt/tools/bat-dump/bat-dump.cpp @@ -151,7 +151,7 @@ } int main(int argc, char **argv) { - cl::HideUnrelatedOptions(makeArrayRef(opts::BatDumpCategories)); + cl::HideUnrelatedOptions(ArrayRef(opts::BatDumpCategories)); cl::ParseCommandLineOptions(argc, argv, ""); if (!sys::fs::exists(opts::InputFilename)) Index: bolt/tools/driver/llvm-bolt.cpp =================================================================== --- bolt/tools/driver/llvm-bolt.cpp +++ bolt/tools/driver/llvm-bolt.cpp @@ -98,7 +98,7 @@ } void perf2boltMode(int argc, char **argv) { - cl::HideUnrelatedOptions(makeArrayRef(opts::Perf2BoltCategories)); + cl::HideUnrelatedOptions(ArrayRef(opts::Perf2BoltCategories)); cl::AddExtraVersionPrinter(printBoltRevision); cl::ParseCommandLineOptions( argc, argv, @@ -127,7 +127,7 @@ } void boltDiffMode(int argc, char **argv) { - cl::HideUnrelatedOptions(makeArrayRef(opts::BoltDiffCategories)); + cl::HideUnrelatedOptions(ArrayRef(opts::BoltDiffCategories)); cl::AddExtraVersionPrinter(printBoltRevision); cl::ParseCommandLineOptions( argc, argv, @@ -153,7 +153,7 @@ } void boltMode(int argc, char **argv) { - cl::HideUnrelatedOptions(makeArrayRef(opts::BoltCategories)); + cl::HideUnrelatedOptions(ArrayRef(opts::BoltCategories)); // Register the target printer for --version. cl::AddExtraVersionPrinter(printBoltRevision); cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion); Index: bolt/tools/heatmap/heatmap.cpp =================================================================== --- bolt/tools/heatmap/heatmap.cpp +++ bolt/tools/heatmap/heatmap.cpp @@ -50,7 +50,7 @@ } int main(int argc, char **argv) { - cl::HideUnrelatedOptions(makeArrayRef(opts::HeatmapCategories)); + cl::HideUnrelatedOptions(ArrayRef(opts::HeatmapCategories)); cl::ParseCommandLineOptions(argc, argv, ""); if (opts::PerfData.empty()) { Index: clang-tools-extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp =================================================================== --- clang-tools-extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp +++ clang-tools-extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp @@ -91,7 +91,7 @@ } int main(int argc, char **argv) { - cl::HideUnrelatedOptions(makeArrayRef(VisibleCategories)); + cl::HideUnrelatedOptions(ArrayRef(VisibleCategories)); cl::SetVersionPrinter(printVersion); cl::ParseCommandLineOptions(argc, argv); Index: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp +++ clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp @@ -353,7 +353,7 @@ return; checkCallArgs(Result.Context, Callee, Call->getCallee()->getEndLoc(), - llvm::makeArrayRef(Call->getArgs(), Call->getNumArgs())); + llvm::ArrayRef(Call->getArgs(), Call->getNumArgs())); } else { const auto *Construct = cast(E); if (Construct->getNumArgs() > 0 && @@ -364,7 +364,7 @@ checkCallArgs( Result.Context, Construct->getConstructor(), Construct->getParenOrBraceRange().getBegin(), - llvm::makeArrayRef(Construct->getArgs(), Construct->getNumArgs())); + llvm::ArrayRef(Construct->getArgs(), Construct->getNumArgs())); } } Index: clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp +++ clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp @@ -236,7 +236,7 @@ {bugprone::SignalHandlerCheck::AsyncSafeFunctionSetKind::POSIX, "POSIX"}, }; - return makeArrayRef(Mapping); + return ArrayRef(Mapping); } }; Index: clang-tools-extra/clang-tidy/concurrency/MtUnsafeCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/concurrency/MtUnsafeCheck.cpp +++ clang-tools-extra/clang-tidy/concurrency/MtUnsafeCheck.cpp @@ -270,7 +270,7 @@ Mapping[] = {{concurrency::MtUnsafeCheck::FunctionSet::Posix, "posix"}, {concurrency::MtUnsafeCheck::FunctionSet::Glibc, "glibc"}, {concurrency::MtUnsafeCheck::FunctionSet::Any, "any"}}; - return makeArrayRef(Mapping); + return ArrayRef(Mapping); } }; Index: clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp +++ clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp @@ -627,7 +627,7 @@ static ArrayRef getForwardedArgumentList(const LambdaProperties &P) { - ArrayRef Args = makeArrayRef(P.BindArguments); + ArrayRef Args = ArrayRef(P.BindArguments); if (P.Callable.Type != CT_MemberFunction) return Args; @@ -672,7 +672,7 @@ emitCaptureList(LP, Result, Stream); Stream << "]"; - ArrayRef FunctionCallArgs = makeArrayRef(LP.BindArguments); + ArrayRef FunctionCallArgs = ArrayRef(LP.BindArguments); addPlaceholderArgs(LP, Stream, PermissiveParameterList); Index: clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp +++ clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp @@ -36,7 +36,7 @@ Mapping[] = {{modernize::Confidence::CL_Reasonable, "reasonable"}, {modernize::Confidence::CL_Safe, "safe"}, {modernize::Confidence::CL_Risky, "risky"}}; - return makeArrayRef(Mapping); + return ArrayRef(Mapping); } }; @@ -49,7 +49,7 @@ {modernize::VariableNamer::NS_CamelBack, "camelBack"}, {modernize::VariableNamer::NS_LowerCase, "lower_case"}, {modernize::VariableNamer::NS_UpperCase, "UPPER_CASE"}}; - return makeArrayRef(Mapping); + return ArrayRef(Mapping); } }; Index: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp +++ clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp @@ -46,7 +46,7 @@ "Camel_Snake_Case"}, {readability::IdentifierNamingCheck::CT_CamelSnakeBack, "camel_Snake_Back"}}; - return llvm::makeArrayRef(Mapping); + return llvm::ArrayRef(Mapping); } template <> @@ -61,7 +61,7 @@ {HungarianPrefixType::HPT_On, "On"}, {HungarianPrefixType::HPT_LowerCase, "LowerCase"}, {HungarianPrefixType::HPT_CamelCase, "CamelCase"}}; - return llvm::makeArrayRef(Mapping); + return llvm::ArrayRef(Mapping); } }; Index: clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp =================================================================== --- clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp +++ clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp @@ -230,7 +230,7 @@ Mapping[] = {{utils::IncludeSorter::IS_LLVM, "llvm"}, {utils::IncludeSorter::IS_Google, "google"}, {utils::IncludeSorter::IS_Google_ObjC, "google-objc"}}; - return makeArrayRef(Mapping); + return ArrayRef(Mapping); } } // namespace tidy } // namespace clang Index: clang-tools-extra/clangd/ClangdLSPServer.cpp =================================================================== --- clang-tools-extra/clangd/ClangdLSPServer.cpp +++ clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -505,7 +505,7 @@ } auto Mangler = CommandMangler::detect(); Mangler.SystemIncludeExtractor = - getSystemIncludeExtractor(llvm::makeArrayRef(Opts.QueryDriverGlobs)); + getSystemIncludeExtractor(llvm::ArrayRef(Opts.QueryDriverGlobs)); if (Opts.ResourceDir) Mangler.ResourceDir = *Opts.ResourceDir; CDB.emplace(BaseCDB.get(), Params.initializationOptions.fallbackFlags, Index: clang-tools-extra/clangd/CompileCommands.cpp =================================================================== --- clang-tools-extra/clangd/CompileCommands.cpp +++ clang-tools-extra/clangd/CompileCommands.cpp @@ -211,7 +211,7 @@ for (const auto &S : Cmd) OriginalArgs.push_back(S.c_str()); bool IsCLMode = driver::IsClangCL(driver::getDriverMode( - OriginalArgs[0], llvm::makeArrayRef(OriginalArgs).slice(1))); + OriginalArgs[0], llvm::ArrayRef(OriginalArgs).slice(1))); // ParseArgs propagates missig arg/opt counts on error, but preserves // everything it could parse in ArgList. So we just ignore those counts. unsigned IgnoredCount; @@ -219,7 +219,7 @@ // indices are actually of by one between ArgList and OriginalArgs. llvm::opt::InputArgList ArgList; ArgList = OptTable.ParseArgs( - llvm::makeArrayRef(OriginalArgs).drop_front(), IgnoredCount, IgnoredCount, + llvm::ArrayRef(OriginalArgs).drop_front(), IgnoredCount, IgnoredCount, /*FlagsToInclude=*/ IsCLMode ? (driver::options::CLOption | driver::options::CoreOption | driver::options::CLDXCOption) Index: clang-tools-extra/clangd/FindSymbols.cpp =================================================================== --- clang-tools-extra/clangd/FindSymbols.cpp +++ clang-tools-extra/clangd/FindSymbols.cpp @@ -643,7 +643,7 @@ DocumentSymbol Root; Root.children = std::move(Syms); Root.range = EntireFile; - mergePragmas(Root, llvm::makeArrayRef(Pragmas)); + mergePragmas(Root, llvm::ArrayRef(Pragmas)); return Root.children; } Index: clang-tools-extra/clangd/Preamble.cpp =================================================================== --- clang-tools-extra/clangd/Preamble.cpp +++ clang-tools-extra/clangd/Preamble.cpp @@ -58,7 +58,7 @@ const tooling::CompileCommand &RHS) { // We don't check for Output, it should not matter to clangd. return LHS.Directory == RHS.Directory && LHS.Filename == RHS.Filename && - llvm::makeArrayRef(LHS.CommandLine).equals(RHS.CommandLine); + llvm::ArrayRef(LHS.CommandLine).equals(RHS.CommandLine); } class CppFilePreambleCallbacks : public PreambleCallbacks { Index: clang-tools-extra/clangd/Selection.cpp =================================================================== --- clang-tools-extra/clangd/Selection.cpp +++ clang-tools-extra/clangd/Selection.cpp @@ -261,7 +261,7 @@ SelFirst, AllSpelledTokens.end(), [&](const syntax::Token &Tok) { return SM.getFileOffset(Tok.location()) < SelEnd; }); - auto Sel = llvm::makeArrayRef(SelFirst, SelLimit); + auto Sel = llvm::ArrayRef(SelFirst, SelLimit); // Find which of these are preprocessed to nothing and should be ignored. llvm::BitVector PPIgnored(Sel.size(), false); for (const syntax::TokenBuffer::Expansion &X : @@ -418,7 +418,7 @@ if (EndInvalid) End = Toks.expandedTokens().end(); - return llvm::makeArrayRef(Start, End); + return llvm::ArrayRef(Start, End); } // Hit-test a consecutive range of tokens from a single file ID. Index: clang-tools-extra/clangd/XRefs.cpp =================================================================== --- clang-tools-extra/clangd/XRefs.cpp +++ clang-tools-extra/clangd/XRefs.cpp @@ -726,12 +726,12 @@ return T.location() < Word.Location; // Comparison OK: same file. }); // Search for matches after the cursor. - for (const syntax::Token &Tok : llvm::makeArrayRef(I, SpelledTokens.end())) + for (const syntax::Token &Tok : llvm::ArrayRef(I, SpelledTokens.end())) if (Consider(Tok)) break; // costs of later tokens are greater... // Search for matches before the cursor. for (const syntax::Token &Tok : - llvm::reverse(llvm::makeArrayRef(SpelledTokens.begin(), I))) + llvm::reverse(llvm::ArrayRef(SpelledTokens.begin(), I))) if (Consider(Tok)) break; Index: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp =================================================================== --- clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp +++ clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp @@ -242,7 +242,7 @@ if (Tok.kind() != Kind) continue; FoundAny = true; - auto Spelling = TokBuf.spelledForExpanded(llvm::makeArrayRef(Tok)); + auto Spelling = TokBuf.spelledForExpanded(llvm::ArrayRef(Tok)); if (!Spelling) { Errors = llvm::joinErrors( std::move(Errors), Index: clang-tools-extra/clangd/tool/Check.cpp =================================================================== --- clang-tools-extra/clangd/tool/Check.cpp +++ clang-tools-extra/clangd/tool/Check.cpp @@ -145,7 +145,7 @@ std::make_unique(CDBOpts); auto Mangler = CommandMangler::detect(); Mangler.SystemIncludeExtractor = - getSystemIncludeExtractor(llvm::makeArrayRef(Opts.QueryDriverGlobs)); + getSystemIncludeExtractor(llvm::ArrayRef(Opts.QueryDriverGlobs)); if (Opts.ResourceDir) Mangler.ResourceDir = *Opts.ResourceDir; auto CDB = std::make_unique( @@ -228,7 +228,7 @@ elog("Failed to build AST"); return false; } - ErrCount += showErrors(llvm::makeArrayRef(*AST->getDiagnostics()) + ErrCount += showErrors(llvm::ArrayRef(*AST->getDiagnostics()) .drop_front(Preamble->Diags.size())); if (Opts.BuildDynamicSymbolIndex) { Index: clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp =================================================================== --- clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp +++ clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp @@ -375,9 +375,9 @@ tooling::CompileCommand Cmd; Cmd.CommandLine = {"clang", "/Users/foo.cc"}; Mangler(Cmd, "/Users/foo.cc"); - EXPECT_THAT(llvm::makeArrayRef(Cmd.CommandLine).take_back(2), + EXPECT_THAT(llvm::ArrayRef(Cmd.CommandLine).take_back(2), ElementsAre("--", "/Users/foo.cc")); - EXPECT_THAT(llvm::makeArrayRef(Cmd.CommandLine).drop_back(2), + EXPECT_THAT(llvm::ArrayRef(Cmd.CommandLine).drop_back(2), Not(Contains("/Users/foo.cc"))); } // In CL mode /U triggers an undef operation, hence `/Users/foo.cc` shouldn't @@ -386,9 +386,9 @@ tooling::CompileCommand Cmd; Cmd.CommandLine = {"clang", "--driver-mode=cl", "bar.cc", "/Users/foo.cc"}; Mangler(Cmd, "bar.cc"); - EXPECT_THAT(llvm::makeArrayRef(Cmd.CommandLine).take_back(2), + EXPECT_THAT(llvm::ArrayRef(Cmd.CommandLine).take_back(2), ElementsAre("--", "bar.cc")); - EXPECT_THAT(llvm::makeArrayRef(Cmd.CommandLine).drop_back(2), + EXPECT_THAT(llvm::ArrayRef(Cmd.CommandLine).drop_back(2), Not(Contains("bar.cc"))); } // All inputs but the main file is dropped. @@ -396,10 +396,10 @@ tooling::CompileCommand Cmd; Cmd.CommandLine = {"clang", "foo.cc", "bar.cc"}; Mangler(Cmd, "baz.cc"); - EXPECT_THAT(llvm::makeArrayRef(Cmd.CommandLine).take_back(2), + EXPECT_THAT(llvm::ArrayRef(Cmd.CommandLine).take_back(2), ElementsAre("--", "baz.cc")); EXPECT_THAT( - llvm::makeArrayRef(Cmd.CommandLine).drop_back(2), + llvm::ArrayRef(Cmd.CommandLine).drop_back(2), testing::AllOf(Not(Contains("foo.cc")), Not(Contains("bar.cc")))); } } Index: clang-tools-extra/include-cleaner/lib/HTMLReport.cpp =================================================================== --- clang-tools-extra/include-cleaner/lib/HTMLReport.cpp +++ clang-tools-extra/include-cleaner/lib/HTMLReport.cpp @@ -460,7 +460,7 @@ return std::make_pair(Refs[A].Offset, Refs[A].Type != RefType::Implicit) < std::make_pair(Refs[B].Offset, Refs[B].Type != RefType::Implicit); }); - auto Rest = llvm::makeArrayRef(RefOrder); + auto Rest = llvm::ArrayRef(RefOrder); unsigned End = 0; StartLine(); for (unsigned I = 0; I < Code.size(); ++I) { Index: clang-tools-extra/pseudo/include/clang-pseudo/Forest.h =================================================================== --- clang-tools-extra/pseudo/include/clang-pseudo/Forest.h +++ clang-tools-extra/pseudo/include/clang-pseudo/Forest.h @@ -139,8 +139,7 @@ // Retrieves the trailing array. llvm::ArrayRef children(uint16_t Num) const { - return llvm::makeArrayRef(reinterpret_cast(this + 1), - Num); + return llvm::ArrayRef(reinterpret_cast(this + 1), Num); } llvm::MutableArrayRef children(uint16_t Num) { return llvm::makeMutableArrayRef(reinterpret_cast(this + 1), Index: clang-tools-extra/pseudo/include/clang-pseudo/GLR.h =================================================================== --- clang-tools-extra/pseudo/include/clang-pseudo/GLR.h +++ clang-tools-extra/pseudo/include/clang-pseudo/GLR.h @@ -83,8 +83,8 @@ const ForestNode *Payload = nullptr; llvm::ArrayRef parents() const { - return llvm::makeArrayRef(reinterpret_cast(this + 1), - ParentCount); + return llvm::ArrayRef(reinterpret_cast(this + 1), + ParentCount); }; // Parents are stored as a trailing array of Node*. }; Index: clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRTable.h =================================================================== --- clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRTable.h +++ clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRTable.h @@ -98,8 +98,8 @@ // } llvm::ArrayRef getReduceRules(StateID State) const { assert(State + 1u < ReduceOffset.size()); - return llvm::makeArrayRef(Reduces.data() + ReduceOffset[State], - Reduces.data() + ReduceOffset[State+1]); + return llvm::ArrayRef(Reduces.data() + ReduceOffset[State], + Reduces.data() + ReduceOffset[State + 1]); } // Returns whether Terminal can follow Nonterminal in a valid source file. bool canFollow(SymbolID Nonterminal, SymbolID Terminal) const { @@ -113,8 +113,8 @@ // Looks up available recovery actions if we stopped parsing in this state. llvm::ArrayRef getRecovery(StateID State) const { - return llvm::makeArrayRef(Recoveries.data() + RecoveryOffset[State], - Recoveries.data() + RecoveryOffset[State + 1]); + return llvm::ArrayRef(Recoveries.data() + RecoveryOffset[State], + Recoveries.data() + RecoveryOffset[State + 1]); } // Returns the state from which the LR parser should start to parse the input Index: clang-tools-extra/pseudo/lib/Forest.cpp =================================================================== --- clang-tools-extra/pseudo/lib/Forest.cpp +++ clang-tools-extra/pseudo/lib/Forest.cpp @@ -192,7 +192,7 @@ /*Start=*/Index, /*TerminalData*/ 0); ++Index; NodeCount = Index; - return llvm::makeArrayRef(Terminals, Index); + return llvm::ArrayRef(Terminals, Index); } } // namespace pseudo Index: clang-tools-extra/pseudo/lib/GLR.cpp =================================================================== --- clang-tools-extra/pseudo/lib/GLR.cpp +++ clang-tools-extra/pseudo/lib/GLR.cpp @@ -236,7 +236,7 @@ Shifts.push_back({*S, H}); llvm::stable_sort(Shifts, llvm::less_first{}); - auto Rest = llvm::makeArrayRef(Shifts); + auto Rest = llvm::ArrayRef(Shifts); llvm::SmallVector Parents; while (!Rest.empty()) { // Collect the batch of PendingShift that have compatible shift states. Index: clang-tools-extra/pseudo/lib/grammar/Grammar.cpp =================================================================== --- clang-tools-extra/pseudo/lib/grammar/Grammar.cpp +++ clang-tools-extra/pseudo/lib/grammar/Grammar.cpp @@ -32,7 +32,7 @@ assert(isNonterminal(SID)); const auto &R = T->Nonterminals[SID].RuleRange; assert(R.End <= T->Rules.size()); - return llvm::makeArrayRef(&T->Rules[R.Start], R.End - R.Start); + return llvm::ArrayRef(&T->Rules[R.Start], R.End - R.Start); } const Rule &Grammar::lookupRule(RuleID RID) const { @@ -180,7 +180,7 @@ TerminalNames[tok::kw_##Keyword] = llvm::StringRef(#Keyword).upper(); #define TOK(Tok) TerminalNames[tok::Tok] = llvm::StringRef(#Tok).upper(); #include "clang/Basic/TokenKinds.def" - return llvm::makeArrayRef(TerminalNames, NumTerminals); + return llvm::ArrayRef(TerminalNames, NumTerminals); }(); return TerminalNames; } Index: clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp =================================================================== --- clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp +++ clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp @@ -19,7 +19,7 @@ {Colours::Yellow, "Yellow"}, {Colours::Green, "Green"}, {Colours::Blue, "Blue"}, {Colours::Indigo, "Indigo"}, {Colours::Violet, "Violet"}}; - return makeArrayRef(Mapping); + return ArrayRef(Mapping); } }; Index: clang/include/clang/AST/Decl.h =================================================================== --- clang/include/clang/AST/Decl.h +++ clang/include/clang/AST/Decl.h @@ -3208,7 +3208,7 @@ 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(); } Index: clang/include/clang/AST/DeclCXX.h =================================================================== --- clang/include/clang/AST/DeclCXX.h +++ clang/include/clang/AST/DeclCXX.h @@ -357,11 +357,11 @@ } 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 @@ /// 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 @@ 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; Index: clang/include/clang/AST/DeclObjC.h =================================================================== --- clang/include/clang/AST/DeclObjC.h +++ clang/include/clang/AST/DeclObjC.h @@ -373,8 +373,7 @@ // 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) { Index: clang/include/clang/AST/DeclOpenMP.h =================================================================== --- clang/include/clang/AST/DeclOpenMP.h +++ clang/include/clang/AST/DeclOpenMP.h @@ -118,7 +118,7 @@ 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 @@ ArrayRef getVars() const { auto **Storage = reinterpret_cast(Data->getChildren().data()); - return llvm::makeArrayRef(Storage, Data->getNumChildren()); + return llvm::ArrayRef(Storage, Data->getNumChildren()); } MutableArrayRef getVars() { Index: clang/include/clang/AST/DeclTemplate.h =================================================================== --- clang/include/clang/AST/DeclTemplate.h +++ clang/include/clang/AST/DeclTemplate.h @@ -129,11 +129,9 @@ 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 @@ /// 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 @@ unsigned getNumTemplateArgs() const { return NumArgs; } llvm::ArrayRef arguments() const { - return llvm::makeArrayRef(getTemplateArgs(), getNumTemplateArgs()); + return llvm::ArrayRef(getTemplateArgs(), getNumTemplateArgs()); } /// Returns the nth template argument. Index: clang/include/clang/AST/Expr.h =================================================================== --- clang/include/clang/AST/Expr.h +++ clang/include/clang/AST/Expr.h @@ -3020,7 +3020,7 @@ /// 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 @@ /// 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 @@ 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 @@ 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 @@ ArrayRef subExpressions() { auto *B = getTrailingObjects(); - return llvm::makeArrayRef(B, B + NumExprs); + return llvm::ArrayRef(B, B + NumExprs); } ArrayRef subExpressions() const { Index: clang/include/clang/AST/ExprCXX.h =================================================================== --- clang/include/clang/AST/ExprCXX.h +++ clang/include/clang/AST/ExprCXX.h @@ -2744,8 +2744,7 @@ /// Retrieve the argument types. ArrayRef getArgs() const { - return llvm::makeArrayRef(getTrailingObjects(), - getNumArgs()); + return llvm::ArrayRef(getTrailingObjects(), getNumArgs()); } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } @@ -3391,8 +3390,7 @@ ArrayRef objects); ArrayRef getObjects() const { - return llvm::makeArrayRef(getTrailingObjects(), - getNumObjects()); + return llvm::ArrayRef(getTrailingObjects(), getNumObjects()); } unsigned getNumObjects() const { return ExprWithCleanupsBits.NumObjects; } @@ -4243,7 +4241,7 @@ 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; } @@ -4788,21 +4786,19 @@ void updateDependence() { setDependence(computeDependence(this)); } ArrayRef getInitExprs() { - return llvm::makeArrayRef(getTrailingObjects(), NumExprs); + return llvm::ArrayRef(getTrailingObjects(), NumExprs); } const ArrayRef getInitExprs() const { - return llvm::makeArrayRef(getTrailingObjects(), NumExprs); + return llvm::ArrayRef(getTrailingObjects(), NumExprs); } ArrayRef getUserSpecifiedInitExprs() { - return llvm::makeArrayRef(getTrailingObjects(), - NumUserSpecifiedExprs); + return llvm::ArrayRef(getTrailingObjects(), NumUserSpecifiedExprs); } const ArrayRef getUserSpecifiedInitExprs() const { - return llvm::makeArrayRef(getTrailingObjects(), - NumUserSpecifiedExprs); + return llvm::ArrayRef(getTrailingObjects(), NumUserSpecifiedExprs); } SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; } Index: clang/include/clang/AST/ExprObjC.h =================================================================== --- clang/include/clang/AST/ExprObjC.h +++ clang/include/clang/AST/ExprObjC.h @@ -1415,11 +1415,10 @@ 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]; } Index: clang/include/clang/AST/ExprOpenMP.h =================================================================== --- clang/include/clang/AST/ExprOpenMP.h +++ clang/include/clang/AST/ExprOpenMP.h @@ -202,12 +202,12 @@ /// 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. Index: clang/include/clang/AST/OpenMPClause.h =================================================================== --- clang/include/clang/AST/OpenMPClause.h +++ clang/include/clang/AST/OpenMPClause.h @@ -336,7 +336,7 @@ /// 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ varlist_size()); } ArrayRef getInscanCopyArrayElems() const { - return llvm::makeArrayRef(getInscanCopyArrayTemps().end(), varlist_size()); + return llvm::ArrayRef(getInscanCopyArrayTemps().end(), varlist_size()); } public: @@ -3476,7 +3476,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ /// 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 @@ /// 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 @@ /// 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 @@ 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 @@ 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 @@ return MutableArrayRef(varlist_end(), varlist_size()); } ArrayRef getPrivateRefs() const { - return llvm::makeArrayRef(varlist_end(), varlist_size()); + return llvm::ArrayRef(varlist_end(), varlist_size()); } public: Index: clang/include/clang/AST/PropertiesBase.td =================================================================== --- clang/include/clang/AST/PropertiesBase.td +++ clang/include/clang/AST/PropertiesBase.td @@ -827,6 +827,6 @@ 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())); }]>; } Index: clang/include/clang/AST/Stmt.h =================================================================== --- clang/include/clang/AST/Stmt.h +++ clang/include/clang/AST/Stmt.h @@ -1916,7 +1916,7 @@ 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; } @@ -3327,16 +3327,16 @@ //===--- 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]; } Index: clang/include/clang/AST/StmtOpenMP.h =================================================================== --- clang/include/clang/AST/StmtOpenMP.h +++ clang/include/clang/AST/StmtOpenMP.h @@ -399,8 +399,9 @@ 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 @@ getClausesOfKind(ArrayRef Clauses) { return {specific_clause_iterator(Clauses), specific_clause_iterator( - llvm::makeArrayRef(Clauses.end(), 0))}; + llvm::ArrayRef(Clauses.end(), (size_t)0))}; } template Index: clang/include/clang/AST/TemplateBase.h =================================================================== --- clang/include/clang/AST/TemplateBase.h +++ clang/include/clang/AST/TemplateBase.h @@ -319,7 +319,7 @@ 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 @@ /// 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 @@ /// 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 @@ 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 { Index: clang/include/clang/AST/TemplateName.h =================================================================== --- clang/include/clang/AST/TemplateName.h +++ clang/include/clang/AST/TemplateName.h @@ -126,7 +126,7 @@ iterator end() const { return getStorage() + Bits.Data; } llvm::ArrayRef decls() const { - return llvm::makeArrayRef(begin(), end()); + return llvm::ArrayRef(begin(), end()); } }; Index: clang/include/clang/AST/Type.h =================================================================== --- clang/include/clang/AST/Type.h +++ clang/include/clang/AST/Type.h @@ -4232,7 +4232,7 @@ } ArrayRef getParamTypes() const { - return llvm::makeArrayRef(param_type_begin(), param_type_end()); + return llvm::ArrayRef(param_type_begin(), param_type_end()); } ExtProtoInfo getExtProtoInfo() const { @@ -4379,7 +4379,7 @@ 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 { @@ -4393,7 +4393,7 @@ 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 { @@ -6130,8 +6130,7 @@ /// 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. Index: clang/include/clang/AST/TypeLoc.h =================================================================== --- clang/include/clang/AST/TypeLoc.h +++ clang/include/clang/AST/TypeLoc.h @@ -814,7 +814,7 @@ } ArrayRef getProtocolLocs() const { - return llvm::makeArrayRef(getProtocolLocArray(), getNumProtocols()); + return llvm::ArrayRef(getProtocolLocArray(), getNumProtocols()); } void initializeLocal(ASTContext &Context, SourceLocation Loc); @@ -1020,7 +1020,7 @@ ArrayRef getProtocolLocs() const { - return llvm::makeArrayRef(getProtocolLocArray(), getNumProtocols()); + return llvm::ArrayRef(getProtocolLocArray(), getNumProtocols()); } bool hasBaseTypeAsWritten() const { @@ -1447,7 +1447,7 @@ } ArrayRef getParams() const { - return llvm::makeArrayRef(getParmArray(), getNumParams()); + return llvm::ArrayRef(getParmArray(), getNumParams()); } // ParmVarDecls* are stored after Info, one for each parameter. Index: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h =================================================================== --- clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h +++ clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h @@ -1430,9 +1430,7 @@ 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) { Index: clang/include/clang/Basic/Diagnostic.h =================================================================== --- clang/include/clang/Basic/Diagnostic.h +++ clang/include/clang/Basic/Diagnostic.h @@ -1722,9 +1722,7 @@ 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 @@ 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. Index: clang/include/clang/Basic/SyncScope.h =================================================================== --- clang/include/clang/Basic/SyncScope.h +++ clang/include/clang/Basic/SyncScope.h @@ -145,7 +145,7 @@ 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 @@ 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 { Index: clang/include/clang/CodeGen/CGFunctionInfo.h =================================================================== --- clang/include/clang/CodeGen/CGFunctionInfo.h +++ clang/include/clang/CodeGen/CGFunctionInfo.h @@ -371,7 +371,7 @@ dyn_cast(UnpaddedCoerceAndExpandType)) { return structTy->elements(); } else { - return llvm::makeArrayRef(&UnpaddedCoerceAndExpandType, 1); + return llvm::ArrayRef(&UnpaddedCoerceAndExpandType, 1); } } @@ -713,7 +713,7 @@ ArrayRef getExtParameterInfos() const { if (!HasExtParameterInfos) return {}; - return llvm::makeArrayRef(getExtParameterInfosBuffer(), NumArgs); + return llvm::ArrayRef(getExtParameterInfosBuffer(), NumArgs); } ExtParameterInfo getExtParameterInfo(unsigned argIndex) const { assert(argIndex <= NumArgs); Index: clang/include/clang/Lex/MacroInfo.h =================================================================== --- clang/include/clang/Lex/MacroInfo.h +++ clang/include/clang/Lex/MacroInfo.h @@ -247,7 +247,7 @@ } 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 @@ } ArrayRef overrides() const { - return llvm::makeArrayRef(overrides_begin(), overrides_end()); + return llvm::ArrayRef(overrides_begin(), overrides_end()); } /// \} Index: clang/include/clang/Parse/Parser.h =================================================================== --- clang/include/clang/Parse/Parser.h +++ clang/include/clang/Parse/Parser.h @@ -1233,7 +1233,7 @@ /// 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)) { Index: clang/include/clang/Sema/DeclSpec.h =================================================================== --- clang/include/clang/Sema/DeclSpec.h +++ clang/include/clang/Sema/DeclSpec.h @@ -1513,7 +1513,7 @@ /// 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 @@ } ArrayRef bindings() const { - return llvm::makeArrayRef(Bindings, NumBindings); + return llvm::ArrayRef(Bindings, NumBindings); } bool isSet() const { return LSquareLoc.isValid(); } Index: clang/include/clang/Sema/DelayedDiagnostic.h =================================================================== --- clang/include/clang/Sema/DelayedDiagnostic.h +++ clang/include/clang/Sema/DelayedDiagnostic.h @@ -190,8 +190,8 @@ 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 { Index: clang/include/clang/Sema/Sema.h =================================================================== --- clang/include/clang/Sema/Sema.h +++ clang/include/clang/Sema/Sema.h @@ -803,8 +803,8 @@ 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 @@ 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; } Index: clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h =================================================================== --- clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h +++ clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h @@ -70,7 +70,7 @@ ArrayRef getNameRanges() const { if (MultipleRanges) - return llvm::makeArrayRef(MultipleRanges.get(), NumRanges); + return llvm::ArrayRef(MultipleRanges.get(), NumRanges); return SingleRange; } Index: clang/include/clang/Tooling/Transformer/RewriteRule.h =================================================================== --- clang/include/clang/Tooling/Transformer/RewriteRule.h +++ clang/include/clang/Tooling/Transformer/RewriteRule.h @@ -428,13 +428,13 @@ 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())); } /// @} Index: clang/lib/AST/APValue.cpp =================================================================== --- clang/lib/AST/APValue.cpp +++ clang/lib/AST/APValue.cpp @@ -984,7 +984,7 @@ 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 @@ 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() { Index: clang/lib/AST/ASTContext.cpp =================================================================== --- clang/lib/AST/ASTContext.cpp +++ clang/lib/AST/ASTContext.cpp @@ -5297,7 +5297,7 @@ ObjCProtocolDecl * const *Protocols, unsigned NumProtocols) const { return getObjCObjectType(BaseType, {}, - llvm::makeArrayRef(Protocols, NumProtocols), + llvm::ArrayRef(Protocols, NumProtocols), /*isKindOf=*/false); } Index: clang/lib/AST/ASTDiagnostic.cpp =================================================================== --- clang/lib/AST/ASTDiagnostic.cpp +++ clang/lib/AST/ASTDiagnostic.cpp @@ -227,7 +227,7 @@ 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()); } } Index: clang/lib/AST/ASTImporter.cpp =================================================================== --- clang/lib/AST/ASTImporter.cpp +++ clang/lib/AST/ASTImporter.cpp @@ -895,7 +895,7 @@ return std::move(Err); return TemplateArgument( - llvm::makeArrayRef(ToPack).copy(Importer.getToContext())); + llvm::ArrayRef(ToPack).copy(Importer.getToContext())); } } @@ -3174,10 +3174,10 @@ // 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 @@ 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 @@ 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()); } @@ -8104,7 +8104,7 @@ return CXXUnresolvedConstructExpr::Create( Importer.getToContext(), ToType, ToTypeSourceInfo, ToLParenLoc, - llvm::makeArrayRef(ToArgs), ToRParenLoc); + llvm::ArrayRef(ToArgs), ToRParenLoc); } ExpectedStmt Index: clang/lib/AST/CommentParser.cpp =================================================================== --- clang/lib/AST/CommentParser.cpp +++ clang/lib/AST/CommentParser.cpp @@ -245,7 +245,7 @@ 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 @@ ParsedArgs++; } - return llvm::makeArrayRef(Args, ParsedArgs); + return llvm::ArrayRef(Args, ParsedArgs); } BlockCommandComment *Parser::parseBlockCommand() { @@ -467,16 +467,14 @@ } 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 @@ 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 @@ break; } - return S.actOnParagraphComment(S.copyArray(llvm::makeArrayRef(Content))); + return S.actOnParagraphComment(S.copyArray(llvm::ArrayRef(Content))); } VerbatimBlockComment *Parser::parseVerbatimBlock() { @@ -679,14 +675,13 @@ 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 @@ 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 Index: clang/lib/AST/CommentSema.cpp =================================================================== --- clang/lib/AST/CommentSema.cpp +++ clang/lib/AST/CommentSema.cpp @@ -267,7 +267,7 @@ } 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 @@ 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 @@ 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); Index: clang/lib/AST/ComputeDependence.cpp =================================================================== --- clang/lib/AST/ComputeDependence.cpp +++ clang/lib/AST/ComputeDependence.cpp @@ -594,7 +594,7 @@ 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(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(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; } Index: clang/lib/AST/Decl.cpp =================================================================== --- clang/lib/AST/Decl.cpp +++ clang/lib/AST/Decl.cpp @@ -5368,8 +5368,8 @@ return std::nullopt; const auto *StoredLocs = getTrailingObjects(); - return llvm::makeArrayRef(StoredLocs, - getNumModuleIdentifiers(getImportedModule())); + return llvm::ArrayRef(StoredLocs, + getNumModuleIdentifiers(getImportedModule())); } SourceRange ImportDecl::getSourceRange() const { Index: clang/lib/AST/DeclCXX.cpp =================================================================== --- clang/lib/AST/DeclCXX.cpp +++ clang/lib/AST/DeclCXX.cpp @@ -1637,7 +1637,7 @@ 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 { Index: clang/lib/AST/DeclTemplate.cpp =================================================================== --- clang/lib/AST/DeclTemplate.cpp +++ clang/lib/AST/DeclTemplate.cpp @@ -365,7 +365,7 @@ CommonPtr->InjectedArgs); } - return llvm::makeArrayRef(CommonPtr->InjectedArgs, Params->size()); + return llvm::ArrayRef(CommonPtr->InjectedArgs, Params->size()); } //===----------------------------------------------------------------------===// @@ -1515,8 +1515,8 @@ // template NamedDecl *Params[] = {Index, Ts}; return TemplateParameterList::Create(C, SourceLocation(), SourceLocation(), - llvm::makeArrayRef(Params), - SourceLocation(), nullptr); + llvm::ArrayRef(Params), SourceLocation(), + nullptr); } static TemplateParameterList *createBuiltinTemplateParameterList( Index: clang/lib/AST/ExprCXX.cpp =================================================================== --- clang/lib/AST/ExprCXX.cpp +++ clang/lib/AST/ExprCXX.cpp @@ -1605,7 +1605,7 @@ } TemplateArgument SubstNonTypeTemplateParmPackExpr::getArgumentPack() const { - return TemplateArgument(llvm::makeArrayRef(Arguments, NumArguments)); + return TemplateArgument(llvm::ArrayRef(Arguments, NumArguments)); } FunctionParmPackExpr::FunctionParmPackExpr(QualType T, VarDecl *ParamPack, Index: clang/lib/AST/ExprConstant.cpp =================================================================== --- clang/lib/AST/ExprConstant.cpp +++ clang/lib/AST/ExprConstant.cpp @@ -3660,9 +3660,9 @@ 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(); @@ -7635,7 +7635,7 @@ 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; @@ -10146,7 +10146,7 @@ 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); Index: clang/lib/AST/OpenMPClause.cpp =================================================================== --- clang/lib/AST/OpenMPClause.cpp +++ clang/lib/AST/OpenMPClause.cpp @@ -367,7 +367,7 @@ } ArrayRef OMPOrderedClause::getLoopNumIterations() const { - return llvm::makeArrayRef(getTrailingObjects(), NumberOfLoops); + return llvm::ArrayRef(getTrailingObjects(), NumberOfLoops); } void OMPOrderedClause::setLoopCounter(unsigned NumLoop, Expr *Counter) { Index: clang/lib/AST/ParentMapContext.cpp =================================================================== --- clang/lib/AST/ParentMapContext.cpp +++ clang/lib/AST/ParentMapContext.cpp @@ -99,7 +99,7 @@ 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 @@ 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); Index: clang/lib/AST/TemplateName.cpp =================================================================== --- clang/lib/AST/TemplateName.cpp +++ clang/lib/AST/TemplateName.cpp @@ -35,7 +35,7 @@ TemplateArgument SubstTemplateTemplateParmPackStorage::getArgumentPack() const { - return TemplateArgument(llvm::makeArrayRef(Arguments, Bits.Data)); + return TemplateArgument(llvm::ArrayRef(Arguments, Bits.Data)); } TemplateTemplateParmDecl * Index: clang/lib/AST/Type.cpp =================================================================== --- clang/lib/AST/Type.cpp +++ clang/lib/AST/Type.cpp @@ -1076,7 +1076,7 @@ if (exceptionChanged) { info.ExceptionSpec.Exceptions = - llvm::makeArrayRef(exceptionTypes).copy(Ctx); + llvm::ArrayRef(exceptionTypes).copy(Ctx); } } @@ -1218,10 +1218,10 @@ !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 @@ if (exceptionChanged) { info.ExceptionSpec.Exceptions = - llvm::makeArrayRef(exceptionTypes).copy(Ctx); + llvm::ArrayRef(exceptionTypes).copy(Ctx); } } @@ -3699,7 +3699,7 @@ } TemplateArgument SubstTemplateTypeParmPackType::getArgumentPack() const { - return TemplateArgument(llvm::makeArrayRef(Arguments, getNumArgs())); + return TemplateArgument(llvm::ArrayRef(Arguments, getNumArgs())); } void SubstTemplateTypeParmPackType::Profile(llvm::FoldingSetNodeID &ID) { @@ -3841,7 +3841,7 @@ void ObjCObjectTypeImpl::Profile(llvm::FoldingSetNodeID &ID) { Profile(ID, getBaseType(), getTypeArgsAsWritten(), - llvm::makeArrayRef(qual_begin(), getNumProtocols()), + llvm::ArrayRef(qual_begin(), getNumProtocols()), isKindOfTypeAsWritten()); } @@ -3858,7 +3858,7 @@ void ObjCTypeParamType::Profile(llvm::FoldingSetNodeID &ID) { Profile(ID, getDecl(), getCanonicalTypeInternal(), - llvm::makeArrayRef(qual_begin(), getNumProtocols())); + llvm::ArrayRef(qual_begin(), getNumProtocols())); } namespace { Index: clang/lib/ASTMatchers/Dynamic/Marshallers.cpp =================================================================== --- clang/lib/ASTMatchers/Dynamic/Marshallers.cpp +++ clang/lib/ASTMatchers/Dynamic/Marshallers.cpp @@ -67,8 +67,7 @@ #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 @@ #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 @@ #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 @@ #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; } Index: clang/lib/Analysis/CFG.cpp =================================================================== --- clang/lib/Analysis/CFG.cpp +++ clang/lib/Analysis/CFG.cpp @@ -436,8 +436,8 @@ // 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: Index: clang/lib/Analysis/CalledOnceCheck.cpp =================================================================== --- clang/lib/Analysis/CalledOnceCheck.cpp +++ clang/lib/Analysis/CalledOnceCheck.cpp @@ -880,8 +880,8 @@ 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 @@ 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) { Index: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp =================================================================== --- clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp +++ clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp @@ -277,7 +277,7 @@ } Env.pushCallInternal(Call->getDirectCallee(), - llvm::makeArrayRef(Call->getArgs(), Call->getNumArgs())); + llvm::ArrayRef(Call->getArgs(), Call->getNumArgs())); return Env; } @@ -291,7 +291,7 @@ Env.ThisPointeeLoc = Env.ReturnLoc; Env.pushCallInternal(Call->getConstructor(), - llvm::makeArrayRef(Call->getArgs(), Call->getNumArgs())); + llvm::ArrayRef(Call->getArgs(), Call->getNumArgs())); return Env; } Index: clang/lib/Basic/Module.cpp =================================================================== --- clang/lib/Basic/Module.cpp +++ clang/lib/Basic/Module.cpp @@ -264,7 +264,7 @@ TopHeaderNames.clear(); } - return llvm::makeArrayRef(TopHeaders.begin(), TopHeaders.end()); + return llvm::ArrayRef(TopHeaders.begin(), TopHeaders.end()); } bool Module::directlyUses(const Module *Requested) { Index: clang/lib/Basic/Targets/AArch64.cpp =================================================================== --- clang/lib/Basic/Targets/AArch64.cpp +++ clang/lib/Basic/Targets/AArch64.cpp @@ -624,8 +624,8 @@ } ArrayRef AArch64TargetInfo::getTargetBuiltins() const { - return llvm::makeArrayRef(BuiltinInfo, clang::AArch64::LastTSBuiltin - - Builtin::FirstTSBuiltin); + return llvm::ArrayRef(BuiltinInfo, clang::AArch64::LastTSBuiltin - + Builtin::FirstTSBuiltin); } Optional> @@ -1177,7 +1177,7 @@ }; ArrayRef AArch64TargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } const TargetInfo::GCCRegAlias AArch64TargetInfo::GCCRegAliases[] = { @@ -1220,7 +1220,7 @@ }; ArrayRef AArch64TargetInfo::getGCCRegAliases() const { - return llvm::makeArrayRef(GCCRegAliases); + return llvm::ArrayRef(GCCRegAliases); } bool AArch64TargetInfo::validateAsmConstraint( Index: clang/lib/Basic/Targets/AMDGPU.cpp =================================================================== --- clang/lib/Basic/Targets/AMDGPU.cpp +++ clang/lib/Basic/Targets/AMDGPU.cpp @@ -173,7 +173,7 @@ }; ArrayRef AMDGPUTargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } bool AMDGPUTargetInfo::initFeatureMap( @@ -429,8 +429,8 @@ } 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, Index: clang/lib/Basic/Targets/ARC.h =================================================================== --- clang/lib/Basic/Targets/ARC.h +++ clang/lib/Basic/Targets/ARC.h @@ -56,7 +56,7 @@ "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 { Index: clang/lib/Basic/Targets/ARM.cpp =================================================================== --- clang/lib/Basic/Targets/ARM.cpp +++ clang/lib/Basic/Targets/ARM.cpp @@ -1014,8 +1014,8 @@ }; 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 @@ "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 @@ }; ArrayRef ARMTargetInfo::getGCCRegAliases() const { - return llvm::makeArrayRef(GCCRegAliases); + return llvm::ArrayRef(GCCRegAliases); } bool ARMTargetInfo::validateAsmConstraint( Index: clang/lib/Basic/Targets/AVR.h =================================================================== --- clang/lib/Basic/Targets/AVR.h +++ clang/lib/Basic/Targets/AVR.h @@ -76,7 +76,7 @@ "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 @@ {{"r30", "r31"}, 28}, {{"SPL", "SPH"}, 29}, }; - return llvm::makeArrayRef(AddlRegNames); + return llvm::ArrayRef(AddlRegNames); } bool validateAsmConstraint(const char *&Name, Index: clang/lib/Basic/Targets/BPF.cpp =================================================================== --- clang/lib/Basic/Targets/BPF.cpp +++ clang/lib/Basic/Targets/BPF.cpp @@ -43,8 +43,8 @@ } 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, Index: clang/lib/Basic/Targets/CSKY.cpp =================================================================== --- clang/lib/Basic/Targets/CSKY.cpp +++ clang/lib/Basic/Targets/CSKY.cpp @@ -213,7 +213,7 @@ "fr31", }; - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } ArrayRef CSKYTargetInfo::getGCCRegAliases() const { @@ -285,7 +285,7 @@ {{"vr31"}, "fr31"}, }; - return llvm::makeArrayRef(GCCRegAliases); + return llvm::ArrayRef(GCCRegAliases); } bool CSKYTargetInfo::validateAsmConstraint( Index: clang/lib/Basic/Targets/Hexagon.cpp =================================================================== --- clang/lib/Basic/Targets/Hexagon.cpp +++ clang/lib/Basic/Targets/Hexagon.cpp @@ -182,7 +182,7 @@ }; ArrayRef HexagonTargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } const TargetInfo::GCCRegAlias HexagonTargetInfo::GCCRegAliases[] = { @@ -192,7 +192,7 @@ }; ArrayRef HexagonTargetInfo::getGCCRegAliases() const { - return llvm::makeArrayRef(GCCRegAliases); + return llvm::ArrayRef(GCCRegAliases); } static constexpr Builtin::Info BuiltinInfo[] = { @@ -250,6 +250,6 @@ } ArrayRef HexagonTargetInfo::getTargetBuiltins() const { - return llvm::makeArrayRef(BuiltinInfo, clang::Hexagon::LastTSBuiltin - - Builtin::FirstTSBuiltin); + return llvm::ArrayRef(BuiltinInfo, clang::Hexagon::LastTSBuiltin - + Builtin::FirstTSBuiltin); } Index: clang/lib/Basic/Targets/Lanai.cpp =================================================================== --- clang/lib/Basic/Targets/Lanai.cpp +++ clang/lib/Basic/Targets/Lanai.cpp @@ -24,7 +24,7 @@ }; ArrayRef LanaiTargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } const TargetInfo::GCCRegAlias LanaiTargetInfo::GCCRegAliases[] = { @@ -33,7 +33,7 @@ }; ArrayRef LanaiTargetInfo::getGCCRegAliases() const { - return llvm::makeArrayRef(GCCRegAliases); + return llvm::ArrayRef(GCCRegAliases); } bool LanaiTargetInfo::isValidCPUName(StringRef Name) const { Index: clang/lib/Basic/Targets/LoongArch.cpp =================================================================== --- clang/lib/Basic/Targets/LoongArch.cpp +++ clang/lib/Basic/Targets/LoongArch.cpp @@ -32,7 +32,7 @@ "$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 @@ {{"$fs2"}, "$f26"}, {{"$fs3"}, "$f27"}, {{"$fs4"}, "$f28"}, {{"$fs5"}, "$f29"}, {{"$fs6"}, "$f30"}, {{"$fs7"}, "$f31"}, }; - return llvm::makeArrayRef(GCCRegAliases); + return llvm::ArrayRef(GCCRegAliases); } bool LoongArchTargetInfo::validateAsmConstraint( @@ -190,8 +190,8 @@ } 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( Index: clang/lib/Basic/Targets/M68k.cpp =================================================================== --- clang/lib/Basic/Targets/M68k.cpp +++ clang/lib/Basic/Targets/M68k.cpp @@ -137,7 +137,7 @@ "pc"}; ArrayRef M68kTargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } ArrayRef M68kTargetInfo::getGCCRegAliases() const { Index: clang/lib/Basic/Targets/MSP430.h =================================================================== --- clang/lib/Basic/Targets/MSP430.h +++ clang/lib/Basic/Targets/MSP430.h @@ -71,7 +71,7 @@ {{"r2"}, "sr"}, {{"r3"}, "cg"}, }; - return llvm::makeArrayRef(GCCRegAliases); + return llvm::ArrayRef(GCCRegAliases); } bool validateAsmConstraint(const char *&Name, Index: clang/lib/Basic/Targets/MSP430.cpp =================================================================== --- clang/lib/Basic/Targets/MSP430.cpp +++ clang/lib/Basic/Targets/MSP430.cpp @@ -22,7 +22,7 @@ }; ArrayRef MSP430TargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } void MSP430TargetInfo::getTargetDefines(const LangOptions &Opts, Index: clang/lib/Basic/Targets/Mips.h =================================================================== --- clang/lib/Basic/Targets/Mips.h +++ clang/lib/Basic/Targets/Mips.h @@ -225,7 +225,7 @@ "$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 @@ {{"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 { Index: clang/lib/Basic/Targets/Mips.cpp =================================================================== --- clang/lib/Basic/Targets/Mips.cpp +++ clang/lib/Basic/Targets/Mips.cpp @@ -220,8 +220,8 @@ } 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 { Index: clang/lib/Basic/Targets/NVPTX.cpp =================================================================== --- clang/lib/Basic/Targets/NVPTX.cpp +++ clang/lib/Basic/Targets/NVPTX.cpp @@ -153,7 +153,7 @@ } ArrayRef NVPTXTargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } bool NVPTXTargetInfo::hasFeature(StringRef Feature) const { @@ -263,6 +263,6 @@ } ArrayRef NVPTXTargetInfo::getTargetBuiltins() const { - return llvm::makeArrayRef(BuiltinInfo, clang::NVPTX::LastTSBuiltin - - Builtin::FirstTSBuiltin); + return llvm::ArrayRef(BuiltinInfo, + clang::NVPTX::LastTSBuiltin - Builtin::FirstTSBuiltin); } Index: clang/lib/Basic/Targets/PPC.cpp =================================================================== --- clang/lib/Basic/Targets/PPC.cpp +++ clang/lib/Basic/Targets/PPC.cpp @@ -754,7 +754,7 @@ }; ArrayRef PPCTargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } const TargetInfo::GCCRegAlias PPCTargetInfo::GCCRegAliases[] = { @@ -785,7 +785,7 @@ }; 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 @@ ArrayRef PPCTargetInfo::getGCCAddlRegNames() const { if (ABI == "elfv2") - return llvm::makeArrayRef(GCCAddlRegNames); + return llvm::ArrayRef(GCCAddlRegNames); else return TargetInfo::getGCCAddlRegNames(); } @@ -854,6 +854,6 @@ } ArrayRef PPCTargetInfo::getTargetBuiltins() const { - return llvm::makeArrayRef(BuiltinInfo, clang::PPC::LastTSBuiltin - - Builtin::FirstTSBuiltin); + return llvm::ArrayRef(BuiltinInfo, + clang::PPC::LastTSBuiltin - Builtin::FirstTSBuiltin); } Index: clang/lib/Basic/Targets/RISCV.cpp =================================================================== --- clang/lib/Basic/Targets/RISCV.cpp +++ clang/lib/Basic/Targets/RISCV.cpp @@ -41,7 +41,7 @@ "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 @@ {{"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 @@ }; 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( Index: clang/lib/Basic/Targets/Sparc.cpp =================================================================== --- clang/lib/Basic/Targets/Sparc.cpp +++ clang/lib/Basic/Targets/Sparc.cpp @@ -33,7 +33,7 @@ }; ArrayRef SparcTargetInfo::getGCCRegNames() const { - return llvm::makeArrayRef(GCCRegNames); + return llvm::ArrayRef(GCCRegNames); } const TargetInfo::GCCRegAlias SparcTargetInfo::GCCRegAliases[] = { @@ -48,7 +48,7 @@ }; ArrayRef SparcTargetInfo::getGCCRegAliases() const { - return llvm::makeArrayRef(GCCRegAliases); + return llvm::ArrayRef(GCCRegAliases); } bool SparcTargetInfo::hasFeature(StringRef Feature) const { Index: clang/lib/Basic/Targets/SystemZ.cpp =================================================================== --- clang/lib/Basic/Targets/SystemZ.cpp +++ clang/lib/Basic/Targets/SystemZ.cpp @@ -46,11 +46,11 @@ }; 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 @@ } ArrayRef SystemZTargetInfo::getTargetBuiltins() const { - return llvm::makeArrayRef(BuiltinInfo, clang::SystemZ::LastTSBuiltin - - Builtin::FirstTSBuiltin); + return llvm::ArrayRef(BuiltinInfo, clang::SystemZ::LastTSBuiltin - + Builtin::FirstTSBuiltin); } Index: clang/lib/Basic/Targets/VE.h =================================================================== --- clang/lib/Basic/Targets/VE.h +++ clang/lib/Basic/Targets/VE.h @@ -83,7 +83,7 @@ "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 @@ {{"s62"}, "sx62"}, {{"s63"}, "sx63"}, }; - return llvm::makeArrayRef(GCCRegAliases); + return llvm::ArrayRef(GCCRegAliases); } bool validateAsmConstraint(const char *&Name, Index: clang/lib/Basic/Targets/VE.cpp =================================================================== --- clang/lib/Basic/Targets/VE.cpp +++ clang/lib/Basic/Targets/VE.cpp @@ -41,6 +41,6 @@ } ArrayRef VETargetInfo::getTargetBuiltins() const { - return llvm::makeArrayRef(BuiltinInfo, - clang::VE::LastTSBuiltin - Builtin::FirstTSBuiltin); + return llvm::ArrayRef(BuiltinInfo, + clang::VE::LastTSBuiltin - Builtin::FirstTSBuiltin); } Index: clang/lib/Basic/Targets/WebAssembly.cpp =================================================================== --- clang/lib/Basic/Targets/WebAssembly.cpp +++ clang/lib/Basic/Targets/WebAssembly.cpp @@ -263,8 +263,8 @@ } 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, Index: clang/lib/Basic/Targets/X86.cpp =================================================================== --- clang/lib/Basic/Targets/X86.cpp +++ clang/lib/Basic/Targets/X86.cpp @@ -1597,19 +1597,19 @@ } 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); } Index: clang/lib/Basic/Targets/XCore.h =================================================================== --- clang/lib/Basic/Targets/XCore.h +++ clang/lib/Basic/Targets/XCore.h @@ -56,7 +56,7 @@ "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 { Index: clang/lib/Basic/Targets/XCore.cpp =================================================================== --- clang/lib/Basic/Targets/XCore.cpp +++ clang/lib/Basic/Targets/XCore.cpp @@ -33,6 +33,6 @@ } ArrayRef XCoreTargetInfo::getTargetBuiltins() const { - return llvm::makeArrayRef(BuiltinInfo, clang::XCore::LastTSBuiltin - - Builtin::FirstTSBuiltin); + return llvm::ArrayRef(BuiltinInfo, + clang::XCore::LastTSBuiltin - Builtin::FirstTSBuiltin); } Index: clang/lib/CodeGen/CGBuiltin.cpp =================================================================== --- clang/lib/CodeGen/CGBuiltin.cpp +++ clang/lib/CodeGen/CGBuiltin.cpp @@ -4247,7 +4247,7 @@ 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 @@ 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 @@ // 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 @@ 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 @@ 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 @@ // 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 @@ 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 @@ 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 @@ } } - auto SISDMap = makeArrayRef(AArch64SISDIntrinsicMap); + auto SISDMap = ArrayRef(AArch64SISDIntrinsicMap); const ARMVectorIntrinsicInfo *Builtin = findARMVectorIntrinsicInMap( SISDMap, BuiltinID, AArch64SISDIntrinsicsProvenSorted); @@ -12045,7 +12039,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ } 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 @@ 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 @@ 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 @@ } } - 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 @@ } } - 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 @@ } 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 @@ 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 @@ } 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 @@ 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 @@ } 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 @@ } 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ // 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()); } Index: clang/lib/CodeGen/CGExprConstant.cpp =================================================================== --- clang/lib/CodeGen/CGExprConstant.cpp +++ clang/lib/CodeGen/CGExprConstant.cpp @@ -543,8 +543,8 @@ } 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 @@ 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 { Index: clang/lib/CodeGen/CGExprScalar.cpp =================================================================== --- clang/lib/CodeGen/CGExprScalar.cpp +++ clang/lib/CodeGen/CGExprScalar.cpp @@ -4931,8 +4931,7 @@ 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 Index: clang/lib/CodeGen/CGObjCGNU.cpp =================================================================== --- clang/lib/CodeGen/CGObjCGNU.cpp +++ clang/lib/CodeGen/CGObjCGNU.cpp @@ -1064,7 +1064,7 @@ // 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::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); Index: clang/lib/CodeGen/CGOpenMPRuntime.cpp =================================================================== --- clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ clang/lib/CodeGen/CGOpenMPRuntime.cpp @@ -8759,7 +8759,7 @@ 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; @@ -11603,7 +11603,7 @@ 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, Index: clang/lib/CodeGen/CGStmtOpenMP.cpp =================================================================== --- clang/lib/CodeGen/CGStmtOpenMP.cpp +++ clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -5327,8 +5327,8 @@ *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); Index: clang/lib/CodeGen/CodeGenFunction.cpp =================================================================== --- clang/lib/CodeGen/CodeGenFunction.cpp +++ clang/lib/CodeGen/CodeGenFunction.cpp @@ -848,8 +848,8 @@ 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) Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -5697,7 +5697,7 @@ // 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); Index: clang/lib/CodeGen/CodeGenPGO.cpp =================================================================== --- clang/lib/CodeGen/CodeGenPGO.cpp +++ clang/lib/CodeGen/CodeGenPGO.cpp @@ -755,7 +755,7 @@ 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 @@ } 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 @@ 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) { Index: clang/lib/CodeGen/CodeGenTypes.cpp =================================================================== --- clang/lib/CodeGen/CodeGenTypes.cpp +++ clang/lib/CodeGen/CodeGenTypes.cpp @@ -807,8 +807,8 @@ 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; } Index: clang/lib/CodeGen/ConstantInitBuilder.cpp =================================================================== --- clang/lib/CodeGen/ConstantInitBuilder.cpp +++ clang/lib/CodeGen/ConstantInitBuilder.cpp @@ -268,7 +268,7 @@ 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 @@ 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); Index: clang/lib/CodeGen/CoverageMappingGen.cpp =================================================================== --- clang/lib/CodeGen/CoverageMappingGen.cpp +++ clang/lib/CodeGen/CoverageMappingGen.cpp @@ -1630,7 +1630,7 @@ #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 @@ 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 @@ 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 @@ #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()); Index: clang/lib/CodeGen/MicrosoftCXXABI.cpp =================================================================== --- clang/lib/CodeGen/MicrosoftCXXABI.cpp +++ clang/lib/CodeGen/MicrosoftCXXABI.cpp @@ -4142,7 +4142,7 @@ 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::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; { Index: clang/lib/CodeGen/TargetInfo.cpp =================================================================== --- clang/lib/CodeGen/TargetInfo.cpp +++ clang/lib/CodeGen/TargetInfo.cpp @@ -9848,7 +9848,7 @@ // 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. Index: clang/lib/Driver/Job.cpp =================================================================== --- clang/lib/Driver/Job.cpp +++ clang/lib/Driver/Job.cpp @@ -353,7 +353,7 @@ 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 @@ RedirectFilesOptional.push_back(std::nullopt); return llvm::sys::ExecuteAndWait(Executable, Args, Env, - makeArrayRef(RedirectFilesOptional), + ArrayRef(RedirectFilesOptional), /*secondsToWait=*/0, /*memoryLimit=*/0, ErrMsg, ExecutionFailed, &ProcStat); } Index: clang/lib/Driver/ToolChains/Darwin.cpp =================================================================== --- clang/lib/Driver/ToolChains/Darwin.cpp +++ clang/lib/Driver/ToolChains/Darwin.cpp @@ -1809,7 +1809,7 @@ }; 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 @@ } } - 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()], Index: clang/lib/Format/MacroCallReconstructor.cpp =================================================================== --- clang/lib/Format/MacroCallReconstructor.cpp +++ clang/lib/Format/MacroCallReconstructor.cpp @@ -273,7 +273,7 @@ // 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. Index: clang/lib/Frontend/ASTUnit.cpp =================================================================== --- clang/lib/Frontend/ASTUnit.cpp +++ clang/lib/Frontend/ASTUnit.cpp @@ -1761,8 +1761,7 @@ 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; } Index: clang/lib/Interpreter/Interpreter.cpp =================================================================== --- clang/lib/Interpreter/Interpreter.cpp +++ clang/lib/Interpreter/Interpreter.cpp @@ -77,8 +77,7 @@ 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 @@ 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)) Index: clang/lib/Lex/TokenLexer.cpp =================================================================== --- clang/lib/Lex/TokenLexer.cpp +++ clang/lib/Lex/TokenLexer.cpp @@ -204,7 +204,7 @@ 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::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 ## Index: clang/lib/Parse/ParsePragma.cpp =================================================================== --- clang/lib/Parse/ParsePragma.cpp +++ clang/lib/Parse/ParsePragma.cpp @@ -3424,7 +3424,7 @@ 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 @@ markAsReinjectedForRelexing(AttributeTokens); Info->Tokens = - llvm::makeArrayRef(AttributeTokens).copy(PP.getPreprocessorAllocator()); + llvm::ArrayRef(AttributeTokens).copy(PP.getPreprocessorAllocator()); } if (Tok.isNot(tok::eod)) Index: clang/lib/Sema/ParsedAttr.cpp =================================================================== --- clang/lib/Sema/ParsedAttr.cpp +++ clang/lib/Sema/ParsedAttr.cpp @@ -146,7 +146,7 @@ } ArrayRef ParsedAttrInfo::getAllBuiltin() { - return llvm::makeArrayRef(AttrInfoMap); + return llvm::ArrayRef(AttrInfoMap); } unsigned ParsedAttr::getMinArgs() const { return getInfo().NumArgs; } Index: clang/lib/Sema/SemaChecking.cpp =================================================================== --- clang/lib/Sema/SemaChecking.cpp +++ clang/lib/Sema/SemaChecking.cpp @@ -5980,7 +5980,7 @@ ThisTypeFromDecl); } - checkCall(FDecl, Proto, ImplicitThis, llvm::makeArrayRef(Args, NumArgs), + checkCall(FDecl, Proto, ImplicitThis, llvm::ArrayRef(Args, NumArgs), IsMemberFunction, TheCall->getRParenLoc(), TheCall->getCallee()->getSourceRange(), CallType); @@ -6061,7 +6061,7 @@ } 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); @@ -6074,7 +6074,7 @@ 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); Index: clang/lib/Sema/SemaCodeComplete.cpp =================================================================== --- clang/lib/Sema/SemaCodeComplete.cpp +++ clang/lib/Sema/SemaCodeComplete.cpp @@ -10100,7 +10100,7 @@ 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"))); Index: clang/lib/Sema/SemaDeclCXX.cpp =================================================================== --- clang/lib/Sema/SemaDeclCXX.cpp +++ clang/lib/Sema/SemaDeclCXX.cpp @@ -7642,10 +7642,8 @@ 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)); } } @@ -10205,10 +10203,12 @@ 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)); } @@ -15799,19 +15799,16 @@ 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; } @@ -18412,27 +18409,27 @@ 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; Index: clang/lib/Sema/SemaExpr.cpp =================================================================== --- clang/lib/Sema/SemaExpr.cpp +++ clang/lib/Sema/SemaExpr.cpp @@ -1623,10 +1623,9 @@ 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 @@ 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) @@ -7039,7 +7038,7 @@ 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 @@ -19972,7 +19971,7 @@ 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, Index: clang/lib/Sema/SemaExprCXX.cpp =================================================================== --- clang/lib/Sema/SemaExprCXX.cpp +++ clang/lib/Sema/SemaExprCXX.cpp @@ -3120,7 +3120,7 @@ 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 @@ 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 @@ 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); Index: clang/lib/Sema/SemaExprObjC.cpp =================================================================== --- clang/lib/Sema/SemaExprObjC.cpp +++ 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 @@ 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 @@ 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 @@ 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 @@ // 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 @@ 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 @@ // 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 @@ } } } - checkFoundationAPI(*this, SelLoc, Method, makeArrayRef(Args, NumArgs), + checkFoundationAPI(*this, SelLoc, Method, ArrayRef(Args, NumArgs), ReceiverType, IsClassObjectCall); } Index: clang/lib/Sema/SemaInit.cpp =================================================================== --- clang/lib/Sema/SemaInit.cpp +++ clang/lib/Sema/SemaInit.cpp @@ -7321,11 +7321,11 @@ 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; Index: clang/lib/Sema/SemaLookup.cpp =================================================================== --- clang/lib/Sema/SemaLookup.cpp +++ clang/lib/Sema/SemaLookup.cpp @@ -3469,27 +3469,27 @@ 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"); @@ -4932,9 +4932,9 @@ 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}; Index: clang/lib/Sema/SemaOverload.cpp =================================================================== --- clang/lib/Sema/SemaOverload.cpp +++ clang/lib/Sema/SemaOverload.cpp @@ -3613,7 +3613,7 @@ 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 @@ // 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 @@ // 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 @@ 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(); Index: clang/lib/Sema/SemaRISCVVectorLookup.cpp =================================================================== --- clang/lib/Sema/SemaRISCVVectorLookup.cpp +++ clang/lib/Sema/SemaRISCVVectorLookup.cpp @@ -66,7 +66,7 @@ // 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) { Index: clang/lib/Sema/SemaStmt.cpp =================================================================== --- clang/lib/Sema/SemaStmt.cpp +++ clang/lib/Sema/SemaStmt.cpp @@ -382,7 +382,7 @@ // 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); } Index: clang/lib/Sema/SemaTemplate.cpp =================================================================== --- clang/lib/Sema/SemaTemplate.cpp +++ clang/lib/Sema/SemaTemplate.cpp @@ -1799,8 +1799,7 @@ 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 @@ 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. Index: clang/lib/Sema/SemaTemplateDeduction.cpp =================================================================== --- clang/lib/Sema/SemaTemplateDeduction.cpp +++ clang/lib/Sema/SemaTemplateDeduction.cpp @@ -916,7 +916,7 @@ 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]); Index: clang/lib/Sema/SemaTemplateInstantiate.cpp =================================================================== --- clang/lib/Sema/SemaTemplateInstantiate.cpp +++ clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -953,8 +953,7 @@ 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: Index: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp =================================================================== --- clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -2582,7 +2582,7 @@ if (NumTempParamLists) Method->setTemplateParameterListsInfo( SemaRef.Context, - llvm::makeArrayRef(TempParamLists.data(), NumTempParamLists)); + llvm::ArrayRef(TempParamLists.data(), NumTempParamLists)); Method->setLexicalDeclContext(Owner); Method->setObjectOfFriendDecl(); Index: clang/lib/Sema/SemaType.cpp =================================================================== --- clang/lib/Sema/SemaType.cpp +++ clang/lib/Sema/SemaType.cpp @@ -1097,11 +1097,10 @@ 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 @@ 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); Index: clang/lib/Sema/TreeTransform.h =================================================================== --- clang/lib/Sema/TreeTransform.h +++ clang/lib/Sema/TreeTransform.h @@ -6061,8 +6061,8 @@ 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; @@ -6073,7 +6073,7 @@ 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(); @@ -7222,12 +7222,10 @@ 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(); } @@ -7347,7 +7345,7 @@ 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()) @@ -7910,8 +7908,7 @@ 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; Index: clang/lib/Serialization/ASTReader.cpp =================================================================== --- clang/lib/Serialization/ASTReader.cpp +++ clang/lib/Serialization/ASTReader.cpp @@ -1224,7 +1224,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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()) { Index: clang/lib/Serialization/ASTWriter.cpp =================================================================== --- clang/lib/Serialization/ASTWriter.cpp +++ clang/lib/Serialization/ASTWriter.cpp @@ -5308,7 +5308,7 @@ break; case UPD_ADDED_ATTR_TO_RECORD: - Record.AddAttributes(llvm::makeArrayRef(Update.getAttr())); + Record.AddAttributes(llvm::ArrayRef(Update.getAttr())); break; } } Index: clang/lib/Serialization/ASTWriterDecl.cpp =================================================================== --- clang/lib/Serialization/ASTWriterDecl.cpp +++ clang/lib/Serialization/ASTWriterDecl.cpp @@ -223,7 +223,7 @@ 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 @@ 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 @@ 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()); } Index: clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp =================================================================== --- clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp +++ clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp @@ -372,7 +372,7 @@ 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; Index: clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp =================================================================== --- clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp +++ clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp @@ -116,7 +116,7 @@ "ast-api-dump-tool", OFS); std::unique_ptr Comp( - Driver->BuildCompilation(llvm::makeArrayRef(Argv))); + Driver->BuildCompilation(llvm::ArrayRef(Argv))); if (!Comp) return 1; Index: clang/lib/Tooling/InterpolatingCompilationDatabase.cpp =================================================================== --- clang/lib/Tooling/InterpolatingCompilationDatabase.cpp +++ clang/lib/Tooling/InterpolatingCompilationDatabase.cpp @@ -147,7 +147,7 @@ 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()}; } Index: clang/lib/Tooling/Syntax/BuildTree.cpp =================================================================== --- clang/lib/Tooling/Syntax/BuildTree.cpp +++ clang/lib/Tooling/Syntax/BuildTree.cpp @@ -469,7 +469,7 @@ 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 @@ 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 @@ // 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 @@ 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); Index: clang/lib/Tooling/Syntax/ComputeReplacements.cpp =================================================================== --- clang/lib/Tooling/Syntax/ComputeReplacements.cpp +++ clang/lib/Tooling/Syntax/ComputeReplacements.cpp @@ -31,7 +31,7 @@ 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 @@ } // 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 @@ // 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; } Index: clang/lib/Tooling/Syntax/Tokens.cpp =================================================================== --- clang/lib/Tooling/Syntax/Tokens.cpp +++ clang/lib/Tooling/Syntax/Tokens.cpp @@ -425,8 +425,8 @@ // 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 @@ 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::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 @@ 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 @@ 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; Index: clang/lib/Tooling/Tooling.cpp =================================================================== --- clang/lib/Tooling/Tooling.cpp +++ clang/lib/Tooling/Tooling.cpp @@ -364,7 +364,7 @@ // 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 @@ 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( Index: clang/tools/diagtool/DiagnosticNames.cpp =================================================================== --- clang/tools/diagtool/DiagnosticNames.cpp +++ clang/tools/diagtool/DiagnosticNames.cpp @@ -20,7 +20,7 @@ }; llvm::ArrayRef diagtool::getBuiltinDiagnosticsByName() { - return llvm::makeArrayRef(BuiltinDiagnosticsByName); + return llvm::ArrayRef(BuiltinDiagnosticsByName); } @@ -103,5 +103,5 @@ } llvm::ArrayRef diagtool::getDiagnosticGroups() { - return llvm::makeArrayRef(OptionTable); + return llvm::ArrayRef(OptionTable); } Index: clang/tools/diagtool/FindDiagnosticID.cpp =================================================================== --- clang/tools/diagtool/FindDiagnosticID.cpp +++ clang/tools/diagtool/FindDiagnosticID.cpp @@ -47,7 +47,7 @@ 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); Index: clang/tools/driver/driver.cpp =================================================================== --- clang/tools/driver/driver.cpp +++ clang/tools/driver/driver.cpp @@ -350,12 +350,11 @@ 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 << "'. " @@ -387,7 +386,7 @@ // 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) Index: clang/tools/libclang/CIndex.cpp =================================================================== --- clang/tools/libclang/CIndex.cpp +++ clang/tools/libclang/CIndex.cpp @@ -3802,7 +3802,7 @@ // 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())); @@ -3885,7 +3885,7 @@ 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(), @@ -3972,7 +3972,7 @@ 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; @@ -4503,7 +4503,7 @@ 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; @@ -8393,9 +8393,8 @@ 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 = Index: clang/tools/libclang/CIndexCodeCompletion.cpp =================================================================== --- clang/tools/libclang/CIndexCodeCompletion.cpp +++ clang/tools/libclang/CIndexCodeCompletion.cpp @@ -869,7 +869,7 @@ 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; Index: clang/tools/libclang/Indexing.cpp =================================================================== --- clang/tools/libclang/Indexing.cpp +++ clang/tools/libclang/Indexing.cpp @@ -903,9 +903,8 @@ 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; Index: clang/unittests/Driver/ToolChainTest.cpp =================================================================== --- clang/unittests/Driver/ToolChainTest.cpp +++ clang/unittests/Driver/ToolChainTest.cpp @@ -370,7 +370,7 @@ 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 { Index: clang/unittests/Introspection/IntrospectionTest.cpp =================================================================== --- clang/unittests/Introspection/IntrospectionTest.cpp +++ clang/unittests/Introspection/IntrospectionTest.cpp @@ -305,7 +305,7 @@ // 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 @@ 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 @@ // 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 @@ // 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 @@ // 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 @@ // 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 @@ 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 @@ 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 @@ llvm::sort(ExpectedLocations); - EXPECT_EQ(llvm::makeArrayRef(ExpectedLocations), + EXPECT_EQ(llvm::ArrayRef(ExpectedLocations), (ArrayRef>{ STRING_LOCATION_STDPAIR((&NI), getBeginLoc()), STRING_LOCATION_STDPAIR((&NI), getCXXLiteralOperatorNameLoc()), Index: clang/unittests/Lex/LexerTest.cpp =================================================================== --- clang/unittests/Lex/LexerTest.cpp +++ clang/unittests/Lex/LexerTest.cpp @@ -650,7 +650,7 @@ 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)) { Index: clang/unittests/Lex/PPDependencyDirectivesTest.cpp =================================================================== --- clang/unittests/Lex/PPDependencyDirectivesTest.cpp +++ clang/unittests/Lex/PPDependencyDirectivesTest.cpp @@ -112,7 +112,7 @@ 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(); Index: clang/unittests/Tooling/Syntax/TokensTest.cpp =================================================================== --- clang/unittests/Tooling/Syntax/TokensTest.cpp +++ clang/unittests/Tooling/Syntax/TokensTest.cpp @@ -191,7 +191,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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), _))); Index: clang/unittests/Tooling/Syntax/TreeTestBase.cpp =================================================================== --- clang/unittests/Tooling/Syntax/TreeTestBase.cpp +++ clang/unittests/Tooling/Syntax/TreeTestBase.cpp @@ -39,10 +39,10 @@ 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 Index: clang/unittests/Tooling/ToolingTest.cpp =================================================================== --- clang/unittests/Tooling/ToolingTest.cpp +++ clang/unittests/Tooling/ToolingTest.cpp @@ -395,7 +395,7 @@ 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()); } Index: flang/lib/Lower/ConvertVariable.cpp =================================================================== --- flang/lib/Lower/ConvertVariable.cpp +++ flang/lib/Lower/ConvertVariable.cpp @@ -1042,7 +1042,7 @@ auto commonTy = fir::SequenceType::get(shape, i8Ty); auto vecTy = mlir::VectorType::get(sz, i8Ty); mlir::Attribute zero = builder.getIntegerAttr(i8Ty, 0); - auto init = mlir::DenseElementsAttr::get(vecTy, llvm::makeArrayRef(zero)); + auto init = mlir::DenseElementsAttr::get(vecTy, llvm::ArrayRef(zero)); builder.createGlobal(loc, commonTy, commonName, linkage, init); // No need to add any initial value later. return std::nullopt; Index: flang/tools/flang-driver/driver.cpp =================================================================== --- flang/tools/flang-driver/driver.cpp +++ flang/tools/flang-driver/driver.cpp @@ -63,7 +63,7 @@ static int executeFC1Tool(llvm::SmallVectorImpl &argV) { llvm::StringRef tool = argV[1]; if (tool == "-fc1") - return fc1_main(makeArrayRef(argV).slice(2), argV[0]); + return fc1_main(llvm::ArrayRef(argV).slice(2), argV[0]); // Reject unknown tools. // ATM it only supports fc1. Any fc1[*] is rejected. Index: libc/benchmarks/LibcDefaultImplementations.cpp =================================================================== --- libc/benchmarks/LibcDefaultImplementations.cpp +++ libc/benchmarks/LibcDefaultImplementations.cpp @@ -24,30 +24,30 @@ llvm::ArrayRef getMemcpyConfigurations() { static constexpr MemcpyConfiguration kMemcpyConfigurations[] = { {__llvm_libc::memcpy, "__llvm_libc::memcpy"}}; - return llvm::makeArrayRef(kMemcpyConfigurations); + return llvm::ArrayRef(kMemcpyConfigurations); } llvm::ArrayRef getMemmoveConfigurations() { static constexpr MemmoveConfiguration kMemmoveConfigurations[] = { {__llvm_libc::memmove, "__llvm_libc::memmove"}}; - return llvm::makeArrayRef(kMemmoveConfigurations); + return llvm::ArrayRef(kMemmoveConfigurations); } llvm::ArrayRef getMemcmpConfigurations() { static constexpr MemcmpOrBcmpConfiguration kMemcmpConfiguration[] = { {__llvm_libc::memcmp, "__llvm_libc::memcmp"}}; - return llvm::makeArrayRef(kMemcmpConfiguration); + return llvm::ArrayRef(kMemcmpConfiguration); } llvm::ArrayRef getBcmpConfigurations() { static constexpr MemcmpOrBcmpConfiguration kBcmpConfigurations[] = { {__llvm_libc::bcmp, "__llvm_libc::bcmp"}}; - return llvm::makeArrayRef(kBcmpConfigurations); + return llvm::ArrayRef(kBcmpConfigurations); } llvm::ArrayRef getMemsetConfigurations() { static constexpr MemsetConfiguration kMemsetConfigurations[] = { {__llvm_libc::memset, "__llvm_libc::memset"}}; - return llvm::makeArrayRef(kMemsetConfigurations); + return llvm::ArrayRef(kMemsetConfigurations); } llvm::ArrayRef getBzeroConfigurations() { static constexpr BzeroConfiguration kBzeroConfigurations[] = { {__llvm_libc::bzero, "__llvm_libc::bzero"}}; - return llvm::makeArrayRef(kBzeroConfigurations); + return llvm::ArrayRef(kBzeroConfigurations); } Index: libc/benchmarks/LibcMemoryBenchmarkMain.cpp =================================================================== --- libc/benchmarks/LibcMemoryBenchmarkMain.cpp +++ libc/benchmarks/LibcMemoryBenchmarkMain.cpp @@ -97,7 +97,7 @@ CircularArrayRef generateBatch(size_t Iterations) { randomize(); - return cycle(makeArrayRef(Parameters), Iterations); + return cycle(ArrayRef(Parameters), Iterations); } protected: Index: libc/benchmarks/automemcpy/lib/CodeGen.cpp =================================================================== --- libc/benchmarks/automemcpy/lib/CodeGen.cpp +++ libc/benchmarks/automemcpy/lib/CodeGen.cpp @@ -314,7 +314,7 @@ // {"memcpy_0x8661D80472487AB5",{FunctionType::MEMCPY,Contiguous{{0,1}},std::nullopt,std::nullopt,std::nullopt,Accelerator{{1,kMaxSize}},ElementTypeClass::NATIVE}}, // ... // }; -// return makeArrayRef(kDescriptors); +// return ArrayRef(kDescriptors); // } static raw_ostream &operator<<(raw_ostream &Stream, const SizeSpan &SS) { @@ -415,7 +415,7 @@ Stream << kIndent << kIndent << Descriptors[I] << ",\n"; } Stream << R"( }; - return makeArrayRef(kDescriptors); + return ArrayRef(kDescriptors); } )"; } @@ -434,7 +434,7 @@ // {Wrap, "memcpy_0x8661D80472487AB5"}, // ... // }; -// return llvm::makeArrayRef(kConfigurations); +// return llvm::ArrayRef(kConfigurations); // } // The `Wrap` template function is provided in the `Main` function below. @@ -509,7 +509,7 @@ << " kConfigurations[] = {\n"; Stream << C.Descriptors; Stream << kIndent << "};\n"; - Stream << kIndent << "return llvm::makeArrayRef(kConfigurations);\n"; + Stream << kIndent << "return llvm::ArrayRef(kConfigurations);\n"; } Stream << "}\n"; return Stream; Index: libc/benchmarks/automemcpy/unittests/CodeGenTest.cpp =================================================================== --- libc/benchmarks/automemcpy/unittests/CodeGenTest.cpp +++ libc/benchmarks/automemcpy/unittests/CodeGenTest.cpp @@ -148,7 +148,7 @@ {"memset_0x3DF0F44E2ED6A50F",{FunctionType::MEMSET,Contiguous{{0,2}},Overlap{{2,256}},std::nullopt,AlignedLoop{Loop{{256,kMaxSize},32},32,AlignArg::_1},std::nullopt,ElementTypeClass::NATIVE}}, {"bzero_0x475977492C218AD4",{FunctionType::BZERO,Contiguous{{0,4}},Overlap{{4,128}},std::nullopt,AlignedLoop{Loop{{128,kMaxSize},32},32,AlignArg::_1},std::nullopt,ElementTypeClass::NATIVE}}, }; - return makeArrayRef(kDescriptors); + return ArrayRef(kDescriptors); } } // namespace automemcpy @@ -168,7 +168,7 @@ {Wrap, "memcpy_0xE00E29EE73994E2B"}, {Wrap, "memcpy_0x7381B60C7BE75EF9"}, }; - return llvm::makeArrayRef(kConfigurations); + return llvm::ArrayRef(kConfigurations); } using MemcmpStub = int (*)(const char *, const char *, size_t); @@ -182,7 +182,7 @@ static constexpr MemcmpOrBcmpConfiguration kConfigurations[] = { {Wrap, "memcmp_0x348D7BA6DB0EE033"}, }; - return llvm::makeArrayRef(kConfigurations); + return llvm::ArrayRef(kConfigurations); } llvm::ArrayRef getBcmpConfigurations() { return {}; @@ -199,7 +199,7 @@ {Wrap, "memset_0x71E761699B999863"}, {Wrap, "memset_0x3DF0F44E2ED6A50F"}, }; - return llvm::makeArrayRef(kConfigurations); + return llvm::ArrayRef(kConfigurations); } using BzeroStub = void (*)(char *, size_t); @@ -211,7 +211,7 @@ static constexpr BzeroConfiguration kConfigurations[] = { {Wrap, "bzero_0x475977492C218AD4"}, }; - return llvm::makeArrayRef(kConfigurations); + return llvm::ArrayRef(kConfigurations); } llvm::ArrayRef getMemmoveConfigurations() { Index: lld/COFF/Chunks.h =================================================================== --- lld/COFF/Chunks.h +++ lld/COFF/Chunks.h @@ -276,7 +276,7 @@ } ArrayRef getRelocs() const { - return llvm::makeArrayRef(relocsData, relocsSize); + return llvm::ArrayRef(relocsData, relocsSize); } // Reloc setter used by ARM range extension thunk insertion. Index: lld/COFF/DebugTypes.cpp =================================================================== --- lld/COFF/DebugTypes.cpp +++ lld/COFF/DebugTypes.cpp @@ -603,7 +603,7 @@ return; GloballyHashedType *hashes = new GloballyHashedType[hashVec.size()]; memcpy(hashes, hashVec.data(), hashVec.size() * sizeof(GloballyHashedType)); - ghashes = makeArrayRef(hashes, hashVec.size()); + ghashes = ArrayRef(hashes, hashVec.size()); ownedGHashes = true; } @@ -1127,8 +1127,7 @@ // - source 0, type 1... // - source 1, type 0... std::vector entries; - for (const GHashCell &cell : - makeArrayRef(ghashState.table.table, tableSize)) { + for (const GHashCell &cell : ArrayRef(ghashState.table.table, tableSize)) { if (!cell.isEmpty()) entries.push_back(cell); } @@ -1195,8 +1194,8 @@ ctx.tpiSourceList.insert(ctx.tpiSourceList.end(), objs.begin(), objs.end()); for (uint32_t i = 0, e = ctx.tpiSourceList.size(); i < e; ++i) ctx.tpiSourceList[i]->tpiSrcIdx = i; - dependencySources = makeArrayRef(ctx.tpiSourceList.data(), numDeps); - objectSources = makeArrayRef(ctx.tpiSourceList.data() + numDeps, numObjs); + dependencySources = ArrayRef(ctx.tpiSourceList.data(), numDeps); + objectSources = ArrayRef(ctx.tpiSourceList.data() + numDeps, numObjs); } /// Given the index into the ghash table for a particular type, return the type Index: lld/COFF/DriverUtils.cpp =================================================================== --- lld/COFF/DriverUtils.cpp +++ lld/COFF/DriverUtils.cpp @@ -846,8 +846,8 @@ if (!args.hasArg(OPT_lldignoreenv)) addLINK(expandedArgv); cl::ExpandResponseFiles(saver(), getQuotingStyle(args), expandedArgv); - args = optTable.ParseArgs(makeArrayRef(expandedArgv).drop_front(), - missingIndex, missingCount); + args = optTable.ParseArgs(ArrayRef(expandedArgv).drop_front(), missingIndex, + missingCount); // Print the real command line if response files are expanded. if (args.hasArg(OPT_verbose) && argv.size() != expandedArgv.size()) { Index: lld/COFF/PDB.cpp =================================================================== --- lld/COFF/PDB.cpp +++ lld/COFF/PDB.cpp @@ -491,7 +491,7 @@ static void addGlobalSymbol(pdb::GSIStreamBuilder &builder, uint16_t modIndex, unsigned symOffset, std::vector &symStorage) { - CVSymbol sym(makeArrayRef(symStorage)); + CVSymbol sym{ArrayRef(symStorage)}; switch (sym.kind()) { case SymbolKind::S_CONSTANT: case SymbolKind::S_UDT: @@ -505,7 +505,7 @@ // to stabilize it. uint8_t *mem = bAlloc().Allocate(sym.length()); memcpy(mem, sym.data().data(), sym.length()); - builder.addGlobalSymbol(CVSymbol(makeArrayRef(mem, sym.length()))); + builder.addGlobalSymbol(CVSymbol(ArrayRef(mem, sym.length()))); break; } case SymbolKind::S_GPROC32: @@ -1013,7 +1013,7 @@ assert(debugChunk.getOutputSectionIdx() == 0 && "debug sections should not be in output sections"); debugChunk.writeTo(buffer); - return makeArrayRef(buffer, debugChunk.getSize()); + return ArrayRef(buffer, debugChunk.getSize()); } void PDBLinker::addDebugSymbols(TpiSource *source) { @@ -1408,7 +1408,7 @@ ons.Name = "* Linker *"; ons.Signature = 0; - ArrayRef args = makeArrayRef(config->argv).drop_front(); + ArrayRef args = ArrayRef(config->argv).drop_front(); std::string argStr = quote(args); ebs.Fields.push_back("cwd"); SmallString<64> cwd; Index: lld/ELF/Arch/AMDGPU.cpp =================================================================== --- lld/ELF/Arch/AMDGPU.cpp +++ lld/ELF/Arch/AMDGPU.cpp @@ -51,7 +51,7 @@ uint32_t ret = getEFlags(ctx.objectFiles[0]); // Verify that all input files have the same e_flags. - for (InputFile *f : makeArrayRef(ctx.objectFiles).slice(1)) { + for (InputFile *f : ArrayRef(ctx.objectFiles).slice(1)) { if (ret == getEFlags(f)) continue; error("incompatible e_flags: " + toString(f)); @@ -69,7 +69,7 @@ // Verify that all input files have compatible e_flags (same mach, all // features in the same category are either ANY, ANY and ON, or ANY and OFF). - for (InputFile *f : makeArrayRef(ctx.objectFiles).slice(1)) { + for (InputFile *f : ArrayRef(ctx.objectFiles).slice(1)) { if (retMach != (getEFlags(f) & EF_AMDGPU_MACH)) { error("incompatible mach: " + toString(f)); return 0; Index: lld/ELF/Arch/AVR.cpp =================================================================== --- lld/ELF/Arch/AVR.cpp +++ lld/ELF/Arch/AVR.cpp @@ -240,7 +240,7 @@ uint32_t flags = getEFlags(ctx.objectFiles[0]); bool hasLinkRelaxFlag = flags & EF_AVR_LINKRELAX_PREPARED; - for (InputFile *f : makeArrayRef(ctx.objectFiles).slice(1)) { + for (InputFile *f : ArrayRef(ctx.objectFiles).slice(1)) { uint32_t objFlags = getEFlags(f); if ((objFlags & EF_AVR_ARCH_MASK) != (flags & EF_AVR_ARCH_MASK)) error(toString(f) + Index: lld/ELF/Arch/PPC64.cpp =================================================================== --- lld/ELF/Arch/PPC64.cpp +++ lld/ELF/Arch/PPC64.cpp @@ -271,8 +271,8 @@ // instructions and write [first,end). auto *sec = make( nullptr, SHF_ALLOC, SHT_PROGBITS, 4, - makeArrayRef(reinterpret_cast(buf.data() + first), - 4 * (buf.size() - first)), + ArrayRef(reinterpret_cast(buf.data() + first), + 4 * (buf.size() - first)), ".text"); ctx.inputSections.push_back(sec); for (Defined *sym : defined) { Index: lld/ELF/Arch/RISCV.cpp =================================================================== --- lld/ELF/Arch/RISCV.cpp +++ lld/ELF/Arch/RISCV.cpp @@ -620,7 +620,7 @@ // Get st_value delta for symbols relative to this section from the previous // iteration. DenseMap valueDelta; - ArrayRef sa = makeArrayRef(aux.anchors); + ArrayRef sa = ArrayRef(aux.anchors); uint32_t delta = 0; for (auto [i, r] : llvm::enumerate(sec.relocs())) { for (; sa.size() && sa[0].offset <= r.offset; sa = sa.slice(1)) @@ -631,7 +631,7 @@ for (const SymbolAnchor &sa : sa) if (!sa.end) valueDelta[sa.d] = delta; - sa = makeArrayRef(aux.anchors); + sa = ArrayRef(aux.anchors); delta = 0; std::fill_n(aux.relocTypes.get(), sec.relocs().size(), R_RISCV_NONE); Index: lld/ELF/Config.h =================================================================== --- lld/ELF/Config.h +++ lld/ELF/Config.h @@ -450,7 +450,7 @@ // The first two elements of versionDefinitions represent VER_NDX_LOCAL and // VER_NDX_GLOBAL. This helper returns other elements. static inline ArrayRef namedVersionDefs() { - return llvm::makeArrayRef(config->versionDefinitions).slice(2); + return llvm::ArrayRef(config->versionDefinitions).slice(2); } void errorOrWarn(const Twine &msg); Index: lld/ELF/Driver.cpp =================================================================== --- lld/ELF/Driver.cpp +++ lld/ELF/Driver.cpp @@ -2688,7 +2688,7 @@ // compileBitcodeFiles may have produced lto.tmp object files. After this, no // more file will be added. - auto newObjectFiles = makeArrayRef(ctx.objectFiles).slice(numObjsBeforeLTO); + auto newObjectFiles = ArrayRef(ctx.objectFiles).slice(numObjsBeforeLTO); parallelForEach(newObjectFiles, [](ELFFileBase *file) { initSectionsAndLocalSyms(file, /*ignoreComdats=*/true); }); Index: lld/ELF/InputFiles.h =================================================================== --- lld/ELF/InputFiles.h +++ lld/ELF/InputFiles.h @@ -174,11 +174,11 @@ ArrayRef getLocalSymbols() { if (numSymbols == 0) return {}; - return llvm::makeArrayRef(symbols.get() + 1, firstGlobal - 1); + return llvm::ArrayRef(symbols.get() + 1, firstGlobal - 1); } ArrayRef getGlobalSymbols() { - return llvm::makeArrayRef(symbols.get() + firstGlobal, - numSymbols - firstGlobal); + return llvm::ArrayRef(symbols.get() + firstGlobal, + numSymbols - firstGlobal); } MutableArrayRef getMutableGlobalSymbols() { return llvm::makeMutableArrayRef(symbols.get() + firstGlobal, Index: lld/ELF/InputSection.h =================================================================== --- lld/ELF/InputSection.h +++ lld/ELF/InputSection.h @@ -241,7 +241,7 @@ template llvm::ArrayRef getDataAs() const { size_t s = content().size(); assert(s % sizeof(T) == 0); - return llvm::makeArrayRef((const T *)content().data(), s / sizeof(T)); + return llvm::ArrayRef((const T *)content().data(), s / sizeof(T)); } protected: Index: lld/ELF/InputSection.cpp =================================================================== --- lld/ELF/InputSection.cpp +++ lld/ELF/InputSection.cpp @@ -44,7 +44,7 @@ static ArrayRef getSectionContents(ObjFile &file, const typename ELFT::Shdr &hdr) { if (hdr.sh_type == SHT_NOBITS) - return makeArrayRef(nullptr, hdr.sh_size); + return ArrayRef(nullptr, hdr.sh_size); return check(file.getObj().getSectionContents(hdr)); } @@ -139,14 +139,14 @@ typename ELFT::Shdr shdr = cast(file)->getELFShdrs()[relSecIdx]; if (shdr.sh_type == SHT_REL) { - ret.rels = makeArrayRef(reinterpret_cast( - file->mb.getBufferStart() + shdr.sh_offset), - shdr.sh_size / sizeof(typename ELFT::Rel)); + ret.rels = ArrayRef(reinterpret_cast( + file->mb.getBufferStart() + shdr.sh_offset), + shdr.sh_size / sizeof(typename ELFT::Rel)); } else { assert(shdr.sh_type == SHT_RELA); - ret.relas = makeArrayRef(reinterpret_cast( - file->mb.getBufferStart() + shdr.sh_offset), - shdr.sh_size / sizeof(typename ELFT::Rela)); + ret.relas = ArrayRef(reinterpret_cast( + file->mb.getBufferStart() + shdr.sh_offset), + shdr.sh_size / sizeof(typename ELFT::Rela)); } return ret; } Index: lld/ELF/OutputSections.cpp =================================================================== --- lld/ELF/OutputSections.cpp +++ lld/ELF/OutputSections.cpp @@ -397,7 +397,7 @@ // Split input into 1-MiB shards. constexpr size_t shardSize = 1 << 20; - auto shardsIn = split(makeArrayRef(buf.get(), size), shardSize); + auto shardsIn = split(ArrayRef(buf.get(), size), shardSize); const size_t numShards = shardsIn.size(); // Compress shards and compute Alder-32 checksums. Use Z_SYNC_FLUSH for all @@ -697,7 +697,7 @@ storage.insert(storage.end(), isd->sections.begin(), isd->sections.end()); } } - return storage.empty() ? ret : makeArrayRef(storage); + return storage.empty() ? ret : ArrayRef(storage); } // Sorts input sections by section name suffixes, so that .foo.N comes Index: lld/ELF/SyntheticSections.cpp =================================================================== --- lld/ELF/SyntheticSections.cpp +++ lld/ELF/SyntheticSections.cpp @@ -2810,7 +2810,7 @@ }); size_t numSymbols = 0; - for (ArrayRef v : makeArrayRef(symbols.get(), numShards)) + for (ArrayRef v : ArrayRef(symbols.get(), numShards)) numSymbols += v.size(); // The return type is a flattened vector, so we'll copy each vector @@ -3698,7 +3698,7 @@ if (config->emachine == EM_AMDGPU && !ctx.objectFiles.empty()) { uint8_t ver = ctx.objectFiles[0]->abiVersion; - for (InputFile *file : makeArrayRef(ctx.objectFiles).slice(1)) + for (InputFile *file : ArrayRef(ctx.objectFiles).slice(1)) if (file->abiVersion != ver) error("incompatible ABI version: " + toString(file)); return ver; Index: lld/ELF/Writer.cpp =================================================================== --- lld/ELF/Writer.cpp +++ lld/ELF/Writer.cpp @@ -1360,11 +1360,11 @@ } isd->sections.clear(); - for (InputSection *isec : makeArrayRef(unorderedSections).slice(0, insPt)) + for (InputSection *isec : ArrayRef(unorderedSections).slice(0, insPt)) isd->sections.push_back(isec); for (std::pair p : orderedSections) isd->sections.push_back(p.first); - for (InputSection *isec : makeArrayRef(unorderedSections).slice(insPt)) + for (InputSection *isec : ArrayRef(unorderedSections).slice(insPt)) isd->sections.push_back(isec); } @@ -2919,7 +2919,7 @@ }); // Write to the final output buffer. - hashFn(hashBuf.data(), makeArrayRef(hashes.get(), hashesSize)); + hashFn(hashBuf.data(), ArrayRef(hashes.get(), hashesSize)); } template void Writer::writeBuildId() { Index: lldb/include/lldb/Utility/AnsiTerminal.h =================================================================== --- lldb/include/lldb/Utility/AnsiTerminal.h +++ lldb/include/lldb/Utility/AnsiTerminal.h @@ -137,7 +137,7 @@ #undef _TO_STR2 }; // clang-format on - auto codes = llvm::makeArrayRef(g_color_tokens); + auto codes = llvm::ArrayRef(g_color_tokens); static const char tok_hdr[] = "${ansi."; Index: lldb/include/lldb/Utility/Args.h =================================================================== --- lldb/include/lldb/Utility/Args.h +++ lldb/include/lldb/Utility/Args.h @@ -167,7 +167,7 @@ /// have a nullptr const char * at the end, as the size of the list is /// embedded in the ArrayRef object. llvm::ArrayRef GetArgumentArrayRef() const { - return llvm::makeArrayRef(m_argv).drop_back(); + return llvm::ArrayRef(m_argv).drop_back(); } /// Appends a new argument to the end of the list argument list. Index: lldb/source/API/SBDebugger.cpp =================================================================== --- lldb/source/API/SBDebugger.cpp +++ lldb/source/API/SBDebugger.cpp @@ -1645,7 +1645,7 @@ size_t len = 0; while (categories[len] != nullptr) ++len; - return llvm::makeArrayRef(categories, len); + return llvm::ArrayRef(categories, len); } bool SBDebugger::EnableLog(const char *channel, const char **categories) { Index: lldb/source/Breakpoint/BreakpointID.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointID.cpp +++ lldb/source/Breakpoint/BreakpointID.cpp @@ -37,7 +37,7 @@ } llvm::ArrayRef BreakpointID::GetRangeSpecifiers() { - return llvm::makeArrayRef(g_range_specifiers); + return llvm::ArrayRef(g_range_specifiers); } void BreakpointID::GetDescription(Stream *s, lldb::DescriptionLevel level) { Index: lldb/source/Commands/CommandObjectBreakpoint.cpp =================================================================== --- lldb/source/Commands/CommandObjectBreakpoint.cpp +++ lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -55,7 +55,7 @@ ~BreakpointOptionGroup() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_modify_options); + return llvm::ArrayRef(g_breakpoint_modify_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, @@ -185,7 +185,7 @@ ~BreakpointDummyOptionGroup() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_dummy_options); + return llvm::ArrayRef(g_breakpoint_dummy_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, @@ -496,7 +496,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_set_options); + return llvm::ArrayRef(g_breakpoint_set_options); } // Instance variables to hold the values for command options. @@ -1158,7 +1158,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_list_options); + return llvm::ArrayRef(g_breakpoint_list_options); } // Instance variables to hold the values for command options. @@ -1281,7 +1281,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_clear_options); + return llvm::ArrayRef(g_breakpoint_clear_options); } // Instance variables to hold the values for command options. @@ -1438,7 +1438,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_delete_options); + return llvm::ArrayRef(g_breakpoint_delete_options); } // Instance variables to hold the values for command options. @@ -1564,7 +1564,7 @@ ~BreakpointNameOptionGroup() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_name_options); + return llvm::ArrayRef(g_breakpoint_name_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, @@ -1624,7 +1624,7 @@ ~BreakpointAccessOptionGroup() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_access_options); + return llvm::ArrayRef(g_breakpoint_access_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { @@ -2187,7 +2187,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_read_options); + return llvm::ArrayRef(g_breakpoint_read_options); } void HandleOptionArgumentCompletion( @@ -2376,7 +2376,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_write_options); + return llvm::ArrayRef(g_breakpoint_write_options); } // Instance variables to hold the values for command options. Index: lldb/source/Commands/CommandObjectBreakpointCommand.cpp =================================================================== --- lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -317,7 +317,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_command_add_options); + return llvm::ArrayRef(g_breakpoint_command_add_options); } // Instance variables to hold the values for command options. @@ -498,7 +498,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_command_delete_options); + return llvm::ArrayRef(g_breakpoint_command_delete_options); } // Instance variables to hold the values for command options. Index: lldb/source/Commands/CommandObjectCommands.cpp =================================================================== --- lldb/source/Commands/CommandObjectCommands.cpp +++ lldb/source/Commands/CommandObjectCommands.cpp @@ -118,7 +118,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_source_options); + return llvm::ArrayRef(g_source_options); } // Instance variables to hold the values for command options. @@ -212,7 +212,7 @@ ~CommandOptions() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_alias_options); + return llvm::ArrayRef(g_alias_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, @@ -1056,7 +1056,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_regex_options); + return llvm::ArrayRef(g_regex_options); } llvm::StringRef GetHelp() { return m_help; } @@ -1303,7 +1303,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_script_import_options); + return llvm::ArrayRef(g_script_import_options); } bool relative_to_command_file = false; bool silent = false; @@ -1454,7 +1454,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_script_add_options); + return llvm::ArrayRef(g_script_add_options); } // Instance variables to hold the values for command options. @@ -1897,7 +1897,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_container_add_options); + return llvm::ArrayRef(g_container_add_options); } // Instance variables to hold the values for command options. Index: lldb/source/Commands/CommandObjectDiagnostics.cpp =================================================================== --- lldb/source/Commands/CommandObjectDiagnostics.cpp +++ lldb/source/Commands/CommandObjectDiagnostics.cpp @@ -57,7 +57,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_diagnostics_dump_options); + return llvm::ArrayRef(g_diagnostics_dump_options); } FileSpec directory; Index: lldb/source/Commands/CommandObjectDisassemble.cpp =================================================================== --- lldb/source/Commands/CommandObjectDisassemble.cpp +++ lldb/source/Commands/CommandObjectDisassemble.cpp @@ -204,7 +204,7 @@ llvm::ArrayRef CommandObjectDisassemble::CommandOptions::GetDefinitions() { - return llvm::makeArrayRef(g_disassemble_options); + return llvm::ArrayRef(g_disassemble_options); } // CommandObjectDisassemble Index: lldb/source/Commands/CommandObjectExpression.cpp =================================================================== --- lldb/source/Commands/CommandObjectExpression.cpp +++ lldb/source/Commands/CommandObjectExpression.cpp @@ -172,7 +172,7 @@ llvm::ArrayRef CommandObjectExpression::CommandOptions::GetDefinitions() { - return llvm::makeArrayRef(g_expression_options); + return llvm::ArrayRef(g_expression_options); } CommandObjectExpression::CommandObjectExpression( Index: lldb/source/Commands/CommandObjectFrame.cpp =================================================================== --- lldb/source/Commands/CommandObjectFrame.cpp +++ lldb/source/Commands/CommandObjectFrame.cpp @@ -95,7 +95,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_frame_diag_options); + return llvm::ArrayRef(g_frame_diag_options); } // Options. @@ -253,7 +253,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_frame_select_options); + return llvm::ArrayRef(g_frame_select_options); } llvm::Optional relative_frame_offset; @@ -777,7 +777,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_frame_recognizer_add_options); + return llvm::ArrayRef(g_frame_recognizer_add_options); } // Instance variables to hold the values for command options. Index: lldb/source/Commands/CommandObjectHelp.cpp =================================================================== --- lldb/source/Commands/CommandObjectHelp.cpp +++ lldb/source/Commands/CommandObjectHelp.cpp @@ -71,7 +71,7 @@ llvm::ArrayRef CommandObjectHelp::CommandOptions::GetDefinitions() { - return llvm::makeArrayRef(g_help_options); + return llvm::ArrayRef(g_help_options); } bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) { Index: lldb/source/Commands/CommandObjectLog.cpp =================================================================== --- lldb/source/Commands/CommandObjectLog.cpp +++ lldb/source/Commands/CommandObjectLog.cpp @@ -146,7 +146,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_log_enable_options); + return llvm::ArrayRef(g_log_enable_options); } FileSpec log_file; @@ -371,7 +371,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_log_dump_options); + return llvm::ArrayRef(g_log_dump_options); } FileSpec log_file; Index: lldb/source/Commands/CommandObjectMemory.cpp =================================================================== --- lldb/source/Commands/CommandObjectMemory.cpp +++ lldb/source/Commands/CommandObjectMemory.cpp @@ -55,7 +55,7 @@ ~OptionGroupReadMemory() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_memory_read_options); + return llvm::ArrayRef(g_memory_read_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, @@ -903,7 +903,7 @@ ~OptionGroupFindMemory() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_memory_find_options); + return llvm::ArrayRef(g_memory_find_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, @@ -1206,7 +1206,7 @@ ~OptionGroupWriteMemory() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_memory_write_options); + return llvm::ArrayRef(g_memory_write_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, @@ -1664,7 +1664,7 @@ ~OptionGroupMemoryRegion() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_memory_region_options); + return llvm::ArrayRef(g_memory_region_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, Index: lldb/source/Commands/CommandObjectMemoryTag.cpp =================================================================== --- lldb/source/Commands/CommandObjectMemoryTag.cpp +++ lldb/source/Commands/CommandObjectMemoryTag.cpp @@ -144,7 +144,7 @@ ~OptionGroupTagWrite() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_memory_tag_write_options); + return llvm::ArrayRef(g_memory_tag_write_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, Index: lldb/source/Commands/CommandObjectPlatform.cpp =================================================================== --- lldb/source/Commands/CommandObjectPlatform.cpp +++ lldb/source/Commands/CommandObjectPlatform.cpp @@ -126,7 +126,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_permissions_options); + return llvm::ArrayRef(g_permissions_options); } // Instance variables to hold the values for command options. @@ -653,7 +653,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_platform_fread_options); + return llvm::ArrayRef(g_platform_fread_options); } // Instance variables to hold the values for command options. @@ -746,7 +746,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_platform_fwrite_options); + return llvm::ArrayRef(g_platform_fwrite_options); } // Instance variables to hold the values for command options. @@ -1468,7 +1468,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_platform_process_list_options); + return llvm::ArrayRef(g_platform_process_list_options); } // Instance variables to hold the values for command options. @@ -1622,7 +1622,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_platform_process_attach_options); + return llvm::ArrayRef(g_platform_process_attach_options); } // Options table: Required for subclasses of Options. @@ -1708,7 +1708,7 @@ ~CommandOptions() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_platform_shell_options); + return llvm::ArrayRef(g_platform_shell_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, Index: lldb/source/Commands/CommandObjectProcess.cpp =================================================================== --- lldb/source/Commands/CommandObjectProcess.cpp +++ lldb/source/Commands/CommandObjectProcess.cpp @@ -360,7 +360,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_process_attach_options); + return llvm::ArrayRef(g_process_attach_options); } ProcessAttachInfo attach_info; @@ -543,7 +543,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_process_continue_options); + return llvm::ArrayRef(g_process_continue_options); } uint32_t m_ignore = 0; @@ -837,7 +837,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_process_detach_options); + return llvm::ArrayRef(g_process_detach_options); } // Instance variables to hold the values for command options. @@ -920,7 +920,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_process_connect_options); + return llvm::ArrayRef(g_process_connect_options); } // Instance variables to hold the values for command options. @@ -1045,7 +1045,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_process_load_options); + return llvm::ArrayRef(g_process_load_options); } // Instance variables to hold the values for command options. @@ -1361,7 +1361,7 @@ ~CommandOptions() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_process_save_core_options); + return llvm::ArrayRef(g_process_save_core_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, @@ -1483,7 +1483,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_process_status_options); + return llvm::ArrayRef(g_process_status_options); } // Instance variables to hold the values for command options. @@ -1604,7 +1604,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_process_handle_options); + return llvm::ArrayRef(g_process_handle_options); } // Instance variables to hold the values for command options. Index: lldb/source/Commands/CommandObjectRegister.cpp =================================================================== --- lldb/source/Commands/CommandObjectRegister.cpp +++ lldb/source/Commands/CommandObjectRegister.cpp @@ -240,7 +240,7 @@ ~CommandOptions() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_register_read_options); + return llvm::ArrayRef(g_register_read_options); } void OptionParsingStarting(ExecutionContext *execution_context) override { Index: lldb/source/Commands/CommandObjectScript.cpp =================================================================== --- lldb/source/Commands/CommandObjectScript.cpp +++ lldb/source/Commands/CommandObjectScript.cpp @@ -53,7 +53,7 @@ llvm::ArrayRef CommandObjectScript::CommandOptions::GetDefinitions() { - return llvm::makeArrayRef(g_script_options); + return llvm::ArrayRef(g_script_options); } CommandObjectScript::CommandObjectScript(CommandInterpreter &interpreter) Index: lldb/source/Commands/CommandObjectSession.cpp =================================================================== --- lldb/source/Commands/CommandObjectSession.cpp +++ lldb/source/Commands/CommandObjectSession.cpp @@ -117,7 +117,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_history_options); + return llvm::ArrayRef(g_history_options); } // Instance variables to hold the values for command options. Index: lldb/source/Commands/CommandObjectSettings.cpp =================================================================== --- lldb/source/Commands/CommandObjectSettings.cpp +++ lldb/source/Commands/CommandObjectSettings.cpp @@ -120,7 +120,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_settings_set_options); + return llvm::ArrayRef(g_settings_set_options); } // Instance variables to hold the values for command options. @@ -359,7 +359,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_settings_write_options); + return llvm::ArrayRef(g_settings_write_options); } // Instance variables to hold the values for command options. @@ -453,7 +453,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_settings_read_options); + return llvm::ArrayRef(g_settings_read_options); } // Instance variables to hold the values for command options. @@ -1083,7 +1083,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_settings_clear_options); + return llvm::ArrayRef(g_settings_clear_options); } bool m_clear_all = false; Index: lldb/source/Commands/CommandObjectSource.cpp =================================================================== --- lldb/source/Commands/CommandObjectSource.cpp +++ lldb/source/Commands/CommandObjectSource.cpp @@ -98,7 +98,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_source_info_options); + return llvm::ArrayRef(g_source_info_options); } // Instance variables to hold the values for command options. @@ -695,7 +695,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_source_list_options); + return llvm::ArrayRef(g_source_list_options); } // Instance variables to hold the values for command options. Index: lldb/source/Commands/CommandObjectStats.cpp =================================================================== --- lldb/source/Commands/CommandObjectStats.cpp +++ lldb/source/Commands/CommandObjectStats.cpp @@ -88,7 +88,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_statistics_dump_options); + return llvm::ArrayRef(g_statistics_dump_options); } bool m_all_targets = false; Index: lldb/source/Commands/CommandObjectTarget.cpp =================================================================== --- lldb/source/Commands/CommandObjectTarget.cpp +++ lldb/source/Commands/CommandObjectTarget.cpp @@ -153,7 +153,7 @@ ~OptionGroupDependents() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_target_dependents_options); + return llvm::ArrayRef(g_target_dependents_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, @@ -1970,7 +1970,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_target_modules_dump_symtab_options); + return llvm::ArrayRef(g_target_modules_dump_symtab_options); } SortOrder m_sort_order = eSortOrderNone; @@ -2422,7 +2422,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_target_modules_dump_options); + return llvm::ArrayRef(g_target_modules_dump_options); } bool m_verbose; @@ -2932,7 +2932,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_target_modules_list_options); + return llvm::ArrayRef(g_target_modules_list_options); } // Instance variables to hold the values for command options. @@ -3288,7 +3288,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_target_modules_show_unwind_options); + return llvm::ArrayRef(g_target_modules_show_unwind_options); } // Instance variables to hold the values for command options. @@ -3700,7 +3700,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_target_modules_lookup_options); + return llvm::ArrayRef(g_target_modules_lookup_options); } int m_type; // Should be a eLookupTypeXXX enum after parsing options @@ -4529,7 +4529,7 @@ ~CommandOptions() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_target_stop_hook_add_options); + return llvm::ArrayRef(g_target_stop_hook_add_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, Index: lldb/source/Commands/CommandObjectThread.cpp =================================================================== --- lldb/source/Commands/CommandObjectThread.cpp +++ lldb/source/Commands/CommandObjectThread.cpp @@ -95,7 +95,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_thread_backtrace_options); + return llvm::ArrayRef(g_thread_backtrace_options); } // Instance variables to hold the values for command options. @@ -253,7 +253,7 @@ ~ThreadStepScopeOptionGroup() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_thread_step_scope_options); + return llvm::ArrayRef(g_thread_step_scope_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, @@ -873,7 +873,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_thread_until_options); + return llvm::ArrayRef(g_thread_until_options); } uint32_t m_step_thread_idx = LLDB_INVALID_THREAD_ID; @@ -1269,7 +1269,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_thread_info_options); + return llvm::ArrayRef(g_thread_info_options); } bool m_json_thread; @@ -1467,7 +1467,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_thread_return_options); + return llvm::ArrayRef(g_thread_return_options); } bool m_from_expression = false; @@ -1639,7 +1639,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_thread_jump_options); + return llvm::ArrayRef(g_thread_jump_options); } FileSpecList m_filenames; @@ -1773,7 +1773,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_thread_plan_list_options); + return llvm::ArrayRef(g_thread_plan_list_options); } // Instance variables to hold the values for command options. @@ -2153,7 +2153,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_thread_trace_dump_function_calls_options); + return llvm::ArrayRef(g_thread_trace_dump_function_calls_options); } static const size_t kDefaultCount = 20; @@ -2326,7 +2326,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_thread_trace_dump_instructions_options); + return llvm::ArrayRef(g_thread_trace_dump_instructions_options); } static const size_t kDefaultCount = 20; @@ -2460,7 +2460,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_thread_trace_dump_info_options); + return llvm::ArrayRef(g_thread_trace_dump_info_options); } // Instance variables to hold the values for command options. Index: lldb/source/Commands/CommandObjectTrace.cpp =================================================================== --- lldb/source/Commands/CommandObjectTrace.cpp +++ lldb/source/Commands/CommandObjectTrace.cpp @@ -64,7 +64,7 @@ }; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_trace_save_options); + return llvm::ArrayRef(g_trace_save_options); }; bool m_compact; @@ -168,7 +168,7 @@ } ArrayRef GetDefinitions() override { - return makeArrayRef(g_trace_load_options); + return ArrayRef(g_trace_load_options); } bool m_verbose; // Enable verbose logging for debugging purposes. @@ -262,7 +262,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_trace_dump_options); + return llvm::ArrayRef(g_trace_dump_options); } bool m_verbose; // Enable verbose logging for debugging purposes. @@ -327,7 +327,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_trace_schema_options); + return llvm::ArrayRef(g_trace_schema_options); } bool m_verbose; // Enable verbose logging for debugging purposes. Index: lldb/source/Commands/CommandObjectType.cpp =================================================================== --- lldb/source/Commands/CommandObjectType.cpp +++ lldb/source/Commands/CommandObjectType.cpp @@ -118,7 +118,7 @@ void OptionParsingStarting(ExecutionContext *execution_context) override; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_type_summary_add_options); + return llvm::ArrayRef(g_type_summary_add_options); } // Instance variables to hold the values for command options. @@ -351,7 +351,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_type_synth_add_options); + return llvm::ArrayRef(g_type_synth_add_options); } // Instance variables to hold the values for command options. @@ -508,7 +508,7 @@ ~CommandOptions() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_type_format_add_options); + return llvm::ArrayRef(g_type_format_add_options); } void OptionParsingStarting(ExecutionContext *execution_context) override { @@ -743,7 +743,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_type_formatter_delete_options); + return llvm::ArrayRef(g_type_formatter_delete_options); } // Instance variables to hold the values for command options. @@ -880,7 +880,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_type_formatter_clear_options); + return llvm::ArrayRef(g_type_formatter_clear_options); } // Instance variables to hold the values for command options. @@ -999,7 +999,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_type_formatter_list_options); + return llvm::ArrayRef(g_type_formatter_list_options); } // Instance variables to hold the values for command options. @@ -1700,7 +1700,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_type_category_define_options); + return llvm::ArrayRef(g_type_category_define_options); } // Instance variables to hold the values for command options. @@ -1803,7 +1803,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_type_category_enable_options); + return llvm::ArrayRef(g_type_category_enable_options); } // Instance variables to hold the values for command options. @@ -1980,7 +1980,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_type_category_disable_options); + return llvm::ArrayRef(g_type_category_disable_options); } // Instance variables to hold the values for command options. @@ -2423,7 +2423,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_type_filter_add_options); + return llvm::ArrayRef(g_type_filter_add_options); } // Instance variables to hold the values for command options. @@ -2639,7 +2639,7 @@ ~CommandOptions() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_type_lookup_options); + return llvm::ArrayRef(g_type_lookup_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, Index: lldb/source/Commands/CommandObjectWatchpoint.cpp =================================================================== --- lldb/source/Commands/CommandObjectWatchpoint.cpp +++ lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -196,7 +196,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_watchpoint_list_options); + return llvm::ArrayRef(g_watchpoint_list_options); } // Instance variables to hold the values for command options. @@ -479,7 +479,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_watchpoint_delete_options); + return llvm::ArrayRef(g_watchpoint_delete_options); } // Instance variables to hold the values for command options. @@ -605,7 +605,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_watchpoint_ignore_options); + return llvm::ArrayRef(g_watchpoint_ignore_options); } // Instance variables to hold the values for command options. @@ -730,7 +730,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_watchpoint_modify_options); + return llvm::ArrayRef(g_watchpoint_modify_options); } // Instance variables to hold the values for command options. Index: lldb/source/Commands/CommandObjectWatchpointCommand.cpp =================================================================== --- lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -349,7 +349,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_watchpoint_command_add_options); + return llvm::ArrayRef(g_watchpoint_command_add_options); } // Instance variables to hold the values for command options. Index: lldb/source/Commands/CommandOptionsProcessLaunch.cpp =================================================================== --- lldb/source/Commands/CommandOptionsProcessLaunch.cpp +++ lldb/source/Commands/CommandOptionsProcessLaunch.cpp @@ -145,5 +145,5 @@ } llvm::ArrayRef CommandOptionsProcessLaunch::GetDefinitions() { - return llvm::makeArrayRef(g_process_launch_options); + return llvm::ArrayRef(g_process_launch_options); } Index: lldb/source/Host/common/NativeProcessProtocol.cpp =================================================================== --- lldb/source/Host/common/NativeProcessProtocol.cpp +++ lldb/source/Host/common/NativeProcessProtocol.cpp @@ -382,7 +382,7 @@ } const auto &saved = it->second.saved_opcodes; // Make sure the breakpoint opcode exists at this address - if (makeArrayRef(curr_break_op) != it->second.breakpoint_opcodes) { + if (llvm::ArrayRef(curr_break_op) != it->second.breakpoint_opcodes) { if (curr_break_op != it->second.saved_opcodes) return Status("Original breakpoint trap is no longer in memory."); LLDB_LOG(log, @@ -482,7 +482,7 @@ verify_bp_opcode_bytes.size(), verify_bytes_read); } - if (llvm::makeArrayRef(verify_bp_opcode_bytes.data(), verify_bytes_read) != + if (llvm::ArrayRef(verify_bp_opcode_bytes.data(), verify_bytes_read) != *expected_trap) { return llvm::createStringError( llvm::inconvertibleErrorCode(), @@ -513,39 +513,39 @@ switch (GetArchitecture().GetMachine()) { case llvm::Triple::aarch64: case llvm::Triple::aarch64_32: - return llvm::makeArrayRef(g_aarch64_opcode); + return llvm::ArrayRef(g_aarch64_opcode); case llvm::Triple::x86: case llvm::Triple::x86_64: - return llvm::makeArrayRef(g_i386_opcode); + return llvm::ArrayRef(g_i386_opcode); case llvm::Triple::mips: case llvm::Triple::mips64: - return llvm::makeArrayRef(g_mips64_opcode); + return llvm::ArrayRef(g_mips64_opcode); case llvm::Triple::mipsel: case llvm::Triple::mips64el: - return llvm::makeArrayRef(g_mips64el_opcode); + return llvm::ArrayRef(g_mips64el_opcode); case llvm::Triple::systemz: - return llvm::makeArrayRef(g_s390x_opcode); + return llvm::ArrayRef(g_s390x_opcode); case llvm::Triple::ppc: case llvm::Triple::ppc64: - return llvm::makeArrayRef(g_ppc_opcode); + return llvm::ArrayRef(g_ppc_opcode); case llvm::Triple::ppc64le: - return llvm::makeArrayRef(g_ppcle_opcode); + return llvm::ArrayRef(g_ppcle_opcode); case llvm::Triple::riscv32: case llvm::Triple::riscv64: { - return size_hint == 2 ? llvm::makeArrayRef(g_riscv_opcode_c) - : llvm::makeArrayRef(g_riscv_opcode); + return size_hint == 2 ? llvm::ArrayRef(g_riscv_opcode_c) + : llvm::ArrayRef(g_riscv_opcode); } case llvm::Triple::loongarch32: case llvm::Triple::loongarch64: - return llvm::makeArrayRef(g_loongarch_opcode); + return llvm::ArrayRef(g_loongarch_opcode); default: return llvm::createStringError(llvm::inconvertibleErrorCode(), @@ -652,7 +652,7 @@ llvm::makeMutableArrayRef(static_cast(buf), bytes_read); for (const auto &pair : m_software_breakpoints) { lldb::addr_t bp_addr = pair.first; - auto saved_opcodes = makeArrayRef(pair.second.saved_opcodes); + auto saved_opcodes = llvm::ArrayRef(pair.second.saved_opcodes); if (bp_addr + saved_opcodes.size() < addr || addr + bytes_read <= bp_addr) continue; // Breakpoint not in range, ignore Index: lldb/source/Interpreter/OptionGroupArchitecture.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupArchitecture.cpp +++ lldb/source/Interpreter/OptionGroupArchitecture.cpp @@ -20,7 +20,7 @@ }; llvm::ArrayRef OptionGroupArchitecture::GetDefinitions() { - return llvm::makeArrayRef(g_option_table); + return llvm::ArrayRef(g_option_table); } bool OptionGroupArchitecture::GetArchitecture(Platform *platform, Index: lldb/source/Interpreter/OptionGroupFormat.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupFormat.cpp +++ lldb/source/Interpreter/OptionGroupFormat.cpp @@ -58,7 +58,7 @@ } llvm::ArrayRef OptionGroupFormat::GetDefinitions() { - auto result = llvm::makeArrayRef(m_option_definitions); + auto result = llvm::ArrayRef(m_option_definitions); if (m_byte_size.GetDefaultValue() < UINT64_MAX) { if (m_count.GetDefaultValue() < UINT64_MAX) return result; Index: lldb/source/Interpreter/OptionGroupMemoryTag.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupMemoryTag.cpp +++ lldb/source/Interpreter/OptionGroupMemoryTag.cpp @@ -32,7 +32,7 @@ : "Include memory tags in output."} {} llvm::ArrayRef OptionGroupMemoryTag::GetDefinitions() { - return llvm::makeArrayRef(m_option_definition); + return llvm::ArrayRef(m_option_definition); } Status Index: lldb/source/Interpreter/OptionGroupOutputFile.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupOutputFile.cpp +++ lldb/source/Interpreter/OptionGroupOutputFile.cpp @@ -27,7 +27,7 @@ }; llvm::ArrayRef OptionGroupOutputFile::GetDefinitions() { - return llvm::makeArrayRef(g_option_table); + return llvm::ArrayRef(g_option_table); } Status Index: lldb/source/Interpreter/OptionGroupUUID.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupUUID.cpp +++ lldb/source/Interpreter/OptionGroupUUID.cpp @@ -19,7 +19,7 @@ }; llvm::ArrayRef OptionGroupUUID::GetDefinitions() { - return llvm::makeArrayRef(g_option_table); + return llvm::ArrayRef(g_option_table); } Status OptionGroupUUID::SetOptionValue(uint32_t option_idx, Index: lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp +++ lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp @@ -62,7 +62,7 @@ llvm::ArrayRef OptionGroupValueObjectDisplay::GetDefinitions() { - return llvm::makeArrayRef(g_option_table); + return llvm::ArrayRef(g_option_table); } Status OptionGroupValueObjectDisplay::SetOptionValue( Index: lldb/source/Interpreter/OptionGroupVariable.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupVariable.cpp +++ lldb/source/Interpreter/OptionGroupVariable.cpp @@ -131,7 +131,7 @@ #define NUM_FRAME_OPTS 3 llvm::ArrayRef OptionGroupVariable::GetDefinitions() { - auto result = llvm::makeArrayRef(g_variable_options); + auto result = llvm::ArrayRef(g_variable_options); // Show the "--no-args", "--no-locals" and "--show-globals" options if we are // showing frame specific options if (include_frame_options) Index: lldb/source/Interpreter/OptionGroupWatchpoint.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupWatchpoint.cpp +++ lldb/source/Interpreter/OptionGroupWatchpoint.cpp @@ -111,5 +111,5 @@ } llvm::ArrayRef OptionGroupWatchpoint::GetDefinitions() { - return llvm::makeArrayRef(g_option_table); + return llvm::ArrayRef(g_option_table); } Index: lldb/source/Interpreter/OptionValueBoolean.cpp =================================================================== --- lldb/source/Interpreter/OptionValueBoolean.cpp +++ lldb/source/Interpreter/OptionValueBoolean.cpp @@ -72,7 +72,7 @@ llvm::StringRef autocomplete_entries[] = {"true", "false", "on", "off", "yes", "no", "1", "0"}; - auto entries = llvm::makeArrayRef(autocomplete_entries); + auto entries = llvm::ArrayRef(autocomplete_entries); // only suggest "true" or "false" by default if (request.GetCursorArgumentPrefix().empty()) Index: lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp =================================================================== --- lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp +++ lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp @@ -271,7 +271,7 @@ reg_value[byte_index++] = 0; } - RegisterValue reg_val_obj(llvm::makeArrayRef(reg_value, reg_size), + RegisterValue reg_val_obj(llvm::ArrayRef(reg_value, reg_size), eByteOrderLittle); if (!reg_ctx->WriteRegister( reg_ctx->GetRegisterInfo(eRegisterKindGeneric, reg_index), Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -868,7 +868,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_objc_classtable_dump_options); + return llvm::ArrayRef(g_objc_classtable_dump_options); } OptionValueBoolean m_verbose; Index: lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -4113,7 +4113,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_renderscript_reduction_bp_set_options); + return llvm::ArrayRef(g_renderscript_reduction_bp_set_options); } bool ParseReductionTypes(llvm::StringRef option_val, @@ -4265,7 +4265,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_renderscript_kernel_bp_set_options); + return llvm::ArrayRef(g_renderscript_kernel_bp_set_options); } RSCoordinate m_coord; @@ -4545,7 +4545,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_renderscript_runtime_alloc_dump_options); + return llvm::ArrayRef(g_renderscript_runtime_alloc_dump_options); } FileSpec m_outfile; @@ -4663,7 +4663,7 @@ void OptionParsingStarting(ExecutionContext *exe_ctx) override { m_id = 0; } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_renderscript_runtime_alloc_list_options); + return llvm::ArrayRef(g_renderscript_runtime_alloc_list_options); } uint32_t m_id = 0; Index: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp =================================================================== --- lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -446,8 +446,8 @@ } static uint32_t calc_crc32(uint32_t init, const DataExtractor &data) { - return llvm::crc32( - init, llvm::makeArrayRef(data.GetDataStart(), data.GetByteSize())); + return llvm::crc32(init, + llvm::ArrayRef(data.GetDataStart(), data.GetByteSize())); } uint32_t ObjectFileELF::CalculateELFNotesSegmentsCRC32( Index: lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp =================================================================== --- lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp +++ lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp @@ -71,7 +71,7 @@ return std::nullopt; } - llvm::StringRef str = toStringRef(makeArrayRef(str_storage)); + llvm::StringRef str = toStringRef(llvm::ArrayRef(str_storage)); return ConstString(str); } Index: lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp =================================================================== --- lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp +++ lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp @@ -417,9 +417,9 @@ case llvm::Triple::arm: switch (size_hint) { case 2: - return llvm::makeArrayRef(g_thumb_opcode); + return llvm::ArrayRef(g_thumb_opcode); case 4: - return llvm::makeArrayRef(g_arm_opcode); + return llvm::ArrayRef(g_arm_opcode); default: return llvm::createStringError(llvm::inconvertibleErrorCode(), "Unrecognised trap opcode size hint!"); Index: lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp =================================================================== --- lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1512,9 +1512,9 @@ case llvm::Triple::arm: switch (size_hint) { case 2: - return llvm::makeArrayRef(g_thumb_opcode); + return llvm::ArrayRef(g_thumb_opcode); case 4: - return llvm::makeArrayRef(g_arm_opcode); + return llvm::ArrayRef(g_arm_opcode); default: return llvm::createStringError(llvm::inconvertibleErrorCode(), "Unrecognised trap opcode size hint!"); Index: lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp +++ lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp @@ -217,9 +217,9 @@ if (m_opt_regsets.AnySet(eRegsetMaskDynamic)) { llvm::ArrayRef reg_infos_ref = - llvm::makeArrayRef(m_register_info_p, m_register_info_count); + llvm::ArrayRef(m_register_info_p, m_register_info_count); llvm::ArrayRef reg_sets_ref = - llvm::makeArrayRef(m_register_set_p, m_register_set_count); + llvm::ArrayRef(m_register_set_p, m_register_set_count); llvm::copy(reg_infos_ref, std::back_inserter(m_dynamic_reg_infos)); llvm::copy(reg_sets_ref, std::back_inserter(m_dynamic_reg_sets)); @@ -333,7 +333,7 @@ m_per_vq_reg_infos[sve_vq]; if (reg_info_ref.empty()) { - reg_info_ref = llvm::makeArrayRef(m_register_info_p, m_register_info_count); + reg_info_ref = llvm::ArrayRef(m_register_info_p, m_register_info_count); uint32_t offset = SVE_REGS_DEFAULT_OFFSET_LINUX; reg_info_ref[fpu_fpsr].byte_offset = offset; Index: lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp =================================================================== --- lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp +++ lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp @@ -295,11 +295,11 @@ switch (GetArchitecture().GetMachine()) { case llvm::Triple::aarch64: - return llvm::makeArrayRef(g_aarch64_opcode); + return llvm::ArrayRef(g_aarch64_opcode); case llvm::Triple::arm: case llvm::Triple::thumb: - return llvm::makeArrayRef(g_thumb_opcode); + return llvm::ArrayRef(g_thumb_opcode); default: return NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode(size_hint); Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -2307,7 +2307,7 @@ // Build the reginfos response. StreamGDBRemote response; - RegisterValue reg_value(makeArrayRef(reg_bytes, reg_size), + RegisterValue reg_value(ArrayRef(reg_bytes, reg_size), m_current_process->GetArchitecture().GetByteOrder()); Status error = reg_context.WriteRegister(reg_info, reg_value); if (error.Fail()) { Index: lldb/source/Plugins/Process/minidump/MinidumpTypes.cpp =================================================================== --- lldb/source/Plugins/Process/minidump/MinidumpTypes.cpp +++ lldb/source/Plugins/Process/minidump/MinidumpTypes.cpp @@ -71,7 +71,7 @@ return {}; return std::make_pair( - llvm::makeArrayRef( + llvm::ArrayRef( reinterpret_cast(data.data()), *mem_ranges_count), *base_rva); Index: lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp =================================================================== --- lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp +++ lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp @@ -40,7 +40,7 @@ bool ScriptedProcess::IsScriptLanguageSupported(lldb::ScriptLanguage language) { llvm::ArrayRef supported_languages = - llvm::makeArrayRef(g_supported_script_languages); + llvm::ArrayRef(g_supported_script_languages); return llvm::is_contained(supported_languages, language); } Index: lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp =================================================================== --- lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp +++ lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp @@ -557,7 +557,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_enable_option_table); + return llvm::ArrayRef(g_enable_option_table); } StructuredData::DictionarySP BuildConfigurationData(bool enabled) { Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp @@ -22,8 +22,8 @@ } llvm::DWARFDataExtractor DWARFDataExtractor::GetAsLLVM() const { - return llvm::DWARFDataExtractor( - llvm::makeArrayRef(GetDataStart(), GetByteSize()), - GetByteOrder() == lldb::eByteOrderLittle, GetAddressByteSize()); + return llvm::DWARFDataExtractor(llvm::ArrayRef(GetDataStart(), GetByteSize()), + GetByteOrder() == lldb::eByteOrderLittle, + GetAddressByteSize()); } } // namespace lldb_private Index: lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.cpp +++ lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.cpp @@ -248,7 +248,7 @@ Value.U = constant.getZExtValue(); } - bytes = llvm::makeArrayRef(reinterpret_cast(&Value), 8) + bytes = llvm::ArrayRef(reinterpret_cast(&Value), 8) .take_front(size); buffer->CopyData(bytes.data(), size); DataExtractor extractor(buffer, lldb::eByteOrderLittle, address_size); Index: lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp +++ lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp @@ -1187,7 +1187,7 @@ llvm::cantFail( TypeDeserializer::deserializeAs(args_cvt, args)); - llvm::ArrayRef arg_indices = llvm::makeArrayRef(args.ArgIndices); + llvm::ArrayRef arg_indices = llvm::ArrayRef(args.ArgIndices); bool is_variadic = IsCVarArgsFunction(arg_indices); if (is_variadic) arg_indices = arg_indices.drop_back(); Index: lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp =================================================================== --- lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp +++ lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp @@ -69,7 +69,7 @@ llvm::ArrayRef CommandObjectThreadTraceStartIntelPT::CommandOptions::GetDefinitions() { - return llvm::makeArrayRef(g_thread_trace_start_intel_pt_options); + return llvm::ArrayRef(g_thread_trace_start_intel_pt_options); } bool CommandObjectThreadTraceStartIntelPT::DoExecuteOnThreads( @@ -154,7 +154,7 @@ llvm::ArrayRef CommandObjectProcessTraceStartIntelPT::CommandOptions::GetDefinitions() { - return llvm::makeArrayRef(g_process_trace_start_intel_pt_options); + return llvm::ArrayRef(g_process_trace_start_intel_pt_options); } bool CommandObjectProcessTraceStartIntelPT::DoExecute( Index: lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp =================================================================== --- lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp +++ lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp @@ -59,7 +59,7 @@ llvm::ArrayRef CommandObjectThreadTraceExportCTF::CommandOptions::GetDefinitions() { - return llvm::makeArrayRef(g_thread_trace_export_ctf_options); + return llvm::ArrayRef(g_thread_trace_export_ctf_options); } bool CommandObjectThreadTraceExportCTF::DoExecute(Args &command, Index: lldb/source/Symbol/UnwindPlan.cpp =================================================================== --- lldb/source/Symbol/UnwindPlan.cpp +++ lldb/source/Symbol/UnwindPlan.cpp @@ -147,7 +147,7 @@ if (m_type == atDWARFExpression) s.PutChar('['); DumpDWARFExpr( - s, llvm::makeArrayRef(m_location.expr.opcodes, m_location.expr.length), + s, llvm::ArrayRef(m_location.expr.opcodes, m_location.expr.length), thread); if (m_type == atDWARFExpression) s.PutChar(']'); @@ -201,8 +201,7 @@ s.PutChar(']'); break; case isDWARFExpression: - DumpDWARFExpr(s, - llvm::makeArrayRef(m_value.expr.opcodes, m_value.expr.length), + DumpDWARFExpr(s, llvm::ArrayRef(m_value.expr.opcodes, m_value.expr.length), thread); break; case unspecified: Index: lldb/source/Target/Platform.cpp =================================================================== --- lldb/source/Target/Platform.cpp +++ lldb/source/Target/Platform.cpp @@ -1357,7 +1357,7 @@ }; llvm::ArrayRef OptionGroupPlatformRSync::GetDefinitions() { - return llvm::makeArrayRef(g_rsync_option_table); + return llvm::ArrayRef(g_rsync_option_table); } void OptionGroupPlatformRSync::OptionParsingStarting( @@ -1405,7 +1405,7 @@ } llvm::ArrayRef OptionGroupPlatformSSH::GetDefinitions() { - return llvm::makeArrayRef(g_ssh_option_table); + return llvm::ArrayRef(g_ssh_option_table); } void OptionGroupPlatformSSH::OptionParsingStarting( @@ -1438,7 +1438,7 @@ } llvm::ArrayRef OptionGroupPlatformCaching::GetDefinitions() { - return llvm::makeArrayRef(g_caching_option_table); + return llvm::ArrayRef(g_caching_option_table); } void OptionGroupPlatformCaching::OptionParsingStarting( Index: lldb/source/Target/StackFrameRecognizer.cpp =================================================================== --- lldb/source/Target/StackFrameRecognizer.cpp +++ lldb/source/Target/StackFrameRecognizer.cpp @@ -77,7 +77,7 @@ symbol_name = entry.symbol_regexp->GetText().str(); callback(entry.recognizer_id, entry.recognizer->GetName(), module_name, - llvm::makeArrayRef(ConstString(symbol_name)), true); + llvm::ArrayRef(ConstString(symbol_name)), true); } else { callback(entry.recognizer_id, entry.recognizer->GetName(), Index: lldb/source/Utility/Args.cpp =================================================================== --- lldb/source/Utility/Args.cpp +++ lldb/source/Utility/Args.cpp @@ -312,7 +312,7 @@ assert(m_argv.size() == m_entries.size() + 1); assert(m_argv.back() == nullptr); m_argv.pop_back(); - for (auto arg : llvm::makeArrayRef(argv, argc)) { + for (auto arg : llvm::ArrayRef(argv, argc)) { m_entries.emplace_back(arg, '\0'); m_argv.push_back(m_entries.back().data()); } @@ -358,7 +358,7 @@ void Args::SetArguments(size_t argc, const char **argv) { Clear(); - auto args = llvm::makeArrayRef(argv, argc); + auto args = llvm::ArrayRef(argv, argc); m_entries.resize(argc); m_argv.resize(argc + 1); for (size_t i = 0; i < args.size(); ++i) { Index: lldb/source/Utility/StringList.cpp =================================================================== --- lldb/source/Utility/StringList.cpp +++ lldb/source/Utility/StringList.cpp @@ -108,7 +108,7 @@ if (m_strings.empty()) return {}; - auto args = llvm::makeArrayRef(m_strings); + auto args = llvm::ArrayRef(m_strings); llvm::StringRef prefix = args.front(); for (auto arg : args.drop_front()) { size_t count = 0; Index: lldb/tools/driver/Driver.cpp =================================================================== --- lldb/tools/driver/Driver.cpp +++ lldb/tools/driver/Driver.cpp @@ -757,7 +757,7 @@ LLDBOptTable T; unsigned MissingArgIndex; unsigned MissingArgCount; - ArrayRef arg_arr = makeArrayRef(argv + 1, argc - 1); + ArrayRef arg_arr = ArrayRef(argv + 1, argc - 1); opt::InputArgList input_args = T.ParseArgs(arg_arr, MissingArgIndex, MissingArgCount); llvm::StringRef argv0 = llvm::sys::path::filename(argv[0]); Index: lldb/tools/lldb-vscode/lldb-vscode.cpp =================================================================== --- lldb/tools/lldb-vscode/lldb-vscode.cpp +++ lldb/tools/lldb-vscode/lldb-vscode.cpp @@ -3227,7 +3227,7 @@ LLDBVSCodeOptTable T; unsigned MAI, MAC; - llvm::ArrayRef ArgsArr = llvm::makeArrayRef(argv + 1, argc); + llvm::ArrayRef ArgsArr = llvm::ArrayRef(argv + 1, argc); llvm::opt::InputArgList input_args = T.ParseArgs(ArgsArr, MAI, MAC); if (input_args.hasArg(OPT_help)) { Index: lldb/unittests/TestingSupport/Host/NativeProcessTestUtils.h =================================================================== --- lldb/unittests/TestingSupport/Host/NativeProcessTestUtils.h +++ lldb/unittests/TestingSupport/Host/NativeProcessTestUtils.h @@ -86,7 +86,7 @@ Status WriteMemory(addr_t Addr, const void *Buf, size_t Size, size_t &BytesWritten) /*override*/ { auto ExpectedBytes = this->WriteMemory( - Addr, llvm::makeArrayRef(static_cast(Buf), Size)); + Addr, llvm::ArrayRef(static_cast(Buf), Size)); if (!ExpectedBytes) { BytesWritten = 0; return Status(ExpectedBytes.takeError()); Index: llvm/docs/TableGen/BackEnds.rst =================================================================== --- llvm/docs/TableGen/BackEnds.rst +++ llvm/docs/TableGen/BackEnds.rst @@ -776,7 +776,7 @@ uint16_t Val2; }; KeyType Key = { Val1, Val2 }; - auto Table = makeArrayRef(ATable); + auto Table = ArrayRef(ATable); auto Idx = std::lower_bound(Table.begin(), Table.end(), Key, [](const AEntry &LHS, const KeyType &RHS) { if (LHS.Val1 < RHS.Val1) @@ -850,7 +850,7 @@ uint16_t Encoding; }; KeyType Key = { Encoding }; - auto Table = makeArrayRef(CTable); + auto Table = ArrayRef(CTable); auto Idx = std::lower_bound(Table.begin(), Table.end(), Key, [](const CEntry &LHS, const KeyType &RHS) { if (LHS.Encoding < RHS.Encoding) @@ -948,7 +948,7 @@ unsigned Kind; }; KeyType Key = { Name.upper(), Kind }; - auto Table = makeArrayRef(Index); + auto Table = ArrayRef(Index); auto Idx = std::lower_bound(Table.begin(), Table.end(), Key, [](const IndexType &LHS, const KeyType &RHS) { int CmpName = StringRef(LHS.Name).compare(RHS.Name); Index: llvm/include/llvm/ADT/ArrayRef.h =================================================================== --- llvm/include/llvm/ADT/ArrayRef.h +++ llvm/include/llvm/ADT/ArrayRef.h @@ -466,64 +466,111 @@ ~OwningArrayRef() { delete[] this->data(); } }; - /// @name ArrayRef Convenience constructors + /// @name ArrayRef Deduction guides /// @{ + /// Deduction guide to construct an ArrayRef from a single element. + template ArrayRef(const T &OneElt) -> ArrayRef; + + /// Deduction guide to construct an ArrayRef from a pointer and length + template ArrayRef(const T *data, size_t length) -> ArrayRef; + + /// Deduction guide to construct an ArrayRef from a range + template ArrayRef(const T *data, const T *end) -> ArrayRef; + + /// Deduction guide to construct an ArrayRef from a SmallVector + template ArrayRef(const SmallVectorImpl &Vec) -> ArrayRef; + + /// Deduction guide to construct an ArrayRef from a SmallVector + template + ArrayRef(const SmallVector &Vec) -> ArrayRef; + + /// Deduction guide to construct an ArrayRef from a std::vector + template ArrayRef(const std::vector &Vec) -> ArrayRef; + + /// Deduction guide to construct an ArrayRef from a std::array + template + ArrayRef(const std::array &Vec) -> ArrayRef; + + /// Deduction guide to construct an ArrayRef from an ArrayRef (no-op) (const) + template ArrayRef(const ArrayRef &Vec) -> ArrayRef; + + /// Deduction guide to construct an ArrayRef from an ArrayRef (no-op) + template ArrayRef(ArrayRef &Vec) -> ArrayRef; + + /// Deduction guide to construct an ArrayRef from a C array. + template ArrayRef(const T (&Arr)[N]) -> ArrayRef; + + /// @} + /// @name ArrayRef Convenience constructors + /// @{ /// Construct an ArrayRef from a single element. - template + template + LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef") ArrayRef makeArrayRef(const T &OneElt) { return OneElt; } /// Construct an ArrayRef from a pointer and length. - template + template + LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef") ArrayRef makeArrayRef(const T *data, size_t length) { return ArrayRef(data, length); } /// Construct an ArrayRef from a range. - template + template + LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef") ArrayRef makeArrayRef(const T *begin, const T *end) { return ArrayRef(begin, end); } /// Construct an ArrayRef from a SmallVector. template + LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef") ArrayRef makeArrayRef(const SmallVectorImpl &Vec) { return Vec; } /// Construct an ArrayRef from a SmallVector. template + LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef") ArrayRef makeArrayRef(const SmallVector &Vec) { return Vec; } /// Construct an ArrayRef from a std::vector. - template + template + LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef") ArrayRef makeArrayRef(const std::vector &Vec) { return Vec; } /// Construct an ArrayRef from a std::array. template + LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef") ArrayRef makeArrayRef(const std::array &Arr) { return Arr; } /// Construct an ArrayRef from an ArrayRef (no-op) (const) - template ArrayRef makeArrayRef(const ArrayRef &Vec) { + template + LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef") + ArrayRef makeArrayRef(const ArrayRef &Vec) { return Vec; } /// Construct an ArrayRef from an ArrayRef (no-op) - template ArrayRef &makeArrayRef(ArrayRef &Vec) { + template + LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef") + ArrayRef &makeArrayRef(ArrayRef &Vec) { return Vec; } /// Construct an ArrayRef from a C array. - template - ArrayRef makeArrayRef(const T (&Arr)[N]) { + template + ArrayRef LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef") + makeArrayRef(const T (&Arr)[N]) { return ArrayRef(Arr); } Index: llvm/include/llvm/ADT/SmallBitVector.h =================================================================== --- llvm/include/llvm/ADT/SmallBitVector.h +++ llvm/include/llvm/ADT/SmallBitVector.h @@ -687,7 +687,7 @@ if (!isSmall()) return getPointer()->getData(); Store = getSmallBits(); - return makeArrayRef(Store); + return ArrayRef(Store); } private: Index: llvm/include/llvm/Analysis/ConstraintSystem.h =================================================================== --- llvm/include/llvm/Analysis/ConstraintSystem.h +++ llvm/include/llvm/Analysis/ConstraintSystem.h @@ -40,7 +40,7 @@ assert(Constraints.empty() || R.size() == Constraints.back().size()); // If all variable coefficients are 0, the constraint does not provide any // usable information. - if (all_of(makeArrayRef(R).drop_front(1), [](int64_t C) { return C == 0; })) + if (all_of(ArrayRef(R).drop_front(1), [](int64_t C) { return C == 0; })) return false; for (const auto &C : R) { @@ -55,7 +55,7 @@ bool addVariableRowFill(ArrayRef R) { // If all variable coefficients are 0, the constraint does not provide any // usable information. - if (all_of(makeArrayRef(R).drop_front(1), [](int64_t C) { return C == 0; })) + if (all_of(ArrayRef(R).drop_front(1), [](int64_t C) { return C == 0; })) return false; for (auto &CR : Constraints) { Index: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h =================================================================== --- llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h +++ llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h @@ -187,7 +187,7 @@ SCEVNAryExpr(const FoldingSetNodeIDRef ID, enum SCEVTypes T, const SCEV *const *O, size_t N) - : SCEV(ID, T, computeExpressionSize(makeArrayRef(O, N))), Operands(O), + : SCEV(ID, T, computeExpressionSize(ArrayRef(O, N))), Operands(O), NumOperands(N) {} public: @@ -199,7 +199,7 @@ } ArrayRef operands() const { - return makeArrayRef(Operands, NumOperands); + return ArrayRef(Operands, NumOperands); } NoWrapFlags getNoWrapFlags(NoWrapFlags Mask = NoWrapMask) const { Index: llvm/include/llvm/Bitcode/BitcodeConvenience.h =================================================================== --- llvm/include/llvm/Bitcode/BitcodeConvenience.h +++ llvm/include/llvm/Bitcode/BitcodeConvenience.h @@ -429,7 +429,7 @@ /// in the buffer and should be handled separately by the caller. template static void readRecord(BufferTy &buffer, Data &&...data) { - return readRecord(llvm::makeArrayRef(buffer), std::forward(data)...); + return readRecord(llvm::ArrayRef(buffer), std::forward(data)...); } }; Index: llvm/include/llvm/Bitstream/BitstreamWriter.h =================================================================== --- llvm/include/llvm/Bitstream/BitstreamWriter.h +++ llvm/include/llvm/Bitstream/BitstreamWriter.h @@ -474,7 +474,7 @@ Out.push_back(0); } void emitBlob(StringRef Bytes, bool ShouldEmitSize = true) { - emitBlob(makeArrayRef((const uint8_t *)Bytes.data(), Bytes.size()), + emitBlob(ArrayRef((const uint8_t *)Bytes.data(), Bytes.size()), ShouldEmitSize); } @@ -485,7 +485,7 @@ if (!Abbrev) { // If we don't have an abbrev to use, emit this in its fully unabbreviated // form. - auto Count = static_cast(makeArrayRef(Vals).size()); + auto Count = static_cast(ArrayRef(Vals).size()); EmitCode(bitc::UNABBREV_RECORD); EmitVBR(Code, 6); EmitVBR(Count, 6); @@ -494,7 +494,7 @@ return; } - EmitRecordWithAbbrevImpl(Abbrev, makeArrayRef(Vals), StringRef(), Code); + EmitRecordWithAbbrevImpl(Abbrev, ArrayRef(Vals), StringRef(), Code); } /// EmitRecordWithAbbrev - Emit a record with the specified abbreviation. @@ -502,8 +502,7 @@ /// the first entry. template void EmitRecordWithAbbrev(unsigned Abbrev, const Container &Vals) { - EmitRecordWithAbbrevImpl(Abbrev, makeArrayRef(Vals), StringRef(), - std::nullopt); + EmitRecordWithAbbrevImpl(Abbrev, ArrayRef(Vals), StringRef(), std::nullopt); } /// EmitRecordWithBlob - Emit the specified record to the stream, using an @@ -514,12 +513,12 @@ template void EmitRecordWithBlob(unsigned Abbrev, const Container &Vals, StringRef Blob) { - EmitRecordWithAbbrevImpl(Abbrev, makeArrayRef(Vals), Blob, std::nullopt); + EmitRecordWithAbbrevImpl(Abbrev, ArrayRef(Vals), Blob, std::nullopt); } template void EmitRecordWithBlob(unsigned Abbrev, const Container &Vals, const char *BlobData, unsigned BlobLen) { - return EmitRecordWithAbbrevImpl(Abbrev, makeArrayRef(Vals), + return EmitRecordWithAbbrevImpl(Abbrev, ArrayRef(Vals), StringRef(BlobData, BlobLen), std::nullopt); } @@ -528,14 +527,13 @@ template void EmitRecordWithArray(unsigned Abbrev, const Container &Vals, StringRef Array) { - EmitRecordWithAbbrevImpl(Abbrev, makeArrayRef(Vals), Array, std::nullopt); + EmitRecordWithAbbrevImpl(Abbrev, ArrayRef(Vals), Array, std::nullopt); } template void EmitRecordWithArray(unsigned Abbrev, const Container &Vals, const char *ArrayData, unsigned ArrayLen) { - return EmitRecordWithAbbrevImpl(Abbrev, makeArrayRef(Vals), - StringRef(ArrayData, ArrayLen), - std::nullopt); + return EmitRecordWithAbbrevImpl( + Abbrev, ArrayRef(Vals), StringRef(ArrayData, ArrayLen), std::nullopt); } //===--------------------------------------------------------------------===// Index: llvm/include/llvm/CodeGen/CostTable.h =================================================================== --- llvm/include/llvm/CodeGen/CostTable.h +++ llvm/include/llvm/CodeGen/CostTable.h @@ -47,7 +47,7 @@ inline const CostTblEntryT * CostTableLookup(const CostTblEntryT (&Table)[N], int ISD, MVT Ty) { // Wrapper to fix template argument deduction failures. - return CostTableLookup(makeArrayRef(Table), ISD, Ty); + return CostTableLookup(ArrayRef(Table), ISD, Ty); } /// Type Conversion Cost Table @@ -81,7 +81,7 @@ ConvertCostTableLookup(const TypeConversionCostTblEntryT (&Table)[N], int ISD, MVT Dst, MVT Src) { // Wrapper to fix template argument deduction failures. - return ConvertCostTableLookup(makeArrayRef(Table), ISD, Dst, Src); + return ConvertCostTableLookup(ArrayRef(Table), ISD, Dst, Src); } } // namespace llvm Index: llvm/include/llvm/CodeGen/LiveRangeEdit.h =================================================================== --- llvm/include/llvm/CodeGen/LiveRangeEdit.h +++ llvm/include/llvm/CodeGen/LiveRangeEdit.h @@ -163,9 +163,7 @@ /// we want to drop it from the NewRegs set. void pop_back() { NewRegs.pop_back(); } - ArrayRef regs() const { - return makeArrayRef(NewRegs).slice(FirstNew); - } + ArrayRef regs() const { return ArrayRef(NewRegs).slice(FirstNew); } /// createFrom - Create a new virtual register based on OldReg. Register createFrom(Register OldReg); Index: llvm/include/llvm/CodeGen/MachineInstr.h =================================================================== --- llvm/include/llvm/CodeGen/MachineInstr.h +++ llvm/include/llvm/CodeGen/MachineInstr.h @@ -188,7 +188,7 @@ } ArrayRef getMMOs() const { - return makeArrayRef(getTrailingObjects(), NumMMOs); + return ArrayRef(getTrailingObjects(), NumMMOs); } MCSymbol *getPreInstrSymbol() const { @@ -715,7 +715,7 @@ return {}; if (Info.is()) - return makeArrayRef(Info.getAddrOfZeroTagPointer(), 1); + return ArrayRef(Info.getAddrOfZeroTagPointer(), 1); if (ExtraInfo *EI = Info.get()) return EI->getMMOs(); Index: llvm/include/llvm/CodeGen/RegisterClassInfo.h =================================================================== --- llvm/include/llvm/CodeGen/RegisterClassInfo.h +++ llvm/include/llvm/CodeGen/RegisterClassInfo.h @@ -38,7 +38,7 @@ RCInfo() = default; operator ArrayRef() const { - return makeArrayRef(Order.get(), NumRegs); + return ArrayRef(Order.get(), NumRegs); } }; Index: llvm/include/llvm/CodeGen/SelectionDAG.h =================================================================== --- llvm/include/llvm/CodeGen/SelectionDAG.h +++ llvm/include/llvm/CodeGen/SelectionDAG.h @@ -783,7 +783,7 @@ SDVTList VTs = getVTList(MVT::Other, MVT::Glue); SDValue Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Glue }; return getNode(ISD::CopyToReg, dl, VTs, - makeArrayRef(Ops, Glue.getNode() ? 4 : 3)); + ArrayRef(Ops, Glue.getNode() ? 4 : 3)); } // Similar to last getCopyToReg() except parameter Reg is a SDValue @@ -792,7 +792,7 @@ SDVTList VTs = getVTList(MVT::Other, MVT::Glue); SDValue Ops[] = { Chain, Reg, N, Glue }; return getNode(ISD::CopyToReg, dl, VTs, - makeArrayRef(Ops, Glue.getNode() ? 4 : 3)); + ArrayRef(Ops, Glue.getNode() ? 4 : 3)); } SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT) { @@ -809,7 +809,7 @@ SDVTList VTs = getVTList(VT, MVT::Other, MVT::Glue); SDValue Ops[] = { Chain, getRegister(Reg, VT), Glue }; return getNode(ISD::CopyFromReg, dl, VTs, - makeArrayRef(Ops, Glue.getNode() ? 3 : 2)); + ArrayRef(Ops, Glue.getNode() ? 3 : 2)); } SDValue getCondCode(ISD::CondCode Cond); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h =================================================================== --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h @@ -927,7 +927,7 @@ op_iterator op_begin() const { return OperandList; } op_iterator op_end() const { return OperandList+NumOperands; } - ArrayRef ops() const { return makeArrayRef(op_begin(), op_end()); } + ArrayRef ops() const { return ArrayRef(op_begin(), op_end()); } /// Iterator for directly iterating over the operand SDValue's. struct value_op_iterator @@ -1535,7 +1535,7 @@ public: ArrayRef getMask() const { EVT VT = getValueType(0); - return makeArrayRef(Mask, VT.getVectorNumElements()); + return ArrayRef(Mask, VT.getVectorNumElements()); } int getMaskElt(unsigned Idx) const { @@ -2931,10 +2931,10 @@ if (NumMemRefs == 0) return {}; if (NumMemRefs == 1) - return makeArrayRef(MemRefs.getAddrOfPtr1(), 1); + return ArrayRef(MemRefs.getAddrOfPtr1(), 1); // Otherwise we have an actual array. - return makeArrayRef(MemRefs.get(), NumMemRefs); + return ArrayRef(MemRefs.get(), NumMemRefs); } mmo_iterator memoperands_begin() const { return memoperands().begin(); } mmo_iterator memoperands_end() const { return memoperands().end(); } Index: llvm/include/llvm/CodeGen/TargetRegisterInfo.h =================================================================== --- llvm/include/llvm/CodeGen/TargetRegisterInfo.h +++ llvm/include/llvm/CodeGen/TargetRegisterInfo.h @@ -200,7 +200,7 @@ /// /// By default, this method returns all registers in the class. ArrayRef getRawAllocationOrder(const MachineFunction &MF) const { - return OrderFunc ? OrderFunc(MF) : makeArrayRef(begin(), getNumRegs()); + return OrderFunc ? OrderFunc(MF) : ArrayRef(begin(), getNumRegs()); } /// Returns the combination of all lane masks of register in this class. @@ -357,7 +357,7 @@ unsigned NumRegs = getNumRegs(); assert(Idx < InfoDesc->NumCosts && "CostPerUse index out of bounds"); - return makeArrayRef(&InfoDesc->CostPerUse[Idx * NumRegs], NumRegs); + return ArrayRef(&InfoDesc->CostPerUse[Idx * NumRegs], NumRegs); } /// Return true if the register is in the allocation of any register class. Index: llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h =================================================================== --- llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h +++ llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h @@ -704,10 +704,10 @@ TypeIndex getCompleteClass() const { return CompleteClass; } TypeIndex getOverriddenVTable() const { return OverriddenVFTable; } uint32_t getVFPtrOffset() const { return VFPtrOffset; } - StringRef getName() const { return makeArrayRef(MethodNames).front(); } + StringRef getName() const { return ArrayRef(MethodNames).front(); } ArrayRef getMethodNames() const { - return makeArrayRef(MethodNames).drop_front(); + return ArrayRef(MethodNames).drop_front(); } TypeIndex CompleteClass; Index: llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h =================================================================== --- llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h +++ llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h @@ -164,11 +164,11 @@ const Entry *getFromHash(uint64_t Offset) const; ArrayRef getColumnKinds() const { - return makeArrayRef(ColumnKinds.get(), Header.NumColumns); + return ArrayRef(ColumnKinds.get(), Header.NumColumns); } ArrayRef getRows() const { - return makeArrayRef(Rows.get(), Header.NumBuckets); + return ArrayRef(Rows.get(), Header.NumBuckets); } }; Index: llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h =================================================================== --- llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h +++ llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h @@ -108,9 +108,7 @@ unsigned getModuleIndex() const { return Layout.Mod; } - ArrayRef source_files() const { - return makeArrayRef(SourceFiles); - } + ArrayRef source_files() const { return ArrayRef(SourceFiles); } uint32_t calculateSerializedLength() const; Index: llvm/include/llvm/IR/Constants.h =================================================================== --- llvm/include/llvm/IR/Constants.h +++ llvm/include/llvm/IR/Constants.h @@ -698,7 +698,7 @@ /// ArrayRef. Calls get(LLVMContext, ArrayRef). template static Constant *get(LLVMContext &Context, ArrayTy &Elts) { - return ConstantDataArray::get(Context, makeArrayRef(Elts)); + return ConstantDataArray::get(Context, ArrayRef(Elts)); } /// getRaw() constructor - Return a constant with array type with an element @@ -1247,7 +1247,7 @@ std::optional InRangeIndex = std::nullopt, Type *OnlyIfReducedTy = nullptr) { return getGetElementPtr( - Ty, C, makeArrayRef((Value *const *)IdxList.data(), IdxList.size()), + Ty, C, ArrayRef((Value *const *)IdxList.data(), IdxList.size()), InBounds, InRangeIndex, OnlyIfReducedTy); } static Constant * Index: llvm/include/llvm/IR/DataLayout.h =================================================================== --- llvm/include/llvm/IR/DataLayout.h +++ llvm/include/llvm/IR/DataLayout.h @@ -646,7 +646,7 @@ } ArrayRef getMemberOffsets() const { - return llvm::makeArrayRef(getTrailingObjects(), NumElements); + return llvm::ArrayRef(getTrailingObjects(), NumElements); } uint64_t getElementOffset(unsigned Idx) const { Index: llvm/include/llvm/IR/DerivedTypes.h =================================================================== --- llvm/include/llvm/IR/DerivedTypes.h +++ llvm/include/llvm/IR/DerivedTypes.h @@ -128,7 +128,7 @@ param_iterator param_begin() const { return ContainedTys + 1; } param_iterator param_end() const { return &ContainedTys[NumContainedTys]; } ArrayRef params() const { - return makeArrayRef(param_begin(), param_end()); + return ArrayRef(param_begin(), param_end()); } /// Parameter type accessors. @@ -317,7 +317,7 @@ element_iterator element_begin() const { return ContainedTys; } element_iterator element_end() const { return &ContainedTys[NumContainedTys];} ArrayRef elements() const { - return makeArrayRef(element_begin(), element_end()); + return ArrayRef(element_begin(), element_end()); } /// Return true if this is layout identical to the specified struct. @@ -761,7 +761,7 @@ /// Return the type parameters for this particular target extension type. If /// there are no parameters, an empty array is returned. ArrayRef type_params() const { - return makeArrayRef(type_param_begin(), type_param_end()); + return ArrayRef(type_param_begin(), type_param_end()); } using type_param_iterator = Type::subtype_iterator; @@ -776,7 +776,7 @@ /// Return the integer parameters for this particular target extension type. /// If there are no parameters, an empty array is returned. ArrayRef int_params() const { - return makeArrayRef(IntParams, getNumIntParameters()); + return ArrayRef(IntParams, getNumIntParameters()); } unsigned getIntParameter(unsigned i) const { return IntParams[i]; } Index: llvm/include/llvm/IR/IRBuilder.h =================================================================== --- llvm/include/llvm/IR/IRBuilder.h +++ llvm/include/llvm/IR/IRBuilder.h @@ -830,7 +830,7 @@ const Twine &Name = ""); /// Conveninence function for the common case when CallArgs are filled - /// in using makeArrayRef(CS.arg_begin(), CS.arg_end()); Use needs to be + /// in using ArrayRef(CS.arg_begin(), CS.arg_end()); Use needs to be /// .get()'ed to get the Value pointer. CallInst *CreateGCStatepointCall(uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualCallee, @@ -858,7 +858,7 @@ const Twine &Name = ""); // Convenience function for the common case when CallArgs are filled in using - // makeArrayRef(CS.arg_begin(), CS.arg_end()); Use needs to be .get()'ed to + // ArrayRef(CS.arg_begin(), CS.arg_end()); Use needs to be .get()'ed to // get the Value *. InvokeInst * CreateGCStatepointInvoke(uint64_t ID, uint32_t NumPatchBytes, @@ -1047,7 +1047,7 @@ if (MDSrc) { unsigned WL[4] = {LLVMContext::MD_prof, LLVMContext::MD_unpredictable, LLVMContext::MD_make_implicit, LLVMContext::MD_dbg}; - Br->copyMetadata(*MDSrc, makeArrayRef(&WL[0], 4)); + Br->copyMetadata(*MDSrc, ArrayRef(&WL[0], 4)); } return Insert(Br); } Index: llvm/include/llvm/IR/Instruction.h =================================================================== --- llvm/include/llvm/IR/Instruction.h +++ llvm/include/llvm/IR/Instruction.h @@ -327,7 +327,7 @@ return dropUnknownNonDebugMetadata(std::nullopt); } void dropUnknownNonDebugMetadata(unsigned ID1) { - return dropUnknownNonDebugMetadata(makeArrayRef(ID1)); + return dropUnknownNonDebugMetadata(ArrayRef(ID1)); } void dropUnknownNonDebugMetadata(unsigned ID1, unsigned ID2) { unsigned IDs[] = {ID1, ID2}; Index: llvm/include/llvm/IR/Metadata.h =================================================================== --- llvm/include/llvm/IR/Metadata.h +++ llvm/include/llvm/IR/Metadata.h @@ -1034,8 +1034,8 @@ ArrayRef operands() const { if (IsLarge) return getLarge(); - return makeArrayRef(reinterpret_cast(this) - SmallSize, - SmallNumOps); + return ArrayRef(reinterpret_cast(this) - SmallSize, + SmallNumOps); } unsigned getNumOperands() const { Index: llvm/include/llvm/IR/PredIteratorCache.h =================================================================== --- llvm/include/llvm/IR/PredIteratorCache.h +++ llvm/include/llvm/IR/PredIteratorCache.h @@ -64,7 +64,7 @@ public: size_t size(BasicBlock *BB) const { return GetNumPreds(BB); } ArrayRef get(BasicBlock *BB) { - return makeArrayRef(GetPreds(BB), GetNumPreds(BB)); + return ArrayRef(GetPreds(BB), GetNumPreds(BB)); } /// clear - Remove all information. Index: llvm/include/llvm/IR/Type.h =================================================================== --- llvm/include/llvm/IR/Type.h +++ llvm/include/llvm/IR/Type.h @@ -352,7 +352,7 @@ subtype_iterator subtype_begin() const { return ContainedTys; } subtype_iterator subtype_end() const { return &ContainedTys[NumContainedTys];} ArrayRef subtypes() const { - return makeArrayRef(subtype_begin(), subtype_end()); + return ArrayRef(subtype_begin(), subtype_end()); } using subtype_reverse_iterator = std::reverse_iterator; Index: llvm/include/llvm/Object/ELF.h =================================================================== --- llvm/include/llvm/Object/ELF.h +++ llvm/include/llvm/Object/ELF.h @@ -259,7 +259,7 @@ Expected symbols(const Elf_Shdr *Sec) const { if (!Sec) - return makeArrayRef(nullptr, nullptr); + return ArrayRef(nullptr, nullptr); return getSectionContentsAsArray(*Sec); } @@ -296,7 +296,7 @@ ", e_phentsize = " + Twine(getHeader().e_phentsize)); auto *Begin = reinterpret_cast(base() + PhOff); - return makeArrayRef(Begin, Begin + getHeader().e_phnum); + return ArrayRef(Begin, Begin + getHeader().e_phnum); } /// Get an iterator over notes in a program header. @@ -516,7 +516,7 @@ return createError("unaligned data"); const T *Start = reinterpret_cast(base() + Offset); - return makeArrayRef(Start, Size / sizeof(T)); + return ArrayRef(Start, Size / sizeof(T)); } template @@ -536,7 +536,7 @@ ") + p_filesz (0x" + Twine::utohexstr(Size) + ") that is greater than the file size (0x" + Twine::utohexstr(Buf.size()) + ")"); - return makeArrayRef(base() + Offset, Size); + return ArrayRef(base() + Offset, Size); } template @@ -798,7 +798,7 @@ const uintX_t SectionTableOffset = getHeader().e_shoff; if (SectionTableOffset == 0) { if (!FakeSections.empty()) - return makeArrayRef(FakeSections.data(), FakeSections.size()); + return ArrayRef(FakeSections.data(), FakeSections.size()); return ArrayRef(); } @@ -842,7 +842,7 @@ // Section table goes past end of file! if (SectionTableOffset + SectionTableSize > FileSize) return createError("section table goes past the end of file"); - return makeArrayRef(First, NumSections); + return ArrayRef(First, NumSections); } template Index: llvm/include/llvm/Object/ELFObjectFile.h =================================================================== --- llvm/include/llvm/Object/ELFObjectFile.h +++ llvm/include/llvm/Object/ELFObjectFile.h @@ -860,13 +860,12 @@ ELFObjectFile::getSectionContents(DataRefImpl Sec) const { const Elf_Shdr *EShdr = getSection(Sec); if (EShdr->sh_type == ELF::SHT_NOBITS) - return makeArrayRef((const uint8_t *)base(), 0); + return ArrayRef((const uint8_t *)base(), (size_t)0); if (Error E = checkOffset(getMemoryBufferRef(), (uintptr_t)base() + EShdr->sh_offset, EShdr->sh_size)) return std::move(E); - return makeArrayRef((const uint8_t *)base() + EShdr->sh_offset, - EShdr->sh_size); + return ArrayRef((const uint8_t *)base() + EShdr->sh_offset, EShdr->sh_size); } template Index: llvm/include/llvm/Support/ARMWinEH.h =================================================================== --- llvm/include/llvm/Support/ARMWinEH.h +++ llvm/include/llvm/Support/ARMWinEH.h @@ -486,7 +486,7 @@ ArrayRef EpilogueScopes() const { assert(E() == 0 && "epilogue scopes are only present when the E bit is 0"); size_t Offset = HeaderWords(*this); - return makeArrayRef(&Data[Offset], EpilogueCount()); + return ArrayRef(&Data[Offset], EpilogueCount()); } ArrayRef UnwindByteCode() const { @@ -494,7 +494,7 @@ + (E() ? 0 : EpilogueCount()); const uint8_t *ByteCode = reinterpret_cast(&Data[Offset]); - return makeArrayRef(ByteCode, CodeWords() * sizeof(uint32_t)); + return ArrayRef(ByteCode, CodeWords() * sizeof(uint32_t)); } uint32_t ExceptionHandlerRVA() const { Index: llvm/include/llvm/Support/BinaryByteStream.h =================================================================== --- llvm/include/llvm/Support/BinaryByteStream.h +++ llvm/include/llvm/Support/BinaryByteStream.h @@ -149,7 +149,7 @@ if (auto EC = checkOffsetForWrite(Offset, Buffer.size())) return EC; - Buffer = makeArrayRef(Data).slice(Offset, Size); + Buffer = ArrayRef(Data).slice(Offset, Size); return Error::success(); } @@ -162,7 +162,7 @@ if (auto EC = checkOffsetForWrite(Offset, 1)) return EC; - Buffer = makeArrayRef(Data).slice(Offset); + Buffer = ArrayRef(Data).slice(Offset); return Error::success(); } Index: llvm/include/llvm/Support/HashBuilder.h =================================================================== --- llvm/include/llvm/Support/HashBuilder.h +++ llvm/include/llvm/Support/HashBuilder.h @@ -58,8 +58,8 @@ /// Users of this function should pay attention to respect endianness /// contraints. void update(StringRef Data) { - update(makeArrayRef(reinterpret_cast(Data.data()), - Data.size())); + update( + ArrayRef(reinterpret_cast(Data.data()), Data.size())); } /// Forward to `HasherT::final()` if available. @@ -131,9 +131,8 @@ add(Value.size()); if (hashbuilder_detail::IsHashableData::value && Endianness == support::endian::system_endianness()) { - this->update( - makeArrayRef(reinterpret_cast(Value.begin()), - Value.size() * sizeof(T))); + this->update(ArrayRef(reinterpret_cast(Value.begin()), + Value.size() * sizeof(T))); } else { for (auto &V : Value) add(V); @@ -160,8 +159,8 @@ // `StringRef::begin()` and `StringRef::end()`. Explicitly call `update` to // guarantee the fast path. add(Value.size()); - this->update(makeArrayRef(reinterpret_cast(Value.begin()), - Value.size())); + this->update(ArrayRef(reinterpret_cast(Value.begin()), + Value.size())); return *this; } @@ -210,7 +209,7 @@ /// friend void addHash(HashBuilderImpl &HBuilder, /// const StructWithFastHash &Value) { /// if (Endianness == support::endian::system_endianness()) { - /// HBuilder.update(makeArrayRef( + /// HBuilder.update(ArrayRef( /// reinterpret_cast(&Value), sizeof(Value))); /// } else { /// // Rely on existing `add` methods to handle endianness. @@ -240,7 +239,7 @@ /// friend void addHash(HashBuilderImpl &HBuilder, /// const CustomContainer &Value) { /// if (Endianness == support::endian::system_endianness()) { - /// HBuilder.update(makeArrayRef( + /// HBuilder.update(ArrayRef( /// reinterpret_cast(&Value.Size), /// sizeof(Value.Size) + Value.Size * sizeof(Value.Elements[0]))); /// } else { @@ -320,8 +319,8 @@ std::enable_if_t::value, HashBuilderImpl &> adjustForEndiannessAndAdd(const T &Value) { T SwappedValue = support::endian::byte_swap(Value, Endianness); - this->update(makeArrayRef(reinterpret_cast(&SwappedValue), - sizeof(SwappedValue))); + this->update(ArrayRef(reinterpret_cast(&SwappedValue), + sizeof(SwappedValue))); return *this; } @@ -349,8 +348,8 @@ Endianness == support::endian::system_endianness(), HashBuilderImpl &> addRangeElementsImpl(T *First, T *Last, std::forward_iterator_tag) { - this->update(makeArrayRef(reinterpret_cast(First), - (Last - First) * sizeof(T))); + this->update(ArrayRef(reinterpret_cast(First), + (Last - First) * sizeof(T))); return *this; } }; Index: llvm/include/llvm/Support/ScopedPrinter.h =================================================================== --- llvm/include/llvm/Support/ScopedPrinter.h +++ llvm/include/llvm/Support/ScopedPrinter.h @@ -353,8 +353,8 @@ } void printBinary(StringRef Label, StringRef Str, ArrayRef Value) { - auto V = makeArrayRef(reinterpret_cast(Value.data()), - Value.size()); + auto V = + ArrayRef(reinterpret_cast(Value.data()), Value.size()); printBinaryImpl(Label, Str, V, false); } @@ -363,14 +363,14 @@ } void printBinary(StringRef Label, ArrayRef Value) { - auto V = makeArrayRef(reinterpret_cast(Value.data()), - Value.size()); + auto V = + ArrayRef(reinterpret_cast(Value.data()), Value.size()); printBinaryImpl(Label, StringRef(), V, false); } void printBinary(StringRef Label, StringRef Value) { - auto V = makeArrayRef(reinterpret_cast(Value.data()), - Value.size()); + auto V = + ArrayRef(reinterpret_cast(Value.data()), Value.size()); printBinaryImpl(Label, StringRef(), V, false); } @@ -384,8 +384,8 @@ } void printBinaryBlock(StringRef Label, StringRef Value) { - auto V = makeArrayRef(reinterpret_cast(Value.data()), - Value.size()); + auto V = + ArrayRef(reinterpret_cast(Value.data()), Value.size()); printBinaryImpl(Label, StringRef(), V, true); } Index: llvm/include/llvm/TableGen/Record.h =================================================================== --- llvm/include/llvm/TableGen/Record.h +++ llvm/include/llvm/TableGen/Record.h @@ -255,7 +255,7 @@ void Profile(FoldingSetNodeID &ID) const; ArrayRef getClasses() const { - return makeArrayRef(getTrailingObjects(), NumClasses); + return ArrayRef(getTrailingObjects(), NumClasses); } using const_record_iterator = Record * const *; @@ -742,7 +742,7 @@ std::string getAsString() const override; ArrayRef getValues() const { - return makeArrayRef(getTrailingObjects(), NumValues); + return ArrayRef(getTrailingObjects(), NumValues); } const_iterator begin() const { return getTrailingObjects(); } @@ -1018,11 +1018,11 @@ } ArrayRef getConds() const { - return makeArrayRef(getTrailingObjects(), NumConds); + return ArrayRef(getTrailingObjects(), NumConds); } ArrayRef getVals() const { - return makeArrayRef(getTrailingObjects()+NumConds, NumConds); + return ArrayRef(getTrailingObjects() + NumConds, NumConds); } Init *Fold(Record *CurRec) const; @@ -1340,7 +1340,7 @@ size_t args_size () const { return NumArgs; } bool args_empty() const { return NumArgs == 0; } - ArrayRef args() const { return makeArrayRef(args_begin(), NumArgs); } + ArrayRef args() const { return ArrayRef(args_begin(), NumArgs); } Init *getBit(unsigned Bit) const override { llvm_unreachable("Illegal bit reference off anonymous def"); @@ -1448,11 +1448,11 @@ } ArrayRef getArgs() const { - return makeArrayRef(getTrailingObjects(), NumArgs); + return ArrayRef(getTrailingObjects(), NumArgs); } ArrayRef getArgNames() const { - return makeArrayRef(getTrailingObjects(), NumArgNames); + return ArrayRef(getTrailingObjects(), NumArgNames); } Init *resolveReferences(Resolver &R) const override; Index: llvm/lib/Analysis/ConstantFolding.cpp =================================================================== --- llvm/lib/Analysis/ConstantFolding.cpp +++ llvm/lib/Analysis/ConstantFolding.cpp @@ -903,11 +903,10 @@ return nullptr; unsigned BitWidth = DL.getTypeSizeInBits(IntIdxTy); - APInt Offset = - APInt(BitWidth, - DL.getIndexedOffsetInType( - SrcElemTy, - makeArrayRef((Value * const *)Ops.data() + 1, Ops.size() - 1))); + APInt Offset = APInt( + BitWidth, + DL.getIndexedOffsetInType( + SrcElemTy, ArrayRef((Value *const *)Ops.data() + 1, Ops.size() - 1))); Ptr = StripPtrCastKeepAS(Ptr); // If this is a GEP of a GEP, fold it all into a single GEP. Index: llvm/lib/Analysis/ConstraintSystem.cpp =================================================================== --- llvm/lib/Analysis/ConstraintSystem.cpp +++ llvm/lib/Analysis/ConstraintSystem.cpp @@ -144,7 +144,7 @@ bool ConstraintSystem::isConditionImplied(SmallVector R) const { // If all variable coefficients are 0, we have 'C >= 0'. If the constant is >= // 0, R is always true, regardless of the system. - if (all_of(makeArrayRef(R).drop_front(1), [](int64_t C) { return C == 0; })) + if (all_of(ArrayRef(R).drop_front(1), [](int64_t C) { return C == 0; })) return R[0] >= 0; // If there is no solution with the negation of R added to the system, the Index: llvm/lib/Analysis/InstructionSimplify.cpp =================================================================== --- llvm/lib/Analysis/InstructionSimplify.cpp +++ llvm/lib/Analysis/InstructionSimplify.cpp @@ -4235,7 +4235,7 @@ if (auto *GEP = dyn_cast(I)) return PreventSelfSimplify(simplifyGEPInst( - GEP->getSourceElementType(), NewOps[0], makeArrayRef(NewOps).slice(1), + GEP->getSourceElementType(), NewOps[0], ArrayRef(NewOps).slice(1), GEP->isInBounds(), Q, MaxRecurse - 1)); if (isa(I)) @@ -6625,8 +6625,7 @@ case Instruction::GetElementPtr: { auto *GEPI = cast(I); return simplifyGEPInst(GEPI->getSourceElementType(), NewOps[0], - makeArrayRef(NewOps).slice(1), GEPI->isInBounds(), - Q); + ArrayRef(NewOps).slice(1), GEPI->isInBounds(), Q); } case Instruction::InsertValue: { InsertValueInst *IV = cast(I); Index: llvm/lib/Analysis/LazyCallGraph.cpp =================================================================== --- llvm/lib/Analysis/LazyCallGraph.cpp +++ llvm/lib/Analysis/LazyCallGraph.cpp @@ -673,7 +673,7 @@ // Run the user's callback on the merged SCCs before we actually merge them. if (MergeCB) - MergeCB(makeArrayRef(MergeRange.begin(), MergeRange.end())); + MergeCB(ArrayRef(MergeRange.begin(), MergeRange.end())); // If the merge range is empty, then adding the edge didn't actually form any // new cycles. We're done. Index: llvm/lib/Analysis/PHITransAddr.cpp =================================================================== --- llvm/lib/Analysis/PHITransAddr.cpp +++ llvm/lib/Analysis/PHITransAddr.cpp @@ -405,7 +405,7 @@ } GetElementPtrInst *Result = GetElementPtrInst::Create( - GEP->getSourceElementType(), GEPOps[0], makeArrayRef(GEPOps).slice(1), + GEP->getSourceElementType(), GEPOps[0], ArrayRef(GEPOps).slice(1), InVal->getName() + ".phi.trans.insert", PredBB->getTerminator()); Result->setDebugLoc(Inst->getDebugLoc()); Result->setIsInBounds(GEP->isInBounds()); Index: llvm/lib/Analysis/ValueTracking.cpp =================================================================== --- llvm/lib/Analysis/ValueTracking.cpp +++ llvm/lib/Analysis/ValueTracking.cpp @@ -4132,8 +4132,8 @@ return nullptr; // Insert the value in the new (sub) aggregate - return InsertValueInst::Create(To, V, makeArrayRef(Idxs).slice(IdxSkip), - "tmp", InsertBefore); + return InsertValueInst::Create(To, V, ArrayRef(Idxs).slice(IdxSkip), "tmp", + InsertBefore); } // This helper takes a nested struct and extracts a part of it (which is again a @@ -4205,7 +4205,7 @@ // %C = insertvalue {i32, i32 } %A, i32 11, 1 // which allows the unused 0,0 element from the nested struct to be // removed. - return BuildSubAggregate(V, makeArrayRef(idx_range.begin(), req_idx), + return BuildSubAggregate(V, ArrayRef(idx_range.begin(), req_idx), InsertBefore); } @@ -4220,8 +4220,7 @@ // requested (though possibly only partially). Now we recursively look at // the inserted value, passing any remaining indices. return FindInsertedValue(I->getInsertedValueOperand(), - makeArrayRef(req_idx, idx_range.end()), - InsertBefore); + ArrayRef(req_idx, idx_range.end()), InsertBefore); } if (ExtractValueInst *I = dyn_cast(V)) { Index: llvm/lib/AsmParser/LLParser.cpp =================================================================== --- llvm/lib/AsmParser/LLParser.cpp +++ llvm/lib/AsmParser/LLParser.cpp @@ -5795,7 +5795,7 @@ " of struct initializer doesn't match struct element type"); V = ConstantStruct::get( - ST, makeArrayRef(ID.ConstantStructElts.get(), ID.UIntVal)); + ST, ArrayRef(ID.ConstantStructElts.get(), ID.UIntVal)); } else return error(ID.Loc, "constant expression type mismatch"); return false; Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp =================================================================== --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -547,7 +547,7 @@ static bool classof(const Value *V) { return V->getValueID() == SubclassID; } ArrayRef getOperandIDs() const { - return makeArrayRef(getTrailingObjects(), NumOperands); + return ArrayRef(getTrailingObjects(), NumOperands); } std::optional getInRangeIndex() const { @@ -1537,9 +1537,9 @@ C = ConstantExpr::getCompare(BC->Flags, ConstOps[0], ConstOps[1]); break; case Instruction::GetElementPtr: - C = ConstantExpr::getGetElementPtr( - BC->SrcElemTy, ConstOps[0], makeArrayRef(ConstOps).drop_front(), - BC->Flags, BC->getInRangeIndex()); + C = ConstantExpr::getGetElementPtr(BC->SrcElemTy, ConstOps[0], + ArrayRef(ConstOps).drop_front(), + BC->Flags, BC->getInRangeIndex()); break; case Instruction::Select: C = ConstantExpr::getSelect(ConstOps[0], ConstOps[1], ConstOps[2]); @@ -1624,8 +1624,8 @@ break; case Instruction::GetElementPtr: I = GetElementPtrInst::Create(BC->SrcElemTy, Ops[0], - makeArrayRef(Ops).drop_front(), - "constexpr", InsertBB); + ArrayRef(Ops).drop_front(), "constexpr", + InsertBB); if (BC->Flags) cast(I)->setIsInBounds(); break; @@ -5392,7 +5392,7 @@ unsigned ActiveWords = 1; if (ValueBitWidth > 64) ActiveWords = Record[CurIdx++]; - Low = readWideAPInt(makeArrayRef(&Record[CurIdx], ActiveWords), + Low = readWideAPInt(ArrayRef(&Record[CurIdx], ActiveWords), ValueBitWidth); CurIdx += ActiveWords; @@ -5400,8 +5400,8 @@ ActiveWords = 1; if (ValueBitWidth > 64) ActiveWords = Record[CurIdx++]; - APInt High = readWideAPInt( - makeArrayRef(&Record[CurIdx], ActiveWords), ValueBitWidth); + APInt High = readWideAPInt(ArrayRef(&Record[CurIdx], ActiveWords), + ValueBitWidth); CurIdx += ActiveWords; // FIXME: It is not clear whether values in the range should be Index: llvm/lib/Bitcode/Reader/MetadataLoader.cpp =================================================================== --- llvm/lib/Bitcode/Reader/MetadataLoader.cpp +++ llvm/lib/Bitcode/Reader/MetadataLoader.cpp @@ -1393,7 +1393,7 @@ if (IsBigInt) { const uint64_t BitWidth = Record[1]; const size_t NumWords = Record.size() - 3; - Value = readWideAPInt(makeArrayRef(&Record[3], NumWords), BitWidth); + Value = readWideAPInt(ArrayRef(&Record[3], NumWords), BitWidth); } else Value = APInt(64, unrotateSign(Record[1]), !IsUnsigned); Index: llvm/lib/Bitcode/Writer/ValueEnumerator.h =================================================================== --- llvm/lib/Bitcode/Writer/ValueEnumerator.h +++ llvm/lib/Bitcode/Writer/ValueEnumerator.h @@ -201,12 +201,12 @@ /// Get the MDString metadata for this block. ArrayRef getMDStrings() const { - return makeArrayRef(MDs).slice(NumModuleMDs, NumMDStrings); + return ArrayRef(MDs).slice(NumModuleMDs, NumMDStrings); } /// Get the non-MDString metadata for this block. ArrayRef getNonMDStrings() const { - return makeArrayRef(MDs).slice(NumModuleMDs).slice(NumMDStrings); + return ArrayRef(MDs).slice(NumModuleMDs).slice(NumMDStrings); } const TypeList &getTypes() const { return Types; } Index: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp =================================================================== --- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -2044,7 +2044,7 @@ TypeIndex ReturnTypeIndex = TypeIndex::Void(); ArrayRef ArgTypeIndices = std::nullopt; if (!ReturnAndArgTypeIndices.empty()) { - auto ReturnAndArgTypesRef = makeArrayRef(ReturnAndArgTypeIndices); + auto ReturnAndArgTypesRef = ArrayRef(ReturnAndArgTypeIndices); ReturnTypeIndex = ReturnAndArgTypesRef.front(); ArgTypeIndices = ReturnAndArgTypesRef.drop_front(); } Index: llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp =================================================================== --- llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp +++ llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp @@ -42,7 +42,7 @@ void DIEHash::addString(StringRef Str) { LLVM_DEBUG(dbgs() << "Adding string " << Str << " to hash.\n"); Hash.update(Str); - Hash.update(makeArrayRef((uint8_t)'\0')); + Hash.update(ArrayRef((uint8_t)'\0')); } // FIXME: The LEB128 routines are copied and only slightly modified out of @@ -389,7 +389,7 @@ } // Following the last (or if there are no children), append a zero byte. - Hash.update(makeArrayRef((uint8_t)'\0')); + Hash.update(ArrayRef((uint8_t)'\0')); } /// This is based on the type signature computation given in section 7.27 of the Index: llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h =================================================================== --- llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h +++ llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h @@ -109,19 +109,18 @@ ArrayRef getEntries(const List &L) const { size_t LI = getIndex(L); - return makeArrayRef(Entries) - .slice(Lists[LI].EntryOffset, getNumEntries(LI)); + return ArrayRef(Entries).slice(Lists[LI].EntryOffset, getNumEntries(LI)); } ArrayRef getBytes(const Entry &E) const { size_t EI = getIndex(E); - return makeArrayRef(DWARFBytes.begin(), DWARFBytes.end()) + return ArrayRef(DWARFBytes.begin(), DWARFBytes.end()) .slice(Entries[EI].ByteOffset, getNumBytes(EI)); } ArrayRef getComments(const Entry &E) const { size_t EI = getIndex(E); - return makeArrayRef(Comments) - .slice(Entries[EI].CommentOffset, getNumComments(EI)); + return ArrayRef(Comments).slice(Entries[EI].CommentOffset, + getNumComments(EI)); } private: Index: llvm/lib/CodeGen/AtomicExpandPass.cpp =================================================================== --- llvm/lib/CodeGen/AtomicExpandPass.cpp +++ llvm/lib/CodeGen/AtomicExpandPass.cpp @@ -1664,19 +1664,19 @@ case AtomicRMWInst::BAD_BINOP: llvm_unreachable("Should not have BAD_BINOP."); case AtomicRMWInst::Xchg: - return makeArrayRef(LibcallsXchg); + return ArrayRef(LibcallsXchg); case AtomicRMWInst::Add: - return makeArrayRef(LibcallsAdd); + return ArrayRef(LibcallsAdd); case AtomicRMWInst::Sub: - return makeArrayRef(LibcallsSub); + return ArrayRef(LibcallsSub); case AtomicRMWInst::And: - return makeArrayRef(LibcallsAnd); + return ArrayRef(LibcallsAnd); case AtomicRMWInst::Or: - return makeArrayRef(LibcallsOr); + return ArrayRef(LibcallsOr); case AtomicRMWInst::Xor: - return makeArrayRef(LibcallsXor); + return ArrayRef(LibcallsXor); case AtomicRMWInst::Nand: - return makeArrayRef(LibcallsNand); + return ArrayRef(LibcallsNand); case AtomicRMWInst::Max: case AtomicRMWInst::Min: case AtomicRMWInst::UMax: Index: llvm/lib/CodeGen/CodeGenPrepare.cpp =================================================================== --- llvm/lib/CodeGen/CodeGenPrepare.cpp +++ llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -1241,7 +1241,7 @@ } Value *Replacement = Builder.CreateGEP(Derived->getSourceElementType(), ActualRelocatedBase, - makeArrayRef(OffsetV)); + ArrayRef(OffsetV)); Replacement->takeName(ToReplace); // If the newly generated derived pointer's type does not match the original // derived pointer's type, cast the new derived pointer to match it. Same @@ -5680,11 +5680,10 @@ // If the final index isn't a vector, emit a scalar GEP containing all ops // and a vector GEP with all zeroes final index. if (!Ops[FinalIndex]->getType()->isVectorTy()) { - NewAddr = - Builder.CreateGEP(SourceTy, Ops[0], makeArrayRef(Ops).drop_front()); + NewAddr = Builder.CreateGEP(SourceTy, Ops[0], ArrayRef(Ops).drop_front()); auto *IndexTy = VectorType::get(ScalarIndexTy, NumElts); auto *SecondTy = GetElementPtrInst::getIndexedType( - SourceTy, makeArrayRef(Ops).drop_front()); + SourceTy, ArrayRef(Ops).drop_front()); NewAddr = Builder.CreateGEP(SecondTy, NewAddr, Constant::getNullValue(IndexTy)); } else { @@ -5695,10 +5694,9 @@ if (Ops.size() != 2) { // Replace the last index with 0. Ops[FinalIndex] = Constant::getNullValue(ScalarIndexTy); - Base = - Builder.CreateGEP(SourceTy, Base, makeArrayRef(Ops).drop_front()); + Base = Builder.CreateGEP(SourceTy, Base, ArrayRef(Ops).drop_front()); SourceTy = GetElementPtrInst::getIndexedType( - SourceTy, makeArrayRef(Ops).drop_front()); + SourceTy, ArrayRef(Ops).drop_front()); } // Now create the GEP with scalar pointer and vector index. Index: llvm/lib/CodeGen/GlobalISel/CallLowering.cpp =================================================================== --- llvm/lib/CodeGen/GlobalISel/CallLowering.cpp +++ llvm/lib/CodeGen/GlobalISel/CallLowering.cpp @@ -680,7 +680,7 @@ if (VA.needsCustom()) { std::function Thunk; unsigned NumArgRegs = Handler.assignCustomValue( - Args[i], makeArrayRef(ArgLocs).slice(j), &Thunk); + Args[i], ArrayRef(ArgLocs).slice(j), &Thunk); if (Thunk) DelayedOutgoingRegAssignments.emplace_back(Thunk); if (!NumArgRegs) Index: llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp =================================================================== --- llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -2367,7 +2367,7 @@ SwiftInVReg = MRI->createGenericVirtualRegister(Ty); MIRBuilder.buildCopy(SwiftInVReg, SwiftError.getOrCreateVRegUseAt( &CB, &MIRBuilder.getMBB(), Arg)); - Args.emplace_back(makeArrayRef(SwiftInVReg)); + Args.emplace_back(ArrayRef(SwiftInVReg)); SwiftErrorVReg = SwiftError.getOrCreateVRegDefAt(&CB, &MIRBuilder.getMBB(), Arg); continue; Index: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp =================================================================== --- llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -5205,8 +5205,8 @@ CarryIn = CarryOut; } insertParts(MI.getOperand(0).getReg(), RegTy, NarrowTy, - makeArrayRef(DstRegs).take_front(NarrowParts), LeftoverTy, - makeArrayRef(DstRegs).drop_front(NarrowParts)); + ArrayRef(DstRegs).take_front(NarrowParts), LeftoverTy, + ArrayRef(DstRegs).drop_front(NarrowParts)); MI.eraseFromParent(); return Legalized; Index: llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp =================================================================== --- llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp +++ llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp @@ -887,7 +887,7 @@ ConstantInt::get(Type::getInt32Ty(LI->getContext()), 0), ConstantInt::get(Type::getInt32Ty(LI->getContext()), i), }; - int64_t Ofs = DL.getIndexedOffsetInType(Result.VTy, makeArrayRef(Idx, 2)); + int64_t Ofs = DL.getIndexedOffsetInType(Result.VTy, ArrayRef(Idx, 2)); Result.EI[i] = ElementInfo(Offset + Ofs, i == 0 ? LI : nullptr); } Index: llvm/lib/CodeGen/MachineCombiner.cpp =================================================================== --- llvm/lib/CodeGen/MachineCombiner.cpp +++ llvm/lib/CodeGen/MachineCombiner.cpp @@ -464,8 +464,8 @@ instr2instrSC(InsInstrs, InsInstrsSC); instr2instrSC(DelInstrs, DelInstrsSC); - ArrayRef MSCInsArr = makeArrayRef(InsInstrsSC); - ArrayRef MSCDelArr = makeArrayRef(DelInstrsSC); + ArrayRef MSCInsArr = ArrayRef(InsInstrsSC); + ArrayRef MSCDelArr = ArrayRef(DelInstrsSC); // Compute new resource length. unsigned ResLenAfterCombine = Index: llvm/lib/CodeGen/MachineTraceMetrics.cpp =================================================================== --- llvm/lib/CodeGen/MachineTraceMetrics.cpp +++ llvm/lib/CodeGen/MachineTraceMetrics.cpp @@ -146,7 +146,7 @@ "getResources() must be called before getProcResourceCycles()"); unsigned PRKinds = SchedModel.getNumProcResourceKinds(); assert((MBBNum+1) * PRKinds <= ProcResourceCycles.size()); - return makeArrayRef(ProcResourceCycles.data() + MBBNum * PRKinds, PRKinds); + return ArrayRef(ProcResourceCycles.data() + MBBNum * PRKinds, PRKinds); } //===----------------------------------------------------------------------===// @@ -264,7 +264,7 @@ getProcResourceDepths(unsigned MBBNum) const { unsigned PRKinds = MTM.SchedModel.getNumProcResourceKinds(); assert((MBBNum+1) * PRKinds <= ProcResourceDepths.size()); - return makeArrayRef(ProcResourceDepths.data() + MBBNum * PRKinds, PRKinds); + return ArrayRef(ProcResourceDepths.data() + MBBNum * PRKinds, PRKinds); } /// Get an array of processor resource heights for MBB. Indexed by processor @@ -277,7 +277,7 @@ getProcResourceHeights(unsigned MBBNum) const { unsigned PRKinds = MTM.SchedModel.getNumProcResourceKinds(); assert((MBBNum+1) * PRKinds <= ProcResourceHeights.size()); - return makeArrayRef(ProcResourceHeights.data() + MBBNum * PRKinds, PRKinds); + return ArrayRef(ProcResourceHeights.data() + MBBNum * PRKinds, PRKinds); } //===----------------------------------------------------------------------===// Index: llvm/lib/CodeGen/RegAllocGreedy.cpp =================================================================== --- llvm/lib/CodeGen/RegAllocGreedy.cpp +++ llvm/lib/CodeGen/RegAllocGreedy.cpp @@ -681,7 +681,7 @@ assert(T < GroupSize && "Array overflow"); TBS[T] = Number; if (++T == GroupSize) { - SpillPlacer->addLinks(makeArrayRef(TBS, T)); + SpillPlacer->addLinks(ArrayRef(TBS, T)); T = 0; } continue; @@ -710,13 +710,13 @@ BCS[B].Exit = SpillPlacement::PrefSpill; if (++B == GroupSize) { - SpillPlacer->addConstraints(makeArrayRef(BCS, B)); + SpillPlacer->addConstraints(ArrayRef(BCS, B)); B = 0; } } - SpillPlacer->addConstraints(makeArrayRef(BCS, B)); - SpillPlacer->addLinks(makeArrayRef(TBS, T)); + SpillPlacer->addConstraints(ArrayRef(BCS, B)); + SpillPlacer->addLinks(ArrayRef(TBS, T)); return true; } @@ -757,7 +757,7 @@ // Compute through constraints from the interference, or assume that all // through blocks prefer spilling when forming compact regions. - auto NewBlocks = makeArrayRef(ActiveBlocks).slice(AddedTo); + auto NewBlocks = ArrayRef(ActiveBlocks).slice(AddedTo); if (Cand.PhysReg) { if (!addThroughConstraints(Cand.Intf, NewBlocks)) return false; Index: llvm/lib/CodeGen/RegisterUsageInfo.cpp =================================================================== --- llvm/lib/CodeGen/RegisterUsageInfo.cpp +++ llvm/lib/CodeGen/RegisterUsageInfo.cpp @@ -63,7 +63,7 @@ PhysicalRegisterUsageInfo::getRegUsageInfo(const Function &FP) { auto It = RegMasks.find(&FP); if (It != RegMasks.end()) - return makeArrayRef(It->second); + return ArrayRef(It->second); return ArrayRef(); } Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -8463,7 +8463,7 @@ // Check if the bytes of the OR we are looking at match with either big or // little endian value load std::optional IsBigEndian = isBigEndian( - makeArrayRef(ByteOffsets).drop_back(ZeroExtendedBytes), FirstOffset); + ArrayRef(ByteOffsets).drop_back(ZeroExtendedBytes), FirstOffset); if (!IsBigEndian) return SDValue(); Index: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -843,7 +843,7 @@ SDLoc dl(N); SDValue Res = DAG.getNode(N->getOpcode(), dl, DAG.getVTList(VT, SVT), - makeArrayRef(Ops, NumOps)); + ArrayRef(Ops, NumOps)); // Modified the sum result - switch anything that used the old sum to use // the new one. @@ -2935,13 +2935,13 @@ Lo = DAG.getNode(ISD::UADDO, dl, VTList, LoOps); HiOps[2] = Lo.getValue(1); Hi = DAG.computeKnownBits(HiOps[2]).isZero() - ? DAG.getNode(ISD::UADDO, dl, VTList, makeArrayRef(HiOps, 2)) + ? DAG.getNode(ISD::UADDO, dl, VTList, ArrayRef(HiOps, 2)) : DAG.getNode(ISD::ADDCARRY, dl, VTList, HiOps); } else { Lo = DAG.getNode(ISD::USUBO, dl, VTList, LoOps); HiOps[2] = Lo.getValue(1); Hi = DAG.computeKnownBits(HiOps[2]).isZero() - ? DAG.getNode(ISD::USUBO, dl, VTList, makeArrayRef(HiOps, 2)) + ? DAG.getNode(ISD::USUBO, dl, VTList, ArrayRef(HiOps, 2)) : DAG.getNode(ISD::SUBCARRY, dl, VTList, HiOps); } return; @@ -2984,11 +2984,11 @@ if (N->getOpcode() == ISD::ADD) { RevOpc = ISD::SUB; Lo = DAG.getNode(ISD::UADDO, dl, VTList, LoOps); - Hi = DAG.getNode(ISD::ADD, dl, NVT, makeArrayRef(HiOps, 2)); + Hi = DAG.getNode(ISD::ADD, dl, NVT, ArrayRef(HiOps, 2)); } else { RevOpc = ISD::ADD; Lo = DAG.getNode(ISD::USUBO, dl, VTList, LoOps); - Hi = DAG.getNode(ISD::SUB, dl, NVT, makeArrayRef(HiOps, 2)); + Hi = DAG.getNode(ISD::SUB, dl, NVT, ArrayRef(HiOps, 2)); } SDValue OVF = Lo.getValue(1); @@ -3009,7 +3009,7 @@ if (N->getOpcode() == ISD::ADD) { Lo = DAG.getNode(ISD::ADD, dl, NVT, LoOps); - Hi = DAG.getNode(ISD::ADD, dl, NVT, makeArrayRef(HiOps, 2)); + Hi = DAG.getNode(ISD::ADD, dl, NVT, ArrayRef(HiOps, 2)); SDValue Cmp = DAG.getSetCC(dl, getSetCCResultType(NVT), Lo, LoOps[0], ISD::SETULT); @@ -3023,7 +3023,7 @@ Hi = DAG.getNode(ISD::ADD, dl, NVT, Hi, Carry); } else { Lo = DAG.getNode(ISD::SUB, dl, NVT, LoOps); - Hi = DAG.getNode(ISD::SUB, dl, NVT, makeArrayRef(HiOps, 2)); + Hi = DAG.getNode(ISD::SUB, dl, NVT, ArrayRef(HiOps, 2)); SDValue Cmp = DAG.getSetCC(dl, getSetCCResultType(LoOps[0].getValueType()), LoOps[0], LoOps[1], ISD::SETULT); Index: llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp +++ llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp @@ -357,8 +357,7 @@ SmallVector Ops; IntegerToVector(N->getOperand(0), NumElts, Ops, NVT.getVectorElementType()); - SDValue Vec = - DAG.getBuildVector(NVT, dl, makeArrayRef(Ops.data(), NumElts)); + SDValue Vec = DAG.getBuildVector(NVT, dl, ArrayRef(Ops.data(), NumElts)); return DAG.getNode(ISD::BITCAST, dl, N->getValueType(0), Vec); } Index: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -2645,7 +2645,7 @@ // input vectors to use as shuffle operands. unsigned FirstMaskIdx = High * NewElts; SmallVector Mask(NewElts * std::size(Inputs), UndefMaskElem); - copy(makeArrayRef(OrigMask).slice(FirstMaskIdx, NewElts), Mask.begin()); + copy(ArrayRef(OrigMask).slice(FirstMaskIdx, NewElts), Mask.begin()); assert(!Output && "Expected default initialized initial value."); TryPeekThroughShufflesInputs(Mask); MakeUniqueInputs(Mask); @@ -4257,7 +4257,7 @@ ConcatOps[j] = UndefVal; } return DAG.getNode(ISD::CONCAT_VECTORS, dl, WidenVT, - makeArrayRef(ConcatOps.data(), NumOps)); + ArrayRef(ConcatOps.data(), NumOps)); } SDValue DAGTypeLegalizer::WidenVecRes_BinaryCanTrap(SDNode *N) { @@ -6854,7 +6854,7 @@ if (WidenWidth == LdTy.getSizeInBits() * (End - Idx)) return DAG.getNode(ISD::CONCAT_VECTORS, dl, WidenVT, - makeArrayRef(&ConcatOps[Idx], End - Idx)); + ArrayRef(&ConcatOps[Idx], End - Idx)); // We need to fill the rest with undefs to build the vector. unsigned NumOps = Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -1422,7 +1422,7 @@ } if (const uint32_t *RegMask = getNodeRegMask(Node)) CheckForLiveRegDefMasked(SU, RegMask, - makeArrayRef(LiveRegDefs.get(), TRI->getNumRegs()), + ArrayRef(LiveRegDefs.get(), TRI->getNumRegs()), RegAdded, LRegs); const MCInstrDesc &MCID = TII->get(Node->getMachineOpcode()); Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp @@ -192,7 +192,7 @@ "expected an unused glue value"); CloneNodeWithValues(N, DAG, - makeArrayRef(N->value_begin(), N->getNumValues() - 1)); + ArrayRef(N->value_begin(), N->getNumValues() - 1)); } /// ClusterNeighboringLoads - Force nearby loads together by "gluing" them. Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -4186,7 +4186,7 @@ if (ChainI == MaxParallelChains) { assert(PendingLoads.empty() && "PendingLoads must be serialized first"); SDValue Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, - makeArrayRef(Chains.data(), ChainI)); + ArrayRef(Chains.data(), ChainI)); Root = Chain; ChainI = 0; } @@ -4208,7 +4208,7 @@ if (!ConstantMemory) { SDValue Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, - makeArrayRef(Chains.data(), ChainI)); + ArrayRef(Chains.data(), ChainI)); if (isVolatile) DAG.setRoot(Chain); else @@ -4329,7 +4329,7 @@ // See visitLoad comments. if (ChainI == MaxParallelChains) { SDValue Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, - makeArrayRef(Chains.data(), ChainI)); + ArrayRef(Chains.data(), ChainI)); Root = Chain; ChainI = 0; } @@ -4345,7 +4345,7 @@ } SDValue StoreNode = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, - makeArrayRef(Chains.data(), ChainI)); + ArrayRef(Chains.data(), ChainI)); setValue(&I, StoreNode); DAG.setRoot(StoreNode); } @@ -9270,7 +9270,7 @@ if (StructType *StructResult = dyn_cast(CallResultType)) ResultTypes = StructResult->elements(); else if (!CallResultType->isVoidTy()) - ResultTypes = makeArrayRef(CallResultType); + ResultTypes = ArrayRef(CallResultType); auto CurResultType = ResultTypes.begin(); auto handleRegAssign = [&](SDValue V) { @@ -10784,7 +10784,7 @@ dyn_cast(ArgValues[0].getNode())) FuncInfo->setArgumentFrameIndex(&Arg, FI->getIndex()); - SDValue Res = DAG.getMergeValues(makeArrayRef(ArgValues.data(), NumValues), + SDValue Res = DAG.getMergeValues(ArrayRef(ArgValues.data(), NumValues), SDB->getCurSDLoc()); SDB->setValue(&Arg, Res); Index: llvm/lib/CodeGen/SjLjEHPrepare.cpp =================================================================== --- llvm/lib/CodeGen/SjLjEHPrepare.cpp +++ llvm/lib/CodeGen/SjLjEHPrepare.cpp @@ -391,7 +391,7 @@ lowerAcrossUnwindEdges(F, Invokes); Value *FuncCtx = - setupFunctionContext(F, makeArrayRef(LPads.begin(), LPads.end())); + setupFunctionContext(F, ArrayRef(LPads.begin(), LPads.end())); BasicBlock *EntryBB = &F.front(); IRBuilder<> Builder(EntryBB->getTerminator()); Index: llvm/lib/CodeGen/VirtRegMap.cpp =================================================================== --- llvm/lib/CodeGen/VirtRegMap.cpp +++ llvm/lib/CodeGen/VirtRegMap.cpp @@ -475,7 +475,7 @@ // clobbering. for (int E = MIs.size(), PrevE = E; E > 1; PrevE = E) { for (int I = E; I--; ) - if (!anyRegsAlias(MIs[I], makeArrayRef(MIs).take_front(E), TRI)) { + if (!anyRegsAlias(MIs[I], ArrayRef(MIs).take_front(E), TRI)) { if (I + 1 != E) std::swap(MIs[I], MIs[E - 1]); --E; Index: llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp +++ llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp @@ -68,7 +68,7 @@ // the general case. uint32_t Offset = getCurrentOffset(); std::optional Min = Limits.front().bytesRemaining(Offset); - for (auto X : makeArrayRef(Limits).drop_front()) { + for (auto X : ArrayRef(Limits).drop_front()) { std::optional ThisMin = X.bytesRemaining(Offset); if (ThisMin) Min = Min ? std::min(*Min, *ThisMin) : *ThisMin; Index: llvm/lib/DebugInfo/CodeView/ContinuationRecordBuilder.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/ContinuationRecordBuilder.cpp +++ llvm/lib/DebugInfo/CodeView/ContinuationRecordBuilder.cpp @@ -224,7 +224,7 @@ std::vector Types; Types.reserve(SegmentOffsets.size()); - auto SO = makeArrayRef(SegmentOffsets); + auto SO = ArrayRef(SegmentOffsets); uint32_t End = SegmentWriter.getOffset(); Index: llvm/lib/DebugInfo/CodeView/DebugChecksumsSubsection.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/DebugChecksumsSubsection.cpp +++ llvm/lib/DebugInfo/CodeView/DebugChecksumsSubsection.cpp @@ -71,7 +71,7 @@ if (!Bytes.empty()) { uint8_t *Copy = Storage.Allocate(Bytes.size()); ::memcpy(Copy, Bytes.data(), Bytes.size()); - Entry.Checksum = makeArrayRef(Copy, Bytes.size()); + Entry.Checksum = ArrayRef(Copy, Bytes.size()); } Entry.FileNameOffset = Strings.insert(FileName); @@ -99,7 +99,7 @@ Header.FileNameOffset = FC.FileNameOffset; if (auto EC = Writer.writeObject(Header)) return EC; - if (auto EC = Writer.writeArray(makeArrayRef(FC.Checksum))) + if (auto EC = Writer.writeArray(ArrayRef(FC.Checksum))) return EC; if (auto EC = Writer.padToAlignment(4)) return EC; Index: llvm/lib/DebugInfo/CodeView/DebugCrossImpSubsection.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/DebugCrossImpSubsection.cpp +++ llvm/lib/DebugInfo/CodeView/DebugCrossImpSubsection.cpp @@ -89,7 +89,7 @@ Imp.Count = Item->getValue().size(); if (auto EC = Writer.writeObject(Imp)) return EC; - if (auto EC = Writer.writeArray(makeArrayRef(Item->getValue()))) + if (auto EC = Writer.writeArray(ArrayRef(Item->getValue()))) return EC; } return Error::success(); Index: llvm/lib/DebugInfo/CodeView/DebugFrameDataSubsection.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/DebugFrameDataSubsection.cpp +++ llvm/lib/DebugInfo/CodeView/DebugFrameDataSubsection.cpp @@ -52,7 +52,7 @@ llvm::sort(SortedFrames, [](const FrameData &LHS, const FrameData &RHS) { return LHS.RvaStart < RHS.RvaStart; }); - if (auto EC = Writer.writeArray(makeArrayRef(SortedFrames))) + if (auto EC = Writer.writeArray(ArrayRef(SortedFrames))) return EC; return Error::success(); } Index: llvm/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp +++ llvm/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp @@ -98,7 +98,7 @@ if (auto EC = Writer.writeInteger(E.ExtraFiles.size())) return EC; - if (auto EC = Writer.writeArray(makeArrayRef(E.ExtraFiles))) + if (auto EC = Writer.writeArray(ArrayRef(E.ExtraFiles))) return EC; } Index: llvm/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp +++ llvm/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp @@ -123,11 +123,11 @@ if (auto EC = Writer.writeObject(BlockHeader)) return EC; - if (auto EC = Writer.writeArray(makeArrayRef(B.Lines))) + if (auto EC = Writer.writeArray(ArrayRef(B.Lines))) return EC; if (hasColumnInfo()) { - if (auto EC = Writer.writeArray(makeArrayRef(B.Columns))) + if (auto EC = Writer.writeArray(ArrayRef(B.Columns))) return EC; } } Index: llvm/lib/DebugInfo/CodeView/DebugSymbolRVASubsection.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/DebugSymbolRVASubsection.cpp +++ llvm/lib/DebugInfo/CodeView/DebugSymbolRVASubsection.cpp @@ -27,7 +27,7 @@ : DebugSubsection(DebugSubsectionKind::CoffSymbolRVA) {} Error DebugSymbolRVASubsection::commit(BinaryStreamWriter &Writer) const { - return Writer.writeArray(makeArrayRef(RVAs)); + return Writer.writeArray(ArrayRef(RVAs)); } uint32_t DebugSymbolRVASubsection::calculateSerializedSize() const { Index: llvm/lib/DebugInfo/CodeView/EnumTables.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/EnumTables.cpp +++ llvm/lib/DebugInfo/CodeView/EnumTables.cpp @@ -437,125 +437,125 @@ namespace codeview { ArrayRef> getSymbolTypeNames() { - return makeArrayRef(SymbolTypeNames); + return ArrayRef(SymbolTypeNames); } ArrayRef> getTypeLeafNames() { - return makeArrayRef(TypeLeafNames); + return ArrayRef(TypeLeafNames); } ArrayRef> getRegisterNames(CPUType Cpu) { if (Cpu == CPUType::ARMNT) { - return makeArrayRef(RegisterNames_ARM); + return ArrayRef(RegisterNames_ARM); } else if (Cpu == CPUType::ARM64) { - return makeArrayRef(RegisterNames_ARM64); + return ArrayRef(RegisterNames_ARM64); } - return makeArrayRef(RegisterNames_X86); + return ArrayRef(RegisterNames_X86); } ArrayRef> getPublicSymFlagNames() { - return makeArrayRef(PublicSymFlagNames); + return ArrayRef(PublicSymFlagNames); } ArrayRef> getProcSymFlagNames() { - return makeArrayRef(ProcSymFlagNames); + return ArrayRef(ProcSymFlagNames); } ArrayRef> getLocalFlagNames() { - return makeArrayRef(LocalFlags); + return ArrayRef(LocalFlags); } ArrayRef> getFrameCookieKindNames() { - return makeArrayRef(FrameCookieKinds); + return ArrayRef(FrameCookieKinds); } ArrayRef> getSourceLanguageNames() { - return makeArrayRef(SourceLanguages); + return ArrayRef(SourceLanguages); } ArrayRef> getCompileSym2FlagNames() { - return makeArrayRef(CompileSym2FlagNames); + return ArrayRef(CompileSym2FlagNames); } ArrayRef> getCompileSym3FlagNames() { - return makeArrayRef(CompileSym3FlagNames); + return ArrayRef(CompileSym3FlagNames); } ArrayRef> getFileChecksumNames() { - return makeArrayRef(FileChecksumNames); + return ArrayRef(FileChecksumNames); } ArrayRef> getCPUTypeNames() { - return makeArrayRef(CPUTypeNames); + return ArrayRef(CPUTypeNames); } ArrayRef> getFrameProcSymFlagNames() { - return makeArrayRef(FrameProcSymFlagNames); + return ArrayRef(FrameProcSymFlagNames); } ArrayRef> getExportSymFlagNames() { - return makeArrayRef(ExportSymFlagNames); + return ArrayRef(ExportSymFlagNames); } ArrayRef> getModuleSubstreamKindNames() { - return makeArrayRef(ModuleSubstreamKindNames); + return ArrayRef(ModuleSubstreamKindNames); } ArrayRef> getThunkOrdinalNames() { - return makeArrayRef(ThunkOrdinalNames); + return ArrayRef(ThunkOrdinalNames); } ArrayRef> getTrampolineNames() { - return makeArrayRef(TrampolineNames); + return ArrayRef(TrampolineNames); } ArrayRef> getImageSectionCharacteristicNames() { - return makeArrayRef(ImageSectionCharacteristicNames); + return ArrayRef(ImageSectionCharacteristicNames); } ArrayRef> getClassOptionNames() { - return makeArrayRef(ClassOptionNames); + return ArrayRef(ClassOptionNames); } ArrayRef> getMemberAccessNames() { - return makeArrayRef(MemberAccessNames); + return ArrayRef(MemberAccessNames); } ArrayRef> getMethodOptionNames() { - return makeArrayRef(MethodOptionNames); + return ArrayRef(MethodOptionNames); } ArrayRef> getMemberKindNames() { - return makeArrayRef(MemberKindNames); + return ArrayRef(MemberKindNames); } ArrayRef> getPtrKindNames() { - return makeArrayRef(PtrKindNames); + return ArrayRef(PtrKindNames); } ArrayRef> getPtrModeNames() { - return makeArrayRef(PtrModeNames); + return ArrayRef(PtrModeNames); } ArrayRef> getPtrMemberRepNames() { - return makeArrayRef(PtrMemberRepNames); + return ArrayRef(PtrMemberRepNames); } ArrayRef> getTypeModifierNames() { - return makeArrayRef(TypeModifierNames); + return ArrayRef(TypeModifierNames); } ArrayRef> getCallingConventions() { - return makeArrayRef(CallingConventions); + return ArrayRef(CallingConventions); } ArrayRef> getFunctionOptionEnum() { - return makeArrayRef(FunctionOptionEnum); + return ArrayRef(FunctionOptionEnum); } ArrayRef> getLabelTypeEnum() { - return makeArrayRef(LabelTypeEnum); + return ArrayRef(LabelTypeEnum); } } // end namespace codeview Index: llvm/lib/DebugInfo/CodeView/Formatters.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/Formatters.cpp +++ llvm/lib/DebugInfo/CodeView/Formatters.cpp @@ -20,7 +20,7 @@ using namespace llvm::codeview::detail; GuidAdapter::GuidAdapter(StringRef Guid) - : FormatAdapter(makeArrayRef(Guid.bytes_begin(), Guid.bytes_end())) {} + : FormatAdapter(ArrayRef(Guid.bytes_begin(), Guid.bytes_end())) {} GuidAdapter::GuidAdapter(ArrayRef Guid) : FormatAdapter(std::move(Guid)) {} Index: llvm/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp +++ llvm/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp @@ -81,7 +81,7 @@ ArrayRef Data) { uint8_t *Stable = Alloc.Allocate(Data.size()); memcpy(Stable, Data.data(), Data.size()); - return makeArrayRef(Stable, Data.size()); + return ArrayRef(Stable, Data.size()); } TypeIndex GlobalTypeTableBuilder::insertRecordBytes(ArrayRef Record) { Index: llvm/lib/DebugInfo/CodeView/LazyRandomTypeCollection.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/LazyRandomTypeCollection.cpp +++ llvm/lib/DebugInfo/CodeView/LazyRandomTypeCollection.cpp @@ -49,9 +49,8 @@ LazyRandomTypeCollection::LazyRandomTypeCollection(StringRef Data, uint32_t RecordCountHint) - : LazyRandomTypeCollection( - makeArrayRef(Data.bytes_begin(), Data.bytes_end()), RecordCountHint) { -} + : LazyRandomTypeCollection(ArrayRef(Data.bytes_begin(), Data.bytes_end()), + RecordCountHint) {} LazyRandomTypeCollection::LazyRandomTypeCollection(const CVTypeArray &Types, uint32_t NumRecords) Index: llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp +++ llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp @@ -78,7 +78,7 @@ ArrayRef Data) { uint8_t *Stable = Alloc.Allocate(Data.size()); memcpy(Stable, Data.data(), Data.size()); - return makeArrayRef(Stable, Data.size()); + return ArrayRef(Stable, Data.size()); } TypeIndex MergingTypeTableBuilder::insertRecordAs(hash_code Hash, Index: llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp +++ llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp @@ -177,7 +177,7 @@ W->getOStream() << " {\n"; W->indent(); W->printEnum("TypeLeafKind", unsigned(Record.kind()), - makeArrayRef(LeafTypeNames)); + ArrayRef(LeafTypeNames)); return Error::success(); } @@ -194,8 +194,7 @@ W->startLine() << getLeafTypeName(Record.Kind); W->getOStream() << " {\n"; W->indent(); - W->printEnum("TypeLeafKind", unsigned(Record.Kind), - makeArrayRef(LeafTypeNames)); + W->printEnum("TypeLeafKind", unsigned(Record.Kind), ArrayRef(LeafTypeNames)); return Error::success(); } @@ -247,7 +246,7 @@ Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, ClassRecord &Class) { uint16_t Props = static_cast(Class.getOptions()); W->printNumber("MemberCount", Class.getMemberCount()); - W->printFlags("Properties", Props, makeArrayRef(ClassOptionNames)); + W->printFlags("Properties", Props, ArrayRef(ClassOptionNames)); printTypeIndex("FieldList", Class.getFieldList()); printTypeIndex("DerivedFrom", Class.getDerivationList()); printTypeIndex("VShape", Class.getVTableShape()); @@ -261,7 +260,7 @@ Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, UnionRecord &Union) { uint16_t Props = static_cast(Union.getOptions()); W->printNumber("MemberCount", Union.getMemberCount()); - W->printFlags("Properties", Props, makeArrayRef(ClassOptionNames)); + W->printFlags("Properties", Props, ArrayRef(ClassOptionNames)); printTypeIndex("FieldList", Union.getFieldList()); W->printNumber("SizeOf", Union.getSize()); W->printString("Name", Union.getName()); @@ -274,7 +273,7 @@ uint16_t Props = static_cast(Enum.getOptions()); W->printNumber("NumEnumerators", Enum.getMemberCount()); W->printFlags("Properties", uint16_t(Enum.getOptions()), - makeArrayRef(ClassOptionNames)); + ArrayRef(ClassOptionNames)); printTypeIndex("UnderlyingType", Enum.getUnderlyingType()); printTypeIndex("FieldListType", Enum.getFieldList()); W->printString("Name", Enum.getName()); @@ -311,9 +310,9 @@ Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, ProcedureRecord &Proc) { printTypeIndex("ReturnType", Proc.getReturnType()); W->printEnum("CallingConvention", uint8_t(Proc.getCallConv()), - makeArrayRef(CallingConventions)); + ArrayRef(CallingConventions)); W->printFlags("FunctionOptions", uint8_t(Proc.getOptions()), - makeArrayRef(FunctionOptionEnum)); + ArrayRef(FunctionOptionEnum)); W->printNumber("NumParameters", Proc.getParameterCount()); printTypeIndex("ArgListType", Proc.getArgumentList()); return Error::success(); @@ -324,9 +323,9 @@ printTypeIndex("ClassType", MF.getClassType()); printTypeIndex("ThisType", MF.getThisType()); W->printEnum("CallingConvention", uint8_t(MF.getCallConv()), - makeArrayRef(CallingConventions)); + ArrayRef(CallingConventions)); W->printFlags("FunctionOptions", uint8_t(MF.getOptions()), - makeArrayRef(FunctionOptionEnum)); + ArrayRef(FunctionOptionEnum)); W->printNumber("NumParameters", MF.getParameterCount()); printTypeIndex("ArgListType", MF.getArgumentList()); W->printNumber("ThisAdjustment", MF.getThisPointerAdjustment()); @@ -362,8 +361,8 @@ Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, PointerRecord &Ptr) { printTypeIndex("PointeeType", Ptr.getReferentType()); W->printEnum("PtrType", unsigned(Ptr.getPointerKind()), - makeArrayRef(PtrKindNames)); - W->printEnum("PtrMode", unsigned(Ptr.getMode()), makeArrayRef(PtrModeNames)); + ArrayRef(PtrKindNames)); + W->printEnum("PtrMode", unsigned(Ptr.getMode()), ArrayRef(PtrModeNames)); W->printNumber("IsFlat", Ptr.isFlat()); W->printNumber("IsConst", Ptr.isConst()); @@ -379,7 +378,7 @@ printTypeIndex("ClassType", MI.getContainingType()); W->printEnum("Representation", uint16_t(MI.getRepresentation()), - makeArrayRef(PtrMemberRepNames)); + ArrayRef(PtrMemberRepNames)); } return Error::success(); @@ -388,7 +387,7 @@ Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, ModifierRecord &Mod) { uint16_t Mods = static_cast(Mod.getModifiers()); printTypeIndex("ModifiedType", Mod.getModifiedType()); - W->printFlags("Modifiers", Mods, makeArrayRef(TypeModifierNames)); + W->printFlags("Modifiers", Mods, ArrayRef(TypeModifierNames)); return Error::success(); } @@ -441,14 +440,13 @@ void TypeDumpVisitor::printMemberAttributes(MemberAccess Access, MethodKind Kind, MethodOptions Options) { - W->printEnum("AccessSpecifier", uint8_t(Access), - makeArrayRef(MemberAccessNames)); + W->printEnum("AccessSpecifier", uint8_t(Access), ArrayRef(MemberAccessNames)); // Data members will be vanilla. Don't try to print a method kind for them. if (Kind != MethodKind::Vanilla) - W->printEnum("MethodKind", unsigned(Kind), makeArrayRef(MemberKindNames)); + W->printEnum("MethodKind", unsigned(Kind), ArrayRef(MemberKindNames)); if (Options != MethodOptions::None) { W->printFlags("MethodOptions", unsigned(Options), - makeArrayRef(MethodOptionNames)); + ArrayRef(MethodOptionNames)); } } @@ -458,7 +456,7 @@ } Error TypeDumpVisitor::visitUnknownType(CVType &Record) { - W->printEnum("Kind", uint16_t(Record.kind()), makeArrayRef(LeafTypeNames)); + W->printEnum("Kind", uint16_t(Record.kind()), ArrayRef(LeafTypeNames)); W->printNumber("Length", uint32_t(Record.content().size())); return Error::success(); } @@ -551,7 +549,7 @@ } Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, LabelRecord &LR) { - W->printEnum("Mode", uint16_t(LR.Mode), makeArrayRef(LabelTypeEnum)); + W->printEnum("Mode", uint16_t(LR.Mode), ArrayRef(LabelTypeEnum)); return Error::success(); } Index: llvm/lib/DebugInfo/CodeView/TypeHashing.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/TypeHashing.cpp +++ llvm/lib/DebugInfo/CodeView/TypeHashing.cpp @@ -56,7 +56,7 @@ ArrayRef BytesToHash; if (TI.isSimple() || TI.isNoneType()) { const uint8_t *IndexBytes = reinterpret_cast(&TI); - BytesToHash = makeArrayRef(IndexBytes, sizeof(TypeIndex)); + BytesToHash = ArrayRef(IndexBytes, sizeof(TypeIndex)); } else { if (TI.toArrayIndex() >= Prev.size() || Prev[TI.toArrayIndex()].empty()) { Index: llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp +++ llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp @@ -122,16 +122,16 @@ if (!IO.isStreaming()) return ""; std::string AccessSpecifier = std::string( - getEnumName(IO, uint8_t(Access), makeArrayRef(getMemberAccessNames()))); + getEnumName(IO, uint8_t(Access), ArrayRef(getMemberAccessNames()))); std::string MemberAttrs(AccessSpecifier); if (Kind != MethodKind::Vanilla) { std::string MethodKind = std::string( - getEnumName(IO, unsigned(Kind), makeArrayRef(getMemberKindNames()))); + getEnumName(IO, unsigned(Kind), ArrayRef(getMemberKindNames()))); MemberAttrs += ", " + MethodKind; } if (Options != MethodOptions::None) { - std::string MethodOptions = getFlagNames( - IO, unsigned(Options), makeArrayRef(getMethodOptionNames())); + std::string MethodOptions = + getFlagNames(IO, unsigned(Options), ArrayRef(getMethodOptionNames())); MemberAttrs += ", " + MethodOptions; } return MemberAttrs; @@ -247,7 +247,7 @@ auto RecordKind = CVR.kind(); uint16_t RecordLen = CVR.length() - 2; std::string RecordKindName = std::string( - getEnumName(IO, unsigned(RecordKind), makeArrayRef(LeafTypeNames))); + getEnumName(IO, unsigned(RecordKind), ArrayRef(LeafTypeNames))); error(IO.mapInteger(RecordLen, "Record length")); error(IO.mapEnum(RecordKind, "Record kind: " + RecordKindName)); } @@ -289,7 +289,7 @@ std::string MemberKindName = std::string(getLeafTypeName(Record.Kind)); MemberKindName += " ( " + - (getEnumName(IO, unsigned(Record.Kind), makeArrayRef(LeafTypeNames))) + (getEnumName(IO, unsigned(Record.Kind), ArrayRef(LeafTypeNames))) .str() + " )"; error(IO.mapEnum(Record.Kind, "Member kind: " + MemberKindName)); @@ -314,7 +314,7 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ModifierRecord &Record) { std::string ModifierNames = getFlagNames(IO, static_cast(Record.Modifiers), - makeArrayRef(getTypeModifierNames())); + ArrayRef(getTypeModifierNames())); error(IO.mapInteger(Record.ModifiedType, "ModifiedType")); error(IO.mapEnum(Record.Modifiers, "Modifiers" + ModifierNames)); return Error::success(); @@ -323,10 +323,10 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ProcedureRecord &Record) { std::string CallingConvName = std::string(getEnumName( - IO, uint8_t(Record.CallConv), makeArrayRef(getCallingConventions()))); + IO, uint8_t(Record.CallConv), ArrayRef(getCallingConventions()))); std::string FuncOptionNames = getFlagNames(IO, static_cast(Record.Options), - makeArrayRef(getFunctionOptionEnum())); + ArrayRef(getFunctionOptionEnum())); error(IO.mapInteger(Record.ReturnType, "ReturnType")); error(IO.mapEnum(Record.CallConv, "CallingConvention: " + CallingConvName)); error(IO.mapEnum(Record.Options, "FunctionOptions" + FuncOptionNames)); @@ -339,10 +339,10 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, MemberFunctionRecord &Record) { std::string CallingConvName = std::string(getEnumName( - IO, uint8_t(Record.CallConv), makeArrayRef(getCallingConventions()))); + IO, uint8_t(Record.CallConv), ArrayRef(getCallingConventions()))); std::string FuncOptionNames = getFlagNames(IO, static_cast(Record.Options), - makeArrayRef(getFunctionOptionEnum())); + ArrayRef(getFunctionOptionEnum())); error(IO.mapInteger(Record.ReturnType, "ReturnType")); error(IO.mapInteger(Record.ClassType, "ClassType")); error(IO.mapInteger(Record.ThisType, "ThisType")); @@ -382,13 +382,12 @@ SmallString<128> Attr("Attrs: "); if (IO.isStreaming()) { - std::string PtrType = - std::string(getEnumName(IO, unsigned(Record.getPointerKind()), - makeArrayRef(getPtrKindNames()))); + std::string PtrType = std::string(getEnumName( + IO, unsigned(Record.getPointerKind()), ArrayRef(getPtrKindNames()))); Attr += "[ Type: " + PtrType; std::string PtrMode = std::string(getEnumName( - IO, unsigned(Record.getMode()), makeArrayRef(getPtrModeNames()))); + IO, unsigned(Record.getMode()), ArrayRef(getPtrModeNames()))); Attr += ", Mode: " + PtrMode; auto PtrSizeOf = Record.getSize(); @@ -421,7 +420,7 @@ MemberPointerInfo &M = *Record.MemberInfo; error(IO.mapInteger(M.ContainingType, "ClassType")); std::string PtrMemberGetRepresentation = std::string(getEnumName( - IO, uint16_t(M.Representation), makeArrayRef(getPtrMemberRepNames()))); + IO, uint16_t(M.Representation), ArrayRef(getPtrMemberRepNames()))); error(IO.mapEnum(M.Representation, "Representation: " + PtrMemberGetRepresentation)); } @@ -445,7 +444,7 @@ std::string PropertiesNames = getFlagNames(IO, static_cast(Record.Options), - makeArrayRef(getClassOptionNames())); + ArrayRef(getClassOptionNames())); error(IO.mapInteger(Record.MemberCount, "MemberCount")); error(IO.mapEnum(Record.Options, "Properties" + PropertiesNames)); error(IO.mapInteger(Record.FieldList, "FieldList")); @@ -461,7 +460,7 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, UnionRecord &Record) { std::string PropertiesNames = getFlagNames(IO, static_cast(Record.Options), - makeArrayRef(getClassOptionNames())); + ArrayRef(getClassOptionNames())); error(IO.mapInteger(Record.MemberCount, "MemberCount")); error(IO.mapEnum(Record.Options, "Properties" + PropertiesNames)); error(IO.mapInteger(Record.FieldList, "FieldList")); @@ -475,7 +474,7 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, EnumRecord &Record) { std::string PropertiesNames = getFlagNames(IO, static_cast(Record.Options), - makeArrayRef(getClassOptionNames())); + ArrayRef(getClassOptionNames())); error(IO.mapInteger(Record.MemberCount, "NumEnumerators")); error(IO.mapEnum(Record.Options, "Properties" + PropertiesNames)); error(IO.mapInteger(Record.UnderlyingType, "UnderlyingType")); @@ -628,7 +627,7 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, LabelRecord &Record) { std::string ModeName = std::string( - getEnumName(IO, uint16_t(Record.Mode), makeArrayRef(getLabelTypeEnum()))); + getEnumName(IO, uint16_t(Record.Mode), ArrayRef(getLabelTypeEnum()))); error(IO.mapEnum(Record.Mode, "Mode: " + ModeName)); return Error::success(); } Index: llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp =================================================================== --- llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp +++ llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp @@ -213,7 +213,7 @@ bool DWARFFormValue::isFormClass(DWARFFormValue::FormClass FC) const { // First, check DWARF5 form classes. - if (Form < makeArrayRef(DWARF5FormClasses).size() && + if (Form < ArrayRef(DWARF5FormClasses).size() && DWARF5FormClasses[Form] == FC) return true; // Check more forms from extensions and proposals. @@ -757,7 +757,7 @@ if (!isFormClass(FC_Block) && !isFormClass(FC_Exprloc) && Form != DW_FORM_data16) return std::nullopt; - return makeArrayRef(Value.data, Value.uval); + return ArrayRef(Value.data, Value.uval); } std::optional DWARFFormValue::getAsCStringOffset() const { Index: llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp =================================================================== --- llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp +++ llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp @@ -412,10 +412,10 @@ uint64_t Sig = E.getSignature(); if (!E.getContributions()) continue; - for (auto E : enumerate(InfoColumnKind == DW_SECT_INFO - ? makeArrayRef(E.getContributions(), - Index.getColumnKinds().size()) - : makeArrayRef(E.getContribution(), 1))) { + for (auto E : enumerate( + InfoColumnKind == DW_SECT_INFO + ? ArrayRef(E.getContributions(), Index.getColumnKinds().size()) + : ArrayRef(E.getContribution(), 1))) { const DWARFUnitIndex::Entry::SectionContribution &SC = E.value(); int Col = E.index(); if (SC.Length == 0) Index: llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp =================================================================== --- llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp +++ llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp @@ -301,7 +301,7 @@ sizeof(object::FpoData) * OldFpoData.size(); DbgStreams[(int)DbgHeaderType::FPO]->WriteFn = [this](BinaryStreamWriter &Writer) { - return Writer.writeArray(makeArrayRef(OldFpoData)); + return Writer.writeArray(ArrayRef(OldFpoData)); }; } @@ -406,7 +406,7 @@ if (!SectionContribs.empty()) { if (auto EC = Writer.writeEnum(DbiSecContribVer60)) return EC; - if (auto EC = Writer.writeArray(makeArrayRef(SectionContribs))) + if (auto EC = Writer.writeArray(ArrayRef(SectionContribs))) return EC; } @@ -415,7 +415,7 @@ SecMapHeader SMHeader = {Size, Size}; if (auto EC = Writer.writeObject(SMHeader)) return EC; - if (auto EC = Writer.writeArray(makeArrayRef(SectionMap))) + if (auto EC = Writer.writeArray(ArrayRef(SectionMap))) return EC; } Index: llvm/lib/DebugInfo/PDB/Native/EnumTables.cpp =================================================================== --- llvm/lib/DebugInfo/PDB/Native/EnumTables.cpp +++ llvm/lib/DebugInfo/PDB/Native/EnumTables.cpp @@ -32,7 +32,7 @@ namespace llvm { namespace pdb { ArrayRef> getOMFSegMapDescFlagNames() { - return makeArrayRef(OMFSegMapDescFlagNames); + return ArrayRef(OMFSegMapDescFlagNames); } } } Index: llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp =================================================================== --- llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp +++ llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp @@ -117,7 +117,7 @@ memcpy(NameMem, Pub.Name, NameLen); // Zero the null terminator and remaining bytes. memset(&NameMem[NameLen], 0, Size - sizeof(PublicSym32Layout) - NameLen); - return CVSymbol(makeArrayRef(reinterpret_cast(Mem), Size)); + return CVSymbol(ArrayRef(reinterpret_cast(Mem), Size)); } uint32_t GSIHashStreamBuilder::calculateSerializedLength() const { @@ -138,11 +138,11 @@ if (auto EC = Writer.writeObject(Header)) return EC; - if (auto EC = Writer.writeArray(makeArrayRef(HashRecords))) + if (auto EC = Writer.writeArray(ArrayRef(HashRecords))) return EC; - if (auto EC = Writer.writeArray(makeArrayRef(HashBitmap))) + if (auto EC = Writer.writeArray(ArrayRef(HashBitmap))) return EC; - if (auto EC = Writer.writeArray(makeArrayRef(HashBuckets))) + if (auto EC = Writer.writeArray(ArrayRef(HashBuckets))) return EC; return Error::success(); } @@ -464,7 +464,7 @@ std::vector PubAddrMap = computeAddrMap(Publics); assert(PubAddrMap.size() == Publics.size()); - if (auto EC = Writer.writeArray(makeArrayRef(PubAddrMap))) + if (auto EC = Writer.writeArray(ArrayRef(PubAddrMap))) return EC; return Error::success(); Index: llvm/lib/DebugInfo/PDB/Native/LinePrinter.cpp =================================================================== --- llvm/lib/DebugInfo/PDB/Native/LinePrinter.cpp +++ llvm/lib/DebugInfo/PDB/Native/LinePrinter.cpp @@ -251,7 +251,7 @@ void LinePrinter::formatMsfStreamBlocks( PDBFile &File, const msf::MSFStreamLayout &StreamLayout) { - auto Blocks = makeArrayRef(StreamLayout.Blocks); + auto Blocks = ArrayRef(StreamLayout.Blocks); uint64_t L = StreamLayout.Length; while (L > 0) { Index: llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp =================================================================== --- llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp +++ llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp @@ -61,7 +61,7 @@ "cause misalignment in the output TPI stream!"); assert(Record.size() <= codeview::MaxRecordLength); uint16_t OneSize = (uint16_t)Record.size(); - updateTypeIndexOffsets(makeArrayRef(&OneSize, 1)); + updateTypeIndexOffsets(ArrayRef(&OneSize, 1)); TypeRecBuffers.push_back(Record); // FIXME: Require it. Index: llvm/lib/DebugInfo/PDB/UDTLayout.cpp =================================================================== --- llvm/lib/DebugInfo/PDB/UDTLayout.cpp +++ llvm/lib/DebugInfo/PDB/UDTLayout.cpp @@ -261,7 +261,7 @@ // physically lay it out if it's a topmost derived class. addChildToLayout(std::move(BL)); } - VirtualBases = makeArrayRef(AllBases).drop_front(NonVirtualBases.size()); + VirtualBases = ArrayRef(AllBases).drop_front(NonVirtualBases.size()); if (Parent != nullptr) LayoutSize = UsedBytes.find_last() + 1; Index: llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp =================================================================== --- llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp +++ llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp @@ -41,8 +41,8 @@ StringRef VCLibs[] = {"libvcruntime.lib", "libcmt.lib", "libcpmt.lib"}; StringRef UCRTLibs[] = {"libucrt.lib"}; std::vector ImportedLibraries; - if (auto Err = loadVCRuntime(JD, ImportedLibraries, makeArrayRef(VCLibs), - makeArrayRef(UCRTLibs))) + if (auto Err = loadVCRuntime(JD, ImportedLibraries, ArrayRef(VCLibs), + ArrayRef(UCRTLibs))) return std::move(Err); return ImportedLibraries; } @@ -53,8 +53,8 @@ StringRef VCLibs[] = {"vcruntime.lib", "msvcrt.lib", "msvcprt.lib"}; StringRef UCRTLibs[] = {"ucrt.lib"}; std::vector ImportedLibraries; - if (auto Err = loadVCRuntime(JD, ImportedLibraries, makeArrayRef(VCLibs), - makeArrayRef(UCRTLibs))) + if (auto Err = loadVCRuntime(JD, ImportedLibraries, ArrayRef(VCLibs), + ArrayRef(UCRTLibs))) return std::move(Err); return ImportedLibraries; } Index: llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp =================================================================== --- llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp +++ llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp @@ -407,7 +407,7 @@ auto SymStartInBlock = (const uint8_t *)B.getContent().data() + Sym.getOffset(); auto SymSize = Sym.getSize() ? Sym.getSize() : B.getSize() - Sym.getOffset(); - auto Content = makeArrayRef(SymStartInBlock, SymSize); + auto Content = ArrayRef(SymStartInBlock, SymSize); LLVM_DEBUG(dbgs() << "Adding self-relocations to " << Sym.getName() << "\n"); Index: llvm/lib/FuzzMutate/IRMutator.cpp =================================================================== --- llvm/lib/FuzzMutate/IRMutator.cpp +++ llvm/lib/FuzzMutate/IRMutator.cpp @@ -123,8 +123,8 @@ // Choose an insertion point for our new instruction. size_t IP = uniform(IB.Rand, 0, Insts.size() - 1); - auto InstsBefore = makeArrayRef(Insts).slice(0, IP); - auto InstsAfter = makeArrayRef(Insts).slice(IP); + auto InstsBefore = ArrayRef(Insts).slice(0, IP); + auto InstsAfter = ArrayRef(Insts).slice(IP); // Choose a source, which will be used to constrain the operation selection. SmallVector Srcs; @@ -137,7 +137,7 @@ if (!OpDesc) return; - for (const auto &Pred : makeArrayRef(OpDesc->SourcePreds).slice(1)) + for (const auto &Pred : ArrayRef(OpDesc->SourcePreds).slice(1)) Srcs.push_back(IB.findOrCreateSource(BB, InstsBefore, Srcs, Pred)); if (Value *Op = OpDesc->BuilderFunc(Srcs, Insts[IP])) { @@ -358,7 +358,7 @@ // Choose a point where we split the block. uint64_t IP = uniform(IB.Rand, 0, Insts.size() - 1); - auto InstsBeforeSplit = makeArrayRef(Insts).slice(0, IP); + auto InstsBeforeSplit = ArrayRef(Insts).slice(0, IP); // `Sink` inherits Blocks' terminator, `Source` will have a BranchInst // directly jumps to `Sink`. Here, we have to create a new terminator for @@ -511,7 +511,7 @@ uint64_t Idx = uniform(IB.Rand, 0, Insts.size() - 1); Instruction *Inst = Insts[Idx]; // `Idx + 1` so we don't sink to ourselves. - auto InstsAfter = makeArrayRef(Insts).slice(Idx + 1); + auto InstsAfter = ArrayRef(Insts).slice(Idx + 1); LLVMContext &C = BB.getParent()->getParent()->getContext(); // Don't sink terminators, void function calls, etc. if (Inst->getType() != Type::getVoidTy(C)) Index: llvm/lib/FuzzMutate/Operations.cpp =================================================================== --- llvm/lib/FuzzMutate/Operations.cpp +++ llvm/lib/FuzzMutate/Operations.cpp @@ -174,7 +174,7 @@ Type *Ty = Srcs[0]->getType()->isOpaquePointerTy() ? Srcs[1]->getType() : Srcs[0]->getType()->getNonOpaquePointerElementType(); - auto Indices = makeArrayRef(Srcs).drop_front(2); + auto Indices = ArrayRef(Srcs).drop_front(2); return GetElementPtrInst::Create(Ty, Srcs[0], Indices, "G", Inst); }; // TODO: Handle aggregates and vectors Index: llvm/lib/IR/AttributeImpl.h =================================================================== --- llvm/lib/IR/AttributeImpl.h +++ llvm/lib/IR/AttributeImpl.h @@ -275,7 +275,7 @@ iterator end() const { return begin() + NumAttrs; } void Profile(FoldingSetNodeID &ID) const { - Profile(ID, makeArrayRef(begin(), end())); + Profile(ID, ArrayRef(begin(), end())); } static void Profile(FoldingSetNodeID &ID, ArrayRef AttrList) { Index: llvm/lib/IR/Attributes.cpp =================================================================== --- llvm/lib/IR/Attributes.cpp +++ llvm/lib/IR/Attributes.cpp @@ -1064,7 +1064,7 @@ } void AttributeListImpl::Profile(FoldingSetNodeID &ID) const { - Profile(ID, makeArrayRef(begin(), end())); + Profile(ID, ArrayRef(begin(), end())); } void AttributeListImpl::Profile(FoldingSetNodeID &ID, Index: llvm/lib/IR/AutoUpgrade.cpp =================================================================== --- llvm/lib/IR/AutoUpgrade.cpp +++ llvm/lib/IR/AutoUpgrade.cpp @@ -1239,7 +1239,7 @@ Idxs[l + i] = Idx + l; } - Res = Builder.CreateShuffleVector(Res, Op, makeArrayRef(Idxs, NumElts)); + Res = Builder.CreateShuffleVector(Res, Op, ArrayRef(Idxs, NumElts)); } // Bitcast back to a 64-bit element type. @@ -1273,7 +1273,7 @@ Idxs[l + i] = Idx + l; } - Res = Builder.CreateShuffleVector(Op, Res, makeArrayRef(Idxs, NumElts)); + Res = Builder.CreateShuffleVector(Op, Res, ArrayRef(Idxs, NumElts)); } // Bitcast back to a 64-bit element type. @@ -1293,8 +1293,8 @@ int Indices[4]; for (unsigned i = 0; i != NumElts; ++i) Indices[i] = i; - Mask = Builder.CreateShuffleVector( - Mask, Mask, makeArrayRef(Indices, NumElts), "extract"); + Mask = Builder.CreateShuffleVector(Mask, Mask, ArrayRef(Indices, NumElts), + "extract"); } return Mask; @@ -1368,9 +1368,8 @@ } } - Value *Align = Builder.CreateShuffleVector(Op1, Op0, - makeArrayRef(Indices, NumElts), - "palignr"); + Value *Align = Builder.CreateShuffleVector( + Op1, Op0, ArrayRef(Indices, NumElts), "palignr"); return EmitX86Select(Builder, Mask, Align, Passthru); } @@ -2276,14 +2275,13 @@ // 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 have to be swapped to match intrinsic definition. - Rep = Builder.CreateShuffleVector(RHS, LHS, - makeArrayRef(Indices, NumElts)); + Rep = Builder.CreateShuffleVector(RHS, LHS, ArrayRef(Indices, NumElts)); Rep = Builder.CreateBitCast(Rep, CI->getType()); } else if (IsX86 && Name == "avx512.kand.w") { Value *LHS = getX86MaskVec(Builder, CI->getArgOperand(0), 16); Index: llvm/lib/IR/ConstantFold.cpp =================================================================== --- llvm/lib/IR/ConstantFold.cpp +++ llvm/lib/IR/ConstantFold.cpp @@ -2038,7 +2038,7 @@ if (Idxs.empty()) return C; Type *GEPTy = GetElementPtrInst::getGEPReturnType( - PointeeTy, C, makeArrayRef((Value *const *)Idxs.data(), Idxs.size())); + PointeeTy, C, ArrayRef((Value *const *)Idxs.data(), Idxs.size())); if (isa(C)) return PoisonValue::get(GEPTy); Index: llvm/lib/IR/Constants.cpp =================================================================== --- llvm/lib/IR/Constants.cpp +++ llvm/lib/IR/Constants.cpp @@ -2995,7 +2995,7 @@ StringRef Str, bool AddNull) { if (!AddNull) { const uint8_t *Data = Str.bytes_begin(); - return get(Context, makeArrayRef(Data, Str.size())); + return get(Context, ArrayRef(Data, Str.size())); } SmallVector ElementVals; Index: llvm/lib/IR/Core.cpp =================================================================== --- llvm/lib/IR/Core.cpp +++ llvm/lib/IR/Core.cpp @@ -1154,7 +1154,7 @@ unsigned Count) { LLVMContext &Context = *unwrap(C); SmallVector MDs; - for (auto *OV : makeArrayRef(Vals, Count)) { + for (auto *OV : ArrayRef(Vals, Count)) { Value *V = unwrap(OV); Metadata *MD; if (!V) @@ -1388,9 +1388,8 @@ unsigned NumWords, const uint64_t Words[]) { IntegerType *Ty = unwrap(IntTy); - return wrap(ConstantInt::get(Ty->getContext(), - APInt(Ty->getBitWidth(), - makeArrayRef(Words, NumWords)))); + return wrap(ConstantInt::get( + Ty->getContext(), APInt(Ty->getBitWidth(), ArrayRef(Words, NumWords)))); } LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char Str[], @@ -1488,7 +1487,7 @@ LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed) { Constant **Elements = unwrap(ConstantVals, Count); - return wrap(ConstantStruct::getAnon(*unwrap(C), makeArrayRef(Elements, Count), + return wrap(ConstantStruct::getAnon(*unwrap(C), ArrayRef(Elements, Count), Packed != 0)); } @@ -1504,12 +1503,12 @@ Constant **Elements = unwrap(ConstantVals, Count); StructType *Ty = unwrap(StructTy); - return wrap(ConstantStruct::get(Ty, makeArrayRef(Elements, Count))); + return wrap(ConstantStruct::get(Ty, ArrayRef(Elements, Count))); } LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size) { - return wrap(ConstantVector::get(makeArrayRef( - unwrap(ScalarConstantVals, Size), Size))); + return wrap(ConstantVector::get( + ArrayRef(unwrap(ScalarConstantVals, Size), Size))); } /*-- Opcode mapping */ @@ -3146,9 +3145,9 @@ LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name) { - return wrap(unwrap(B)->CreateInvoke( - unwrap(Ty), unwrap(Fn), unwrap(Then), unwrap(Catch), - makeArrayRef(unwrap(Args), NumArgs), Name)); + return wrap(unwrap(B)->CreateInvoke(unwrap(Ty), unwrap(Fn), + unwrap(Then), unwrap(Catch), + ArrayRef(unwrap(Args), NumArgs), Name)); } LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, @@ -3167,8 +3166,7 @@ LLVMValueRef *Args, unsigned NumArgs, const char *Name) { return wrap(unwrap(B)->CreateCatchPad(unwrap(ParentPad), - makeArrayRef(unwrap(Args), NumArgs), - Name)); + ArrayRef(unwrap(Args), NumArgs), Name)); } LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, @@ -3178,9 +3176,8 @@ Type *Ty = Type::getTokenTy(unwrap(B)->getContext()); ParentPad = wrap(Constant::getNullValue(Ty)); } - return wrap(unwrap(B)->CreateCleanupPad(unwrap(ParentPad), - makeArrayRef(unwrap(Args), NumArgs), - Name)); + return wrap(unwrap(B)->CreateCleanupPad( + unwrap(ParentPad), ArrayRef(unwrap(Args), NumArgs), Name)); } LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn) { @@ -3837,7 +3834,7 @@ const char *Name) { FunctionType *FTy = unwrap(Ty); return wrap(unwrap(B)->CreateCall(FTy, unwrap(Fn), - makeArrayRef(unwrap(Args), NumArgs), Name)); + ArrayRef(unwrap(Args), NumArgs), Name)); } LLVMValueRef LLVMBuildSelect(LLVMBuilderRef B, LLVMValueRef If, Index: llvm/lib/IR/DebugInfoMetadata.cpp =================================================================== --- llvm/lib/IR/DebugInfoMetadata.cpp +++ llvm/lib/IR/DebugInfoMetadata.cpp @@ -1558,8 +1558,8 @@ if (Expr->Elements.size() == PatternSize) return nullptr; return DIExpression::get(Expr->getContext(), - makeArrayRef(&*Expr->Elements.begin(), - Expr->Elements.size() - PatternSize)); + ArrayRef(&*Expr->Elements.begin(), + Expr->Elements.size() - PatternSize)); } return Expr; } Index: llvm/lib/IR/Function.cpp =================================================================== --- llvm/lib/IR/Function.cpp +++ llvm/lib/IR/Function.cpp @@ -853,7 +853,7 @@ // We've either found the target or just fall back to the generic set, which // is always first. const auto &TI = It != Targets.end() && It->Name == Target ? *It : Targets[0]; - return makeArrayRef(&IntrinsicNameTable[1] + TI.Offset, TI.Count); + return ArrayRef(&IntrinsicNameTable[1] + TI.Offset, TI.Count); } /// This does the actual lookup of an intrinsic ID which Index: llvm/lib/IR/Verifier.cpp =================================================================== --- llvm/lib/IR/Verifier.cpp +++ llvm/lib/IR/Verifier.cpp @@ -6230,7 +6230,7 @@ return; const Function *First = DeoptimizeDeclarations[0]; - for (const auto *F : makeArrayRef(DeoptimizeDeclarations).slice(1)) { + for (const auto *F : ArrayRef(DeoptimizeDeclarations).slice(1)) { Check(First->getCallingConv() == F->getCallingConv(), "All llvm.experimental.deoptimize declarations must have the same " "calling convention", Index: llvm/lib/LTO/LTO.cpp =================================================================== --- llvm/lib/LTO/LTO.cpp +++ llvm/lib/LTO/LTO.cpp @@ -1190,7 +1190,7 @@ }; ArrayRef LTO::getRuntimeLibcallSymbols() { - return makeArrayRef(libcallRoutineNames); + return ArrayRef(libcallRoutineNames); } /// This class defines the interface to the ThinLTO backend. Index: llvm/lib/Linker/IRMover.cpp =================================================================== --- llvm/lib/Linker/IRMover.cpp +++ llvm/lib/Linker/IRMover.cpp @@ -316,7 +316,7 @@ cast(Ty)->getAddressSpace()); case Type::FunctionTyID: return *Entry = FunctionType::get(ElementTypes[0], - makeArrayRef(ElementTypes).slice(1), + ArrayRef(ElementTypes).slice(1), cast(Ty)->isVarArg()); case Type::StructTyID: { auto *STy = cast(Ty); Index: llvm/lib/MC/ELFObjectWriter.cpp =================================================================== --- llvm/lib/MC/ELFObjectWriter.cpp +++ llvm/lib/MC/ELFObjectWriter.cpp @@ -880,8 +880,8 @@ raw_svector_ostream VecOS(UncompressedData); Asm.writeSectionData(VecOS, &Section, Layout); ArrayRef Uncompressed = - makeArrayRef(reinterpret_cast(UncompressedData.data()), - UncompressedData.size()); + ArrayRef(reinterpret_cast(UncompressedData.data()), + UncompressedData.size()); SmallVector Compressed; uint32_t ChType; Index: llvm/lib/MC/MCCodeView.cpp =================================================================== --- llvm/lib/MC/MCCodeView.cpp +++ llvm/lib/MC/MCCodeView.cpp @@ -321,7 +321,7 @@ return std::nullopt; if (L >= MCCVLines.size()) return std::nullopt; - return makeArrayRef(&MCCVLines[L], R - L); + return ArrayRef(&MCCVLines[L], R - L); } void CodeViewContext::emitLineTableForFunction(MCObjectStreamer &OS, Index: llvm/lib/MC/MCDwarf.cpp =================================================================== --- llvm/lib/MC/MCDwarf.cpp +++ llvm/lib/MC/MCDwarf.cpp @@ -308,10 +308,9 @@ }; assert(std::size(StandardOpcodeLengths) >= (Params.DWARF2LineOpcodeBase - 1U)); - return Emit( - MCOS, Params, - makeArrayRef(StandardOpcodeLengths, Params.DWARF2LineOpcodeBase - 1), - LineStr); + return Emit(MCOS, Params, + ArrayRef(StandardOpcodeLengths, Params.DWARF2LineOpcodeBase - 1), + LineStr); } static const MCExpr *forceExpAbs(MCStreamer &OS, const MCExpr* Expr) { Index: llvm/lib/MC/WinCOFFObjectWriter.cpp =================================================================== --- llvm/lib/MC/WinCOFFObjectWriter.cpp +++ llvm/lib/MC/WinCOFFObjectWriter.cpp @@ -597,7 +597,7 @@ // Calculate our CRC with an initial value of '0', this is not how // JamCRC is specified but it aligns with the expected output. JamCRC JC(/*Init=*/0); - JC.update(makeArrayRef(reinterpret_cast(Buf.data()), Buf.size())); + JC.update(ArrayRef(reinterpret_cast(Buf.data()), Buf.size())); return JC.getCRC(); } Index: llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp =================================================================== --- llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp +++ llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp @@ -239,9 +239,9 @@ Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_ALIGN_1BYTES; addSection(Obj, NewSection.SectionName, - makeArrayRef(reinterpret_cast( - NewSection.SectionData->getBufferStart()), - NewSection.SectionData->getBufferSize()), + ArrayRef(reinterpret_cast( + NewSection.SectionData->getBufferStart()), + NewSection.SectionData->getBufferSize()), Characteristics); } Index: llvm/lib/ObjCopy/wasm/WasmObjcopy.cpp =================================================================== --- llvm/lib/ObjCopy/wasm/WasmObjcopy.cpp +++ llvm/lib/ObjCopy/wasm/WasmObjcopy.cpp @@ -131,7 +131,7 @@ NewSection.SectionData->getBufferSize()); std::unique_ptr BufferCopy = MemoryBuffer::getMemBufferCopy( InputData, NewSection.SectionData->getBufferIdentifier()); - Sec.Contents = makeArrayRef( + Sec.Contents = ArrayRef( reinterpret_cast(BufferCopy->getBufferStart()), BufferCopy->getBufferSize()); Index: llvm/lib/Object/COFFObjectFile.cpp =================================================================== --- llvm/lib/Object/COFFObjectFile.cpp +++ llvm/lib/Object/COFFObjectFile.cpp @@ -1134,7 +1134,7 @@ "Aux Symbol data did not point to the beginning of a symbol"); #endif } - return makeArrayRef(Aux, Symbol.getNumberOfAuxSymbols() * SymbolSize); + return ArrayRef(Aux, Symbol.getNumberOfAuxSymbols() * SymbolSize); } uint32_t COFFObjectFile::getSymbolIndex(COFFSymbolRef Symbol) const { @@ -1199,7 +1199,7 @@ uint32_t SectionSize = getSectionSize(Sec); if (Error E = checkOffset(Data, ConStart, SectionSize)) return E; - Res = makeArrayRef(reinterpret_cast(ConStart), SectionSize); + Res = ArrayRef(reinterpret_cast(ConStart), SectionSize); return Error::success(); } Index: llvm/lib/Object/ELF.cpp =================================================================== --- llvm/lib/Object/ELF.cpp +++ llvm/lib/Object/ELF.cpp @@ -549,9 +549,8 @@ for (const Elf_Phdr &Phdr : *ProgramHeadersOrError) { if (Phdr.p_type == ELF::PT_DYNAMIC) { - Dyn = makeArrayRef( - reinterpret_cast(base() + Phdr.p_offset), - Phdr.p_filesz / sizeof(Elf_Dyn)); + Dyn = ArrayRef(reinterpret_cast(base() + Phdr.p_offset), + Phdr.p_filesz / sizeof(Elf_Dyn)); break; } } Index: llvm/lib/Object/MachOObjectFile.cpp =================================================================== --- llvm/lib/Object/MachOObjectFile.cpp +++ llvm/lib/Object/MachOObjectFile.cpp @@ -4517,7 +4517,7 @@ assert(Sec.d.a < Sections.size() && "Should have detected this earlier"); const section_base *Base = reinterpret_cast(Sections[Sec.d.a]); - return makeArrayRef(Base->sectname); + return ArrayRef(Base->sectname); } ArrayRef @@ -4525,7 +4525,7 @@ assert(Sec.d.a < Sections.size() && "Should have detected this earlier"); const section_base *Base = reinterpret_cast(Sections[Sec.d.a]); - return makeArrayRef(Base->segname); + return ArrayRef(Base->segname); } bool @@ -4901,7 +4901,7 @@ MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast(getPtr(*this, DyldInfo.rebase_off)); - return makeArrayRef(Ptr, DyldInfo.rebase_size); + return ArrayRef(Ptr, DyldInfo.rebase_size); } ArrayRef MachOObjectFile::getDyldInfoBindOpcodes() const { @@ -4915,7 +4915,7 @@ MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast(getPtr(*this, DyldInfo.bind_off)); - return makeArrayRef(Ptr, DyldInfo.bind_size); + return ArrayRef(Ptr, DyldInfo.bind_size); } ArrayRef MachOObjectFile::getDyldInfoWeakBindOpcodes() const { @@ -4929,7 +4929,7 @@ MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast(getPtr(*this, DyldInfo.weak_bind_off)); - return makeArrayRef(Ptr, DyldInfo.weak_bind_size); + return ArrayRef(Ptr, DyldInfo.weak_bind_size); } ArrayRef MachOObjectFile::getDyldInfoLazyBindOpcodes() const { @@ -4943,7 +4943,7 @@ MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast(getPtr(*this, DyldInfo.lazy_bind_off)); - return makeArrayRef(Ptr, DyldInfo.lazy_bind_size); + return ArrayRef(Ptr, DyldInfo.lazy_bind_size); } ArrayRef MachOObjectFile::getDyldInfoExportsTrie() const { @@ -4957,7 +4957,7 @@ MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast(getPtr(*this, DyldInfo.export_off)); - return makeArrayRef(Ptr, DyldInfo.export_size); + return ArrayRef(Ptr, DyldInfo.export_size); } Expected> @@ -5248,7 +5248,7 @@ MachO::linkedit_data_command DyldExportsTrie = DyldExportsTrieOrError.get(); const uint8_t *Ptr = reinterpret_cast(getPtr(*this, DyldExportsTrie.dataoff)); - return makeArrayRef(Ptr, DyldExportsTrie.datasize); + return ArrayRef(Ptr, DyldExportsTrie.datasize); } SmallVector MachOObjectFile::getFunctionStarts() const { @@ -5271,7 +5271,7 @@ return std::nullopt; // Returning a pointer is fine as uuid doesn't need endian swapping. const char *Ptr = UuidLoadCmd + offsetof(MachO::uuid_command, uuid); - return makeArrayRef(reinterpret_cast(Ptr), 16); + return ArrayRef(reinterpret_cast(Ptr), 16); } StringRef MachOObjectFile::getStringTableData() const { Index: llvm/lib/Object/WindowsResource.cpp =================================================================== --- llvm/lib/Object/WindowsResource.cpp +++ llvm/lib/Object/WindowsResource.cpp @@ -173,7 +173,7 @@ EndianCorrectedSrc.resize(Src.size() + 1); llvm::copy(Src, EndianCorrectedSrc.begin() + 1); EndianCorrectedSrc[0] = UNI_UTF16_BYTE_ORDER_MARK_SWAPPED; - return convertUTF16ToUTF8String(makeArrayRef(EndianCorrectedSrc), Out); + return convertUTF16ToUTF8String(ArrayRef(EndianCorrectedSrc), Out); } static std::string makeDuplicateResourceError( Index: llvm/lib/Object/XCOFFObjectFile.cpp =================================================================== --- llvm/lib/Object/XCOFFObjectFile.cpp +++ llvm/lib/Object/XCOFFObjectFile.cpp @@ -414,7 +414,7 @@ Twine::utohexstr(OffsetToRaw) + " and size 0x" + Twine::utohexstr(SectionSize) + " goes past the end of the file"); - return makeArrayRef(ContentStart,SectionSize); + return ArrayRef(ContentStart, SectionSize); } uint64_t XCOFFObjectFile::getSectionAlignment(DataRefImpl Sec) const { Index: llvm/lib/ObjectYAML/ELFEmitter.cpp =================================================================== --- llvm/lib/ObjectYAML/ELFEmitter.cpp +++ llvm/lib/ObjectYAML/ELFEmitter.cpp @@ -1967,7 +1967,7 @@ return false; State.writeELFHeader(OS); - writeArrayData(OS, makeArrayRef(PHeaders)); + writeArrayData(OS, ArrayRef(PHeaders)); const ELFYAML::SectionHeaderTable &SHT = Doc.getSectionHeaderTable(); if (!SHT.NoHeaders.value_or(false)) Index: llvm/lib/ObjectYAML/MinidumpEmitter.cpp =================================================================== --- llvm/lib/ObjectYAML/MinidumpEmitter.cpp +++ llvm/lib/ObjectYAML/MinidumpEmitter.cpp @@ -60,7 +60,7 @@ allocateNewArray(const iterator_range &Range); template size_t allocateObject(const T &Data) { - return allocateArray(makeArrayRef(Data)); + return allocateArray(ArrayRef(Data)); } template @@ -184,7 +184,7 @@ File.allocateNewObject( sizeof(minidump::MemoryInfoListHeader), sizeof(minidump::MemoryInfo), InfoList.Infos.size()); - File.allocateArray(makeArrayRef(InfoList.Infos)); + File.allocateArray(ArrayRef(InfoList.Infos)); break; } case Stream::StreamKind::MemoryList: @@ -233,8 +233,7 @@ File.allocateObject(Obj.Header); std::vector StreamDirectory(Obj.Streams.size()); - Obj.Header.StreamDirectoryRVA = - File.allocateArray(makeArrayRef(StreamDirectory)); + Obj.Header.StreamDirectoryRVA = File.allocateArray(ArrayRef(StreamDirectory)); Obj.Header.NumberOfStreams = StreamDirectory.size(); for (auto &Stream : enumerate(Obj.Streams)) Index: llvm/lib/ObjectYAML/MinidumpYAML.cpp =================================================================== --- llvm/lib/ObjectYAML/MinidumpYAML.cpp +++ llvm/lib/ObjectYAML/MinidumpYAML.cpp @@ -178,7 +178,7 @@ namespace yaml { template struct ScalarTraits> { static void output(const FixedSizeHex &Fixed, void *, raw_ostream &OS) { - OS << toHex(makeArrayRef(Fixed.Storage)); + OS << toHex(ArrayRef(Fixed.Storage)); } static StringRef input(StringRef Scalar, void *, FixedSizeHex &Fixed) { Index: llvm/lib/Option/OptTable.cpp =================================================================== --- llvm/lib/Option/OptTable.cpp +++ llvm/lib/Option/OptTable.cpp @@ -497,7 +497,7 @@ cl::expandResponseFiles(Argc, Argv, EnvVar, Saver, NewArgv); unsigned MAI, MAC; - opt::InputArgList Args = ParseArgs(makeArrayRef(NewArgv), MAI, MAC); + opt::InputArgList Args = ParseArgs(ArrayRef(NewArgv), MAI, MAC); if (MAC) ErrorFn((Twine(Args.getArgString(MAI)) + ": missing argument").str()); Index: llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp =================================================================== --- llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp +++ llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp @@ -1161,7 +1161,7 @@ Expressions.clear(); MappingRegions.clear(); auto &R = MappingRecords[CurrentRecord]; - auto F = makeArrayRef(Filenames).slice(R.FilenamesBegin, R.FilenamesSize); + auto F = ArrayRef(Filenames).slice(R.FilenamesBegin, R.FilenamesSize); RawCoverageMappingReader Reader(R.CoverageMapping, F, FunctionsFilenames, Expressions, MappingRegions); if (auto Err = Reader.read()) Index: llvm/lib/ProfileData/InstrProf.cpp =================================================================== --- llvm/lib/ProfileData/InstrProf.cpp +++ llvm/lib/ProfileData/InstrProf.cpp @@ -506,9 +506,9 @@ if (!llvm::compression::zlib::isAvailable()) return make_error(instrprof_error::zlib_unavailable); - if (Error E = compression::zlib::decompress( - makeArrayRef(P, CompressedSize), UncompressedNameStrings, - UncompressedSize)) { + if (Error E = compression::zlib::decompress(ArrayRef(P, CompressedSize), + UncompressedNameStrings, + UncompressedSize)) { consumeError(std::move(E)); return make_error(instrprof_error::uncompress_failed); } Index: llvm/lib/ProfileData/SampleProfReader.cpp =================================================================== --- llvm/lib/ProfileData/SampleProfReader.cpp +++ llvm/lib/ProfileData/SampleProfReader.cpp @@ -956,8 +956,8 @@ uint8_t *Buffer = Allocator.Allocate(DecompressBufSize); size_t UCSize = DecompressBufSize; - llvm::Error E = compression::zlib::decompress( - makeArrayRef(Data, *CompressSize), Buffer, UCSize); + llvm::Error E = compression::zlib::decompress(ArrayRef(Data, *CompressSize), + Buffer, UCSize); if (E) return sampleprof_error::uncompress_failed; DecompressBuf = reinterpret_cast(Buffer); Index: llvm/lib/Support/APFloat.cpp =================================================================== --- llvm/lib/Support/APFloat.cpp +++ llvm/lib/Support/APFloat.cpp @@ -2650,7 +2650,7 @@ unsigned int width, bool isSigned, roundingMode rounding_mode) { unsigned int partCount = partCountForBits(width); - APInt api = APInt(width, makeArrayRef(parts, partCount)); + APInt api = APInt(width, ArrayRef(parts, partCount)); sign = false; if (isSigned && APInt::tcExtractBit(parts, width - 1)) { @@ -4056,9 +4056,9 @@ // Decompose the number into an APInt and an exponent. int exp = exponent - ((int) semantics->precision - 1); - APInt significand(semantics->precision, - makeArrayRef(significandParts(), - partCountForBits(semantics->precision))); + APInt significand( + semantics->precision, + ArrayRef(significandParts(), partCountForBits(semantics->precision))); // Set FormatPrecision if zero. We want to do this before we // truncate trailing zeros, as those are part of the precision. Index: llvm/lib/Support/APInt.cpp =================================================================== --- llvm/lib/Support/APInt.cpp +++ llvm/lib/Support/APInt.cpp @@ -108,7 +108,7 @@ APInt::APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]) : BitWidth(numBits) { - initFromArray(makeArrayRef(bigVal, numWords)); + initFromArray(ArrayRef(bigVal, numWords)); } APInt::APInt(unsigned numbits, StringRef Str, uint8_t radix) @@ -459,7 +459,7 @@ // Extracting bits that start on a source word boundary can be done // as a fast memory copy. if (loBit == 0) - return APInt(numBits, makeArrayRef(U.pVal + loWord, 1 + hiWord - loWord)); + return APInt(numBits, ArrayRef(U.pVal + loWord, 1 + hiWord - loWord)); // General case - shift + copy source words directly into place. APInt Result(numBits, 0); Index: llvm/lib/Support/ARMAttributeParser.cpp =================================================================== --- llvm/lib/Support/ARMAttributeParser.cpp +++ llvm/lib/Support/ARMAttributeParser.cpp @@ -92,7 +92,7 @@ "ARM v9-A"}; Error ARMAttributeParser::CPU_arch(AttrType tag) { - return parseStringAttribute("CPU_arch", tag, makeArrayRef(CPU_arch_strings)); + return parseStringAttribute("CPU_arch", tag, ArrayRef(CPU_arch_strings)); } Error ARMAttributeParser::CPU_arch_profile(AttrType tag) { @@ -114,97 +114,95 @@ Error ARMAttributeParser::ARM_ISA_use(AttrType tag) { static const char *strings[] = {"Not Permitted", "Permitted"}; - return parseStringAttribute("ARM_ISA_use", tag, makeArrayRef(strings)); + return parseStringAttribute("ARM_ISA_use", tag, ArrayRef(strings)); } Error ARMAttributeParser::THUMB_ISA_use(AttrType tag) { static const char *strings[] = {"Not Permitted", "Thumb-1", "Thumb-2", "Permitted"}; - return parseStringAttribute("THUMB_ISA_use", tag, makeArrayRef(strings)); + return parseStringAttribute("THUMB_ISA_use", tag, ArrayRef(strings)); } Error ARMAttributeParser::FP_arch(AttrType tag) { static const char *strings[] = { "Not Permitted", "VFPv1", "VFPv2", "VFPv3", "VFPv3-D16", "VFPv4", "VFPv4-D16", "ARMv8-a FP", "ARMv8-a FP-D16"}; - return parseStringAttribute("FP_arch", tag, makeArrayRef(strings)); + return parseStringAttribute("FP_arch", tag, ArrayRef(strings)); } Error ARMAttributeParser::WMMX_arch(AttrType tag) { static const char *strings[] = {"Not Permitted", "WMMXv1", "WMMXv2"}; - return parseStringAttribute("WMMX_arch", tag, makeArrayRef(strings)); + return parseStringAttribute("WMMX_arch", tag, ArrayRef(strings)); } Error ARMAttributeParser::Advanced_SIMD_arch(AttrType tag) { static const char *strings[] = {"Not Permitted", "NEONv1", "NEONv2+FMA", "ARMv8-a NEON", "ARMv8.1-a NEON"}; - return parseStringAttribute("Advanced_SIMD_arch", tag, makeArrayRef(strings)); + return parseStringAttribute("Advanced_SIMD_arch", tag, ArrayRef(strings)); } Error ARMAttributeParser::MVE_arch(AttrType tag) { static const char *strings[] = {"Not Permitted", "MVE integer", "MVE integer and float"}; - return parseStringAttribute("MVE_arch", tag, makeArrayRef(strings)); + return parseStringAttribute("MVE_arch", tag, ArrayRef(strings)); } Error ARMAttributeParser::PCS_config(AttrType tag) { static const char *strings[] = { "None", "Bare Platform", "Linux Application", "Linux DSO", "Palm OS 2004", "Reserved (Palm OS)", "Symbian OS 2004", "Reserved (Symbian OS)"}; - return parseStringAttribute("PCS_config", tag, makeArrayRef(strings)); + return parseStringAttribute("PCS_config", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_PCS_R9_use(AttrType tag) { static const char *strings[] = {"v6", "Static Base", "TLS", "Unused"}; - return parseStringAttribute("ABI_PCS_R9_use", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_PCS_R9_use", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_PCS_RW_data(AttrType tag) { static const char *strings[] = {"Absolute", "PC-relative", "SB-relative", "Not Permitted"}; - return parseStringAttribute("ABI_PCS_RW_data", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_PCS_RW_data", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_PCS_RO_data(AttrType tag) { static const char *strings[] = {"Absolute", "PC-relative", "Not Permitted"}; - return parseStringAttribute("ABI_PCS_RO_data", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_PCS_RO_data", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_PCS_GOT_use(AttrType tag) { static const char *strings[] = {"Not Permitted", "Direct", "GOT-Indirect"}; - return parseStringAttribute("ABI_PCS_GOT_use", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_PCS_GOT_use", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_PCS_wchar_t(AttrType tag) { static const char *strings[] = {"Not Permitted", "Unknown", "2-byte", "Unknown", "4-byte"}; - return parseStringAttribute("ABI_PCS_wchar_t", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_PCS_wchar_t", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_FP_rounding(AttrType tag) { static const char *strings[] = {"IEEE-754", "Runtime"}; - return parseStringAttribute("ABI_FP_rounding", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_FP_rounding", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_FP_denormal(AttrType tag) { static const char *strings[] = {"Unsupported", "IEEE-754", "Sign Only"}; - return parseStringAttribute("ABI_FP_denormal", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_FP_denormal", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_FP_exceptions(AttrType tag) { static const char *strings[] = {"Not Permitted", "IEEE-754"}; - return parseStringAttribute("ABI_FP_exceptions", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_FP_exceptions", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_FP_user_exceptions(AttrType tag) { static const char *strings[] = {"Not Permitted", "IEEE-754"}; - return parseStringAttribute("ABI_FP_user_exceptions", tag, - makeArrayRef(strings)); + return parseStringAttribute("ABI_FP_user_exceptions", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_FP_number_model(AttrType tag) { static const char *strings[] = {"Not Permitted", "Finite Only", "RTABI", "IEEE-754"}; - return parseStringAttribute("ABI_FP_number_model", tag, - makeArrayRef(strings)); + return parseStringAttribute("ABI_FP_number_model", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_align_needed(AttrType tag) { @@ -248,24 +246,24 @@ Error ARMAttributeParser::ABI_enum_size(AttrType tag) { static const char *strings[] = {"Not Permitted", "Packed", "Int32", "External Int32"}; - return parseStringAttribute("ABI_enum_size", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_enum_size", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_HardFP_use(AttrType tag) { static const char *strings[] = {"Tag_FP_arch", "Single-Precision", "Reserved", "Tag_FP_arch (deprecated)"}; - return parseStringAttribute("ABI_HardFP_use", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_HardFP_use", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_VFP_args(AttrType tag) { static const char *strings[] = {"AAPCS", "AAPCS VFP", "Custom", "Not Permitted"}; - return parseStringAttribute("ABI_VFP_args", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_VFP_args", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_WMMX_args(AttrType tag) { static const char *strings[] = {"AAPCS", "iWMMX", "Custom"}; - return parseStringAttribute("ABI_WMMX_args", tag, makeArrayRef(strings)); + return parseStringAttribute("ABI_WMMX_args", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_optimization_goals(AttrType tag) { @@ -273,8 +271,7 @@ "None", "Speed", "Aggressive Speed", "Size", "Aggressive Size", "Debugging", "Best Debugging" }; - return parseStringAttribute("ABI_optimization_goals", tag, - makeArrayRef(strings)); + return parseStringAttribute("ABI_optimization_goals", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_FP_optimization_goals(AttrType tag) { @@ -282,7 +279,7 @@ "None", "Speed", "Aggressive Speed", "Size", "Aggressive Size", "Accuracy", "Best Accuracy"}; return parseStringAttribute("ABI_FP_optimization_goals", tag, - makeArrayRef(strings)); + ArrayRef(strings)); } Error ARMAttributeParser::compatibility(AttrType tag) { @@ -313,68 +310,66 @@ Error ARMAttributeParser::CPU_unaligned_access(AttrType tag) { static const char *strings[] = {"Not Permitted", "v6-style"}; - return parseStringAttribute("CPU_unaligned_access", tag, - makeArrayRef(strings)); + return parseStringAttribute("CPU_unaligned_access", tag, ArrayRef(strings)); } Error ARMAttributeParser::FP_HP_extension(AttrType tag) { static const char *strings[] = {"If Available", "Permitted"}; - return parseStringAttribute("FP_HP_extension", tag, makeArrayRef(strings)); + return parseStringAttribute("FP_HP_extension", tag, ArrayRef(strings)); } Error ARMAttributeParser::ABI_FP_16bit_format(AttrType tag) { static const char *strings[] = {"Not Permitted", "IEEE-754", "VFPv3"}; - return parseStringAttribute("ABI_FP_16bit_format", tag, - makeArrayRef(strings)); + return parseStringAttribute("ABI_FP_16bit_format", tag, ArrayRef(strings)); } Error ARMAttributeParser::MPextension_use(AttrType tag) { static const char *strings[] = {"Not Permitted", "Permitted"}; - return parseStringAttribute("MPextension_use", tag, makeArrayRef(strings)); + return parseStringAttribute("MPextension_use", tag, ArrayRef(strings)); } Error ARMAttributeParser::DIV_use(AttrType tag) { static const char *strings[] = {"If Available", "Not Permitted", "Permitted"}; - return parseStringAttribute("DIV_use", tag, makeArrayRef(strings)); + return parseStringAttribute("DIV_use", tag, ArrayRef(strings)); } Error ARMAttributeParser::DSP_extension(AttrType tag) { static const char *strings[] = {"Not Permitted", "Permitted"}; - return parseStringAttribute("DSP_extension", tag, makeArrayRef(strings)); + return parseStringAttribute("DSP_extension", tag, ArrayRef(strings)); } Error ARMAttributeParser::T2EE_use(AttrType tag) { static const char *strings[] = {"Not Permitted", "Permitted"}; - return parseStringAttribute("T2EE_use", tag, makeArrayRef(strings)); + return parseStringAttribute("T2EE_use", tag, ArrayRef(strings)); } Error ARMAttributeParser::Virtualization_use(AttrType tag) { static const char *strings[] = {"Not Permitted", "TrustZone", "Virtualization Extensions", "TrustZone + Virtualization Extensions"}; - return parseStringAttribute("Virtualization_use", tag, makeArrayRef(strings)); + return parseStringAttribute("Virtualization_use", tag, ArrayRef(strings)); } Error ARMAttributeParser::PAC_extension(ARMBuildAttrs::AttrType tag) { static const char *strings[] = {"Not Permitted", "Permitted in NOP space", "Permitted"}; - return parseStringAttribute("PAC_extension", tag, makeArrayRef(strings)); + return parseStringAttribute("PAC_extension", tag, ArrayRef(strings)); } Error ARMAttributeParser::BTI_extension(ARMBuildAttrs::AttrType tag) { static const char *strings[] = {"Not Permitted", "Permitted in NOP space", "Permitted"}; - return parseStringAttribute("BTI_extension", tag, makeArrayRef(strings)); + return parseStringAttribute("BTI_extension", tag, ArrayRef(strings)); } Error ARMAttributeParser::PACRET_use(ARMBuildAttrs::AttrType tag) { static const char *strings[] = {"Not Used", "Used"}; - return parseStringAttribute("PACRET_use", tag, makeArrayRef(strings)); + return parseStringAttribute("PACRET_use", tag, ArrayRef(strings)); } Error ARMAttributeParser::BTI_use(ARMBuildAttrs::AttrType tag) { static const char *strings[] = {"Not Used", "Used"}; - return parseStringAttribute("BTI_use", tag, makeArrayRef(strings)); + return parseStringAttribute("BTI_use", tag, ArrayRef(strings)); } Error ARMAttributeParser::nodefaults(AttrType tag) { @@ -410,7 +405,7 @@ switch (InnerTag) { case ARMBuildAttrs::CPU_arch: { uint64_t InnerValue = de.getULEB128(cursor); - auto strings = makeArrayRef(CPU_arch_strings); + auto strings = ArrayRef(CPU_arch_strings); if (InnerValue >= strings.size()) { returnValue = createStringError( errc::argument_out_of_domain, Index: llvm/lib/Support/BinaryStreamRef.cpp =================================================================== --- llvm/lib/Support/BinaryStreamRef.cpp +++ llvm/lib/Support/BinaryStreamRef.cpp @@ -73,8 +73,7 @@ : BinaryStreamRefBase(std::make_shared(Data, Endian), 0, Data.size()) {} BinaryStreamRef::BinaryStreamRef(StringRef Data, endianness Endian) - : BinaryStreamRef(makeArrayRef(Data.bytes_begin(), Data.bytes_end()), - Endian) {} + : BinaryStreamRef(ArrayRef(Data.bytes_begin(), Data.bytes_end()), Endian) {} Error BinaryStreamRef::readBytes(uint64_t Offset, uint64_t Size, ArrayRef &Buffer) const { Index: llvm/lib/Support/CSKYAttributeParser.cpp =================================================================== --- llvm/lib/Support/CSKYAttributeParser.cpp +++ llvm/lib/Support/CSKYAttributeParser.cpp @@ -83,44 +83,38 @@ Error CSKYAttributeParser::dspVersion(unsigned tag) { static const char *strings[] = {"Error", "DSP Extension", "DSP 2.0"}; - return parseStringAttribute("Tag_CSKY_DSP_VERSION", tag, - makeArrayRef(strings)); + return parseStringAttribute("Tag_CSKY_DSP_VERSION", tag, ArrayRef(strings)); } Error CSKYAttributeParser::vdspVersion(unsigned tag) { static const char *strings[] = {"Error", "VDSP Version 1", "VDSP Version 2"}; - return parseStringAttribute("Tag_CSKY_VDSP_VERSION", tag, - makeArrayRef(strings)); + return parseStringAttribute("Tag_CSKY_VDSP_VERSION", tag, ArrayRef(strings)); } Error CSKYAttributeParser::fpuVersion(unsigned tag) { static const char *strings[] = {"Error", "FPU Version 1", "FPU Version 2", "FPU Version 3"}; - return parseStringAttribute("Tag_CSKY_FPU_VERSION", tag, - makeArrayRef(strings)); + return parseStringAttribute("Tag_CSKY_FPU_VERSION", tag, ArrayRef(strings)); } Error CSKYAttributeParser::fpuABI(unsigned tag) { static const char *strings[] = {"Error", "Soft", "SoftFP", "Hard"}; - return parseStringAttribute("Tag_CSKY_FPU_ABI", tag, makeArrayRef(strings)); + return parseStringAttribute("Tag_CSKY_FPU_ABI", tag, ArrayRef(strings)); } Error CSKYAttributeParser::fpuRounding(unsigned tag) { static const char *strings[] = {"None", "Needed"}; - return parseStringAttribute("Tag_CSKY_FPU_ROUNDING", tag, - makeArrayRef(strings)); + return parseStringAttribute("Tag_CSKY_FPU_ROUNDING", tag, ArrayRef(strings)); } Error CSKYAttributeParser::fpuDenormal(unsigned tag) { static const char *strings[] = {"None", "Needed"}; - return parseStringAttribute("Tag_CSKY_FPU_DENORMAL", tag, - makeArrayRef(strings)); + return parseStringAttribute("Tag_CSKY_FPU_DENORMAL", tag, ArrayRef(strings)); } Error CSKYAttributeParser::fpuException(unsigned tag) { static const char *strings[] = {"None", "Needed"}; - return parseStringAttribute("Tag_CSKY_FPU_EXCEPTION", tag, - makeArrayRef(strings)); + return parseStringAttribute("Tag_CSKY_FPU_EXCEPTION", tag, ArrayRef(strings)); } Error CSKYAttributeParser::fpuHardFP(unsigned tag) { Index: llvm/lib/Support/ELFAttributeParser.cpp =================================================================== --- llvm/lib/Support/ELFAttributeParser.cpp +++ llvm/lib/Support/ELFAttributeParser.cpp @@ -140,7 +140,7 @@ return cursor.takeError(); if (sw) { - sw->printEnum("Tag", tag, makeArrayRef(tagNames)); + sw->printEnum("Tag", tag, ArrayRef(tagNames)); sw->printNumber("Size", size); } if (size < 5) Index: llvm/lib/Support/MD5.cpp =================================================================== --- llvm/lib/Support/MD5.cpp +++ llvm/lib/Support/MD5.cpp @@ -210,11 +210,11 @@ memcpy(&InternalState.buffer[used], Ptr, free); Ptr = Ptr + free; Size -= free; - body(makeArrayRef(InternalState.buffer, 64)); + body(ArrayRef(InternalState.buffer, 64)); } if (Size >= 64) { - Ptr = body(makeArrayRef(Ptr, Size & ~(unsigned long) 0x3f)); + Ptr = body(ArrayRef(Ptr, Size & ~(unsigned long)0x3f)); Size &= 0x3f; } @@ -242,7 +242,7 @@ if (free < 8) { memset(&InternalState.buffer[used], 0, free); - body(makeArrayRef(InternalState.buffer, 64)); + body(ArrayRef(InternalState.buffer, 64)); used = 0; free = 64; } @@ -253,7 +253,7 @@ support::endian::write32le(&InternalState.buffer[56], InternalState.lo); support::endian::write32le(&InternalState.buffer[60], InternalState.hi); - body(makeArrayRef(InternalState.buffer, 64)); + body(ArrayRef(InternalState.buffer, 64)); support::endian::write32le(&Result[0], InternalState.a); support::endian::write32le(&Result[4], InternalState.b); Index: llvm/lib/Support/MSP430AttributeParser.cpp =================================================================== --- llvm/lib/Support/MSP430AttributeParser.cpp +++ llvm/lib/Support/MSP430AttributeParser.cpp @@ -22,22 +22,22 @@ Error MSP430AttributeParser::parseISA(AttrType Tag) { static const char *StringVals[] = {"None", "MSP430", "MSP430X"}; - return parseStringAttribute("ISA", Tag, makeArrayRef(StringVals)); + return parseStringAttribute("ISA", Tag, ArrayRef(StringVals)); } Error MSP430AttributeParser::parseCodeModel(AttrType Tag) { static const char *StringVals[] = {"None", "Small", "Large"}; - return parseStringAttribute("Code Model", Tag, makeArrayRef(StringVals)); + return parseStringAttribute("Code Model", Tag, ArrayRef(StringVals)); } Error MSP430AttributeParser::parseDataModel(AttrType Tag) { static const char *StringVals[] = {"None", "Small", "Large", "Restricted"}; - return parseStringAttribute("Data Model", Tag, makeArrayRef(StringVals)); + return parseStringAttribute("Data Model", Tag, ArrayRef(StringVals)); } Error MSP430AttributeParser::parseEnumSize(AttrType Tag) { static const char *StringVals[] = {"None", "Small", "Integer", "Don't Care"}; - return parseStringAttribute("Enum Size", Tag, makeArrayRef(StringVals)); + return parseStringAttribute("Enum Size", Tag, ArrayRef(StringVals)); } Error MSP430AttributeParser::handler(uint64_t Tag, bool &Handled) { Index: llvm/lib/Support/Path.cpp =================================================================== --- llvm/lib/Support/Path.cpp +++ llvm/lib/Support/Path.cpp @@ -771,7 +771,7 @@ if (!components.empty()) { buffer += components[0]; - for (StringRef C : makeArrayRef(components).drop_front()) { + for (StringRef C : ArrayRef(components).drop_front()) { buffer += preferred_separator(style); buffer += C; } @@ -1054,7 +1054,7 @@ BytesRead = read(FD, Buf.data(), BufSize); if (BytesRead <= 0) break; - Hash.update(makeArrayRef(Buf.data(), BytesRead)); + Hash.update(ArrayRef(Buf.data(), BytesRead)); } if (BytesRead < 0) Index: llvm/lib/Support/RISCVAttributeParser.cpp =================================================================== --- llvm/lib/Support/RISCVAttributeParser.cpp +++ llvm/lib/Support/RISCVAttributeParser.cpp @@ -40,7 +40,7 @@ Error RISCVAttributeParser::unalignedAccess(unsigned tag) { static const char *strings[] = {"No unaligned access", "Unaligned access"}; - return parseStringAttribute("Unaligned_access", tag, makeArrayRef(strings)); + return parseStringAttribute("Unaligned_access", tag, ArrayRef(strings)); } Error RISCVAttributeParser::stackAlign(unsigned tag) { Index: llvm/lib/Support/RISCVISAInfo.cpp =================================================================== --- llvm/lib/Support/RISCVISAInfo.cpp +++ llvm/lib/Support/RISCVISAInfo.cpp @@ -160,8 +160,8 @@ findDefaultVersion(StringRef ExtName) { // Find default version of an extension. // TODO: We might set default version based on profile or ISA spec. - for (auto &ExtInfo : {makeArrayRef(SupportedExtensions), - makeArrayRef(SupportedExperimentalExtensions)}) { + for (auto &ExtInfo : {ArrayRef(SupportedExtensions), + ArrayRef(SupportedExperimentalExtensions)}) { auto ExtensionInfoIterator = llvm::find_if(ExtInfo, FindByName(ExtName)); if (ExtensionInfoIterator == ExtInfo.end()) { @@ -469,8 +469,8 @@ ExtName = ExtName.drop_front(1); // Drop '+' or '-' Experimental = stripExperimentalPrefix(ExtName); auto ExtensionInfos = Experimental - ? makeArrayRef(SupportedExperimentalExtensions) - : makeArrayRef(SupportedExtensions); + ? ArrayRef(SupportedExperimentalExtensions) + : ArrayRef(SupportedExtensions); auto ExtensionInfoIterator = llvm::find_if(ExtensionInfos, FindByName(ExtName)); Index: llvm/lib/Support/SourceMgr.cpp =================================================================== --- llvm/lib/Support/SourceMgr.cpp +++ llvm/lib/Support/SourceMgr.cpp @@ -546,9 +546,8 @@ // Add any fix-its. // FIXME: Find the beginning of the line properly for multibyte characters. std::string FixItInsertionLine; - buildFixItLine( - CaretLine, FixItInsertionLine, FixIts, - makeArrayRef(Loc.getPointer() - ColumnNo, LineContents.size())); + buildFixItLine(CaretLine, FixItInsertionLine, FixIts, + ArrayRef(Loc.getPointer() - ColumnNo, LineContents.size())); // Finally, plop on the caret. if (unsigned(ColumnNo) <= NumColumns) Index: llvm/lib/Support/StringRef.cpp =================================================================== --- llvm/lib/Support/StringRef.cpp +++ llvm/lib/Support/StringRef.cpp @@ -92,16 +92,15 @@ unsigned StringRef::edit_distance(llvm::StringRef Other, bool AllowReplacements, unsigned MaxEditDistance) const { - return llvm::ComputeEditDistance( - makeArrayRef(data(), size()), - makeArrayRef(Other.data(), Other.size()), - AllowReplacements, MaxEditDistance); + return llvm::ComputeEditDistance(ArrayRef(data(), size()), + ArrayRef(Other.data(), Other.size()), + AllowReplacements, MaxEditDistance); } unsigned llvm::StringRef::edit_distance_insensitive( StringRef Other, bool AllowReplacements, unsigned MaxEditDistance) const { return llvm::ComputeMappedEditDistance( - makeArrayRef(data(), size()), makeArrayRef(Other.data(), Other.size()), + ArrayRef(data(), size()), ArrayRef(Other.data(), Other.size()), llvm::toLower, AllowReplacements, MaxEditDistance); } Index: llvm/lib/TableGen/Record.cpp =================================================================== --- llvm/lib/TableGen/Record.cpp +++ llvm/lib/TableGen/Record.cpp @@ -416,7 +416,7 @@ } void BitsInit::Profile(FoldingSetNodeID &ID) const { - ProfileBitsInit(ID, makeArrayRef(getTrailingObjects(), NumBits)); + ProfileBitsInit(ID, ArrayRef(getTrailingObjects(), NumBits)); } Init *BitsInit::convertInitializerTo(RecTy *Ty) const { @@ -2190,10 +2190,9 @@ } void CondOpInit::Profile(FoldingSetNodeID &ID) const { - ProfileCondOpInit(ID, - makeArrayRef(getTrailingObjects(), NumConds), - makeArrayRef(getTrailingObjects() + NumConds, NumConds), - ValType); + ProfileCondOpInit(ID, ArrayRef(getTrailingObjects(), NumConds), + ArrayRef(getTrailingObjects() + NumConds, NumConds), + ValType); } CondOpInit *CondOpInit::get(ArrayRef CondRange, @@ -2359,7 +2358,9 @@ } void DagInit::Profile(FoldingSetNodeID &ID) const { - ProfileDagInit(ID, Val, ValName, makeArrayRef(getTrailingObjects(), NumArgs), makeArrayRef(getTrailingObjects(), NumArgNames)); + ProfileDagInit(ID, Val, ValName, + ArrayRef(getTrailingObjects(), NumArgs), + ArrayRef(getTrailingObjects(), NumArgNames)); } Record *DagInit::getOperatorAsDef(ArrayRef Loc) const { @@ -2963,7 +2964,7 @@ // the same vectors multiple times. auto Pair = ClassRecordsMap.try_emplace(ClassName); if (Pair.second) - Pair.first->second = getAllDerivedDefinitions(makeArrayRef(ClassName)); + Pair.first->second = getAllDerivedDefinitions(ArrayRef(ClassName)); return Pair.first->second; } Index: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp =================================================================== --- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -11222,16 +11222,14 @@ Shuffle = DAG.getNode( ISD::INTRINSIC_WO_CHAIN, DL, IndexVT, DAG.getConstant(Intrinsic::aarch64_neon_tbl1, DL, MVT::i32), V1Cst, - DAG.getBuildVector(IndexVT, DL, - makeArrayRef(TBLMask.data(), IndexLen))); + DAG.getBuildVector(IndexVT, DL, ArrayRef(TBLMask.data(), IndexLen))); } else { if (IndexLen == 8) { V1Cst = DAG.getNode(ISD::CONCAT_VECTORS, DL, MVT::v16i8, V1Cst, V2Cst); Shuffle = DAG.getNode( ISD::INTRINSIC_WO_CHAIN, DL, IndexVT, DAG.getConstant(Intrinsic::aarch64_neon_tbl1, DL, MVT::i32), V1Cst, - DAG.getBuildVector(IndexVT, DL, - makeArrayRef(TBLMask.data(), IndexLen))); + DAG.getBuildVector(IndexVT, DL, ArrayRef(TBLMask.data(), IndexLen))); } else { // FIXME: We cannot, for the moment, emit a TBL2 instruction because we // cannot currently represent the register constraints on the input @@ -11242,8 +11240,8 @@ Shuffle = DAG.getNode( ISD::INTRINSIC_WO_CHAIN, DL, IndexVT, DAG.getConstant(Intrinsic::aarch64_neon_tbl2, DL, MVT::i32), V1Cst, - V2Cst, DAG.getBuildVector(IndexVT, DL, - makeArrayRef(TBLMask.data(), IndexLen))); + V2Cst, + DAG.getBuildVector(IndexVT, DL, ArrayRef(TBLMask.data(), IndexLen))); } } return DAG.getNode(ISD::BITCAST, DL, Op.getValueType(), Shuffle); @@ -19583,7 +19581,7 @@ Tys[n] = VecTy; Tys[n++] = MVT::i64; // Type of write back register Tys[n] = MVT::Other; // Type of the chain - SDVTList SDTys = DAG.getVTList(makeArrayRef(Tys, NumResultVecs + 2)); + SDVTList SDTys = DAG.getVTList(ArrayRef(Tys, NumResultVecs + 2)); MemIntrinsicSDNode *MemInt = cast(N); SDValue UpdN = DAG.getMemIntrinsicNode(NewOpc, SDLoc(N), SDTys, Ops, @@ -20428,10 +20426,9 @@ APInt SplatLHSVal; if (CmpLHS.getValueType() == N->getOperand(1).getValueType() && VT.isSimple() && - is_contained( - makeArrayRef({MVT::v8i8, MVT::v16i8, MVT::v4i16, MVT::v8i16, - MVT::v2i32, MVT::v4i32, MVT::v2i64}), - VT.getSimpleVT().SimpleTy) && + is_contained(ArrayRef({MVT::v8i8, MVT::v16i8, MVT::v4i16, MVT::v8i16, + MVT::v2i32, MVT::v4i32, MVT::v2i64}), + VT.getSimpleVT().SimpleTy) && ISD::isConstantSplatVector(SplatLHS, SplatLHSVal) && SplatLHSVal.isOne() && ISD::isConstantSplatVectorAllOnes(CmpRHS) && ISD::isConstantSplatVectorAllOnes(SplatRHS)) { Index: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp =================================================================== --- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ llvm/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -6960,7 +6960,7 @@ {MO_G3, "aarch64-g3"}, {MO_G2, "aarch64-g2"}, {MO_G1, "aarch64-g1"}, {MO_G0, "aarch64-g0"}, {MO_HI12, "aarch64-hi12"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } ArrayRef> @@ -6977,7 +6977,7 @@ {MO_DLLIMPORTAUX, "aarch64-dllimportaux"}, {MO_PREL, "aarch64-prel"}, {MO_TAGGED, "aarch64-tagged"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } ArrayRef> @@ -6985,7 +6985,7 @@ static const std::pair TargetFlags[] = {{MOSuppressPair, "aarch64-suppress-pair"}, {MOStridedAccess, "aarch64-strided-access"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } /// Constants defining how certain sequences should be outlined. Index: llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp =================================================================== --- llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp +++ llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp @@ -1246,7 +1246,7 @@ if (!determineAndHandleAssignments( UsingReturnedArg ? ReturnedArgHandler : Handler, Assigner, InArgs, MIRBuilder, Info.CallConv, Info.IsVarArg, - UsingReturnedArg ? makeArrayRef(OutArgs[0].Regs) : std::nullopt)) + UsingReturnedArg ? ArrayRef(OutArgs[0].Regs) : std::nullopt)) return false; } Index: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp =================================================================== --- llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp +++ llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp @@ -2418,9 +2418,9 @@ Intrinsic::ID TrigIntrin = MI.getOpcode() == AMDGPU::G_FSIN ? Intrinsic::amdgcn_sin : Intrinsic::amdgcn_cos; - B.buildIntrinsic(TrigIntrin, makeArrayRef(DstReg), false) - .addUse(TrigVal) - .setMIFlags(Flags); + B.buildIntrinsic(TrigIntrin, ArrayRef(DstReg), false) + .addUse(TrigVal) + .setMIFlags(Flags); MI.eraseFromParent(); return true; } @@ -4014,11 +4014,11 @@ .addUse(Scale) .setMIFlags(Flags); - B.buildIntrinsic(Intrinsic::amdgcn_div_fixup, makeArrayRef(Res), false) - .addUse(Fmas.getReg(0)) - .addUse(RHS) - .addUse(LHS) - .setMIFlags(Flags); + B.buildIntrinsic(Intrinsic::amdgcn_div_fixup, ArrayRef(Res), false) + .addUse(Fmas.getReg(0)) + .addUse(RHS) + .addUse(LHS) + .setMIFlags(Flags); MI.eraseFromParent(); return true; Index: llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp =================================================================== --- llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp +++ llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp @@ -344,7 +344,7 @@ }; const std::array RegSrcOpIdx = { { 0, 2, 3 } }; - return addMappingFromTable<3>(MI, MRI, RegSrcOpIdx, makeArrayRef(Table)); + return addMappingFromTable<3>(MI, MRI, RegSrcOpIdx, ArrayRef(Table)); } case Intrinsic::amdgcn_writelane: { static const OpRegBankEntry<4> Table[4] = { @@ -363,7 +363,7 @@ // rsrc, voffset, offset const std::array RegSrcOpIdx = { { 0, 2, 3, 4 } }; - return addMappingFromTable<4>(MI, MRI, RegSrcOpIdx, makeArrayRef(Table)); + return addMappingFromTable<4>(MI, MRI, RegSrcOpIdx, ArrayRef(Table)); } default: return RegisterBankInfo::getInstrAlternativeMappings(MI); @@ -392,7 +392,7 @@ // rsrc, offset const std::array RegSrcOpIdx = { { 2, 3 } }; - return addMappingFromTable<2>(MI, MRI, RegSrcOpIdx, makeArrayRef(Table)); + return addMappingFromTable<2>(MI, MRI, RegSrcOpIdx, ArrayRef(Table)); } case Intrinsic::amdgcn_ds_ordered_add: case Intrinsic::amdgcn_ds_ordered_swap: { @@ -406,7 +406,7 @@ }; const std::array RegSrcOpIdx = { { 0, 2, 3 } }; - return addMappingFromTable<3>(MI, MRI, RegSrcOpIdx, makeArrayRef(Table)); + return addMappingFromTable<3>(MI, MRI, RegSrcOpIdx, ArrayRef(Table)); } case Intrinsic::amdgcn_s_sendmsg: case Intrinsic::amdgcn_s_sendmsghalt: { @@ -420,7 +420,7 @@ }; const std::array RegSrcOpIdx = { { 2 } }; - return addMappingFromTable<1>(MI, MRI, RegSrcOpIdx, makeArrayRef(Table)); + return addMappingFromTable<1>(MI, MRI, RegSrcOpIdx, ArrayRef(Table)); } default: return RegisterBankInfo::getInstrAlternativeMappings(MI); Index: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp =================================================================== --- llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp +++ llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp @@ -3278,34 +3278,34 @@ AMDGPUAsmVariants::DPP, AMDGPUAsmVariants::VOP3_DPP }; - return makeArrayRef(Variants); + return ArrayRef(Variants); } // What asm variants we should check ArrayRef AMDGPUAsmParser::getMatchedVariants() const { if (isForcedDPP() && isForcedVOP3()) { static const unsigned Variants[] = {AMDGPUAsmVariants::VOP3_DPP}; - return makeArrayRef(Variants); + return ArrayRef(Variants); } if (getForcedEncodingSize() == 32) { static const unsigned Variants[] = {AMDGPUAsmVariants::DEFAULT}; - return makeArrayRef(Variants); + return ArrayRef(Variants); } if (isForcedVOP3()) { static const unsigned Variants[] = {AMDGPUAsmVariants::VOP3}; - return makeArrayRef(Variants); + return ArrayRef(Variants); } if (isForcedSDWA()) { static const unsigned Variants[] = {AMDGPUAsmVariants::SDWA, AMDGPUAsmVariants::SDWA9}; - return makeArrayRef(Variants); + return ArrayRef(Variants); } if (isForcedDPP()) { static const unsigned Variants[] = {AMDGPUAsmVariants::DPP}; - return makeArrayRef(Variants); + return ArrayRef(Variants); } return getAllVariants(); Index: llvm/lib/Target/AMDGPU/R600ISelLowering.cpp =================================================================== --- llvm/lib/Target/AMDGPU/R600ISelLowering.cpp +++ llvm/lib/Target/AMDGPU/R600ISelLowering.cpp @@ -1705,7 +1705,7 @@ NewVT = VT; NumElements = VT.getVectorNumElements(); } - SDValue Result = DAG.getBuildVector(NewVT, DL, makeArrayRef(Slots, NumElements)); + SDValue Result = DAG.getBuildVector(NewVT, DL, ArrayRef(Slots, NumElements)); if (!VT.isVector()) { Result = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, MVT::i32, Result, DAG.getConstant(0, DL, MVT::i32)); Index: llvm/lib/Target/AMDGPU/SIISelLowering.cpp =================================================================== --- llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -1971,8 +1971,7 @@ if (Arg.isSet()) return ArgDescriptor::createArg(Arg, Mask); - ArrayRef ArgVGPRs - = makeArrayRef(AMDGPU::VGPR_32RegClass.begin(), 32); + ArrayRef ArgVGPRs = ArrayRef(AMDGPU::VGPR_32RegClass.begin(), 32); unsigned RegIdx = CCInfo.getFirstUnallocated(ArgVGPRs); if (RegIdx == ArgVGPRs.size()) { // Spill to stack required. @@ -1994,7 +1993,7 @@ static ArgDescriptor allocateSGPR32InputImpl(CCState &CCInfo, const TargetRegisterClass *RC, unsigned NumArgRegs) { - ArrayRef ArgSGPRs = makeArrayRef(RC->begin(), 32); + ArrayRef ArgSGPRs = ArrayRef(RC->begin(), 32); unsigned RegIdx = CCInfo.getFirstUnallocated(ArgSGPRs); if (RegIdx == ArgSGPRs.size()) report_fatal_error("ran out of SGPRs for arguments"); @@ -8594,7 +8593,7 @@ Ops[1] = BufferStoreExt; unsigned Opc = (VDataType == MVT::i8) ? AMDGPUISD::BUFFER_STORE_BYTE : AMDGPUISD::BUFFER_STORE_SHORT; - ArrayRef OpsRef = makeArrayRef(&Ops[0], 9); + ArrayRef OpsRef = ArrayRef(&Ops[0], 9); return DAG.getMemIntrinsicNode(Opc, DL, M->getVTList(), OpsRef, VDataType, M->getMemOperand()); } Index: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp =================================================================== --- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp +++ llvm/lib/Target/AMDGPU/SIInstrInfo.cpp @@ -7743,7 +7743,7 @@ {AMDGPU::TI_SCRATCH_RSRC_DWORD1, "amdgpu-scratch-rsrc-dword1"}, {AMDGPU::TI_SCRATCH_RSRC_DWORD2, "amdgpu-scratch-rsrc-dword2"}, {AMDGPU::TI_SCRATCH_RSRC_DWORD3, "amdgpu-scratch-rsrc-dword3"}}; - return makeArrayRef(TargetIndices); + return ArrayRef(TargetIndices); } /// This is used by the post-RA scheduler (SchedulePostRAList.cpp). The @@ -7792,7 +7792,7 @@ { MO_ABS32_HI, "amdgpu-abs32-hi" }, }; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } ArrayRef> @@ -7802,7 +7802,7 @@ {MONoClobber, "amdgpu-noclobber"}, }; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } bool SIInstrInfo::isBasicBlockPrologue(const MachineInstr &MI) const { Index: llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h =================================================================== --- llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h +++ llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h @@ -560,7 +560,7 @@ auto I = SGPRSpillToVGPRLanes.find(FrameIndex); return (I == SGPRSpillToVGPRLanes.end()) ? ArrayRef() - : makeArrayRef(I->second); + : ArrayRef(I->second); } ArrayRef getSGPRSpillVGPRs() const { return SpillVGPRs; } @@ -624,7 +624,7 @@ auto I = PrologEpilogSGPRSpillToVGPRLanes.find(FrameIndex); return (I == PrologEpilogSGPRSpillToVGPRLanes.end()) ? ArrayRef() - : makeArrayRef(I->second); + : ArrayRef(I->second); } void allocateWWMSpill(MachineFunction &MF, Register VGPR, uint64_t Size = 4, Index: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp =================================================================== --- llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp +++ llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp @@ -2887,7 +2887,7 @@ const std::vector &Parts = RegSplitParts[EltDWORDs - 1]; const unsigned NumParts = RegDWORDs / EltDWORDs; - return makeArrayRef(Parts.data(), NumParts); + return ArrayRef(Parts.data(), NumParts); } const TargetRegisterClass* @@ -3155,17 +3155,15 @@ ArrayRef SIRegisterInfo::getAllSGPR128(const MachineFunction &MF) const { - return makeArrayRef(AMDGPU::SGPR_128RegClass.begin(), - ST.getMaxNumSGPRs(MF) / 4); + return ArrayRef(AMDGPU::SGPR_128RegClass.begin(), ST.getMaxNumSGPRs(MF) / 4); } ArrayRef SIRegisterInfo::getAllSGPR64(const MachineFunction &MF) const { - return makeArrayRef(AMDGPU::SGPR_64RegClass.begin(), - ST.getMaxNumSGPRs(MF) / 2); + return ArrayRef(AMDGPU::SGPR_64RegClass.begin(), ST.getMaxNumSGPRs(MF) / 2); } ArrayRef SIRegisterInfo::getAllSGPR32(const MachineFunction &MF) const { - return makeArrayRef(AMDGPU::SGPR_32RegClass.begin(), ST.getMaxNumSGPRs(MF)); + return ArrayRef(AMDGPU::SGPR_32RegClass.begin(), ST.getMaxNumSGPRs(MF)); } Index: llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp =================================================================== --- llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp +++ llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp @@ -29,7 +29,7 @@ #include "AMDKernelCodeTInfo.h" #undef RECORD }; - return makeArrayRef(Table); + return ArrayRef(Table); } static ArrayRef get_amd_kernel_code_t_FldAltNames() { @@ -39,7 +39,7 @@ #include "AMDKernelCodeTInfo.h" #undef RECORD }; - return makeArrayRef(Table); + return ArrayRef(Table); } static StringMap createIndexMap(const ArrayRef &names, @@ -90,7 +90,7 @@ #include "AMDKernelCodeTInfo.h" #undef RECORD }; - return makeArrayRef(Table); + return ArrayRef(Table); } void llvm::printAmdKernelCodeField(const amd_kernel_code_t &C, @@ -160,7 +160,7 @@ #include "AMDKernelCodeTInfo.h" #undef RECORD }; - return makeArrayRef(Table); + return ArrayRef(Table); } bool llvm::parseAmdKernelCodeField(StringRef ID, Index: llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp =================================================================== --- llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -5540,7 +5540,7 @@ static const std::pair TargetFlags[] = { {MO_LO16, "arm-lo16"}, {MO_HI16, "arm-hi16"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } ArrayRef> @@ -5554,7 +5554,7 @@ {MO_DLLIMPORT, "arm-dllimport"}, {MO_SECREL, "arm-secrel"}, {MO_NONLAZY, "arm-nonlazy"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } std::optional Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp =================================================================== --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp @@ -2640,7 +2640,7 @@ Ops.push_back(getAL(CurDAG, Loc)); Ops.push_back(CurDAG->getRegister(0, MVT::i32)); - CurDAG->SelectNodeTo(N, Opcode, N->getVTList(), makeArrayRef(Ops)); + CurDAG->SelectNodeTo(N, Opcode, N->getVTList(), ArrayRef(Ops)); } void ARMDAGToDAGISel::SelectMVE_VADCSBC(SDNode *N, uint16_t OpcodeWithCarry, @@ -2674,7 +2674,7 @@ else AddEmptyMVEPredicateToOps(Ops, Loc, N->getValueType(0)); - CurDAG->SelectNodeTo(N, Opcode, N->getVTList(), makeArrayRef(Ops)); + CurDAG->SelectNodeTo(N, Opcode, N->getVTList(), ArrayRef(Ops)); } void ARMDAGToDAGISel::SelectMVE_VSHLC(SDNode *N, bool Predicated) { @@ -2693,7 +2693,7 @@ else AddEmptyMVEPredicateToOps(Ops, Loc); - CurDAG->SelectNodeTo(N, ARM::MVE_VSHLC, N->getVTList(), makeArrayRef(Ops)); + CurDAG->SelectNodeTo(N, ARM::MVE_VSHLC, N->getVTList(), ArrayRef(Ops)); } static bool SDValueToConstBool(SDValue SDVal) { @@ -2755,7 +2755,7 @@ else AddEmptyMVEPredicateToOps(Ops, Loc); - CurDAG->SelectNodeTo(N, Opcode, N->getVTList(), makeArrayRef(Ops)); + CurDAG->SelectNodeTo(N, Opcode, N->getVTList(), ArrayRef(Ops)); } void ARMDAGToDAGISel::SelectMVE_VMLLDAV(SDNode *N, bool Predicated, @@ -2883,7 +2883,7 @@ else AddEmptyMVEPredicateToOps(Ops, Loc, N->getValueType(0)); - CurDAG->SelectNodeTo(N, Opcode, N->getVTList(), makeArrayRef(Ops)); + CurDAG->SelectNodeTo(N, Opcode, N->getVTList(), ArrayRef(Ops)); } void ARMDAGToDAGISel::SelectCDE_CXxD(SDNode *N, uint16_t Opcode, Index: llvm/lib/Target/ARM/ARMISelLowering.cpp =================================================================== --- llvm/lib/Target/ARM/ARMISelLowering.cpp +++ llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -8036,12 +8036,11 @@ SmallVector Ops(Op->op_begin(), Op->op_begin() + NumElts); EVT ExtVT = VT.getVectorElementType(); EVT HVT = EVT::getVectorVT(*DAG.getContext(), ExtVT, NumElts / 2); - SDValue Lower = - DAG.getBuildVector(HVT, dl, makeArrayRef(&Ops[0], NumElts / 2)); + SDValue Lower = DAG.getBuildVector(HVT, dl, ArrayRef(&Ops[0], NumElts / 2)); if (Lower.getOpcode() == ISD::BUILD_VECTOR) Lower = LowerBUILD_VECTOR(Lower, DAG, ST); - SDValue Upper = DAG.getBuildVector( - HVT, dl, makeArrayRef(&Ops[NumElts / 2], NumElts / 2)); + SDValue Upper = + DAG.getBuildVector(HVT, dl, ArrayRef(&Ops[NumElts / 2], NumElts / 2)); if (Upper.getOpcode() == ISD::BUILD_VECTOR) Upper = LowerBUILD_VECTOR(Upper, DAG, ST); if (Lower && Upper) @@ -15851,7 +15850,7 @@ Tys[n] = AlignedVecTy; Tys[n++] = MVT::i32; Tys[n] = MVT::Other; - SDVTList SDTys = DAG.getVTList(makeArrayRef(Tys, NumResultVecs + 2)); + SDVTList SDTys = DAG.getVTList(ArrayRef(Tys, NumResultVecs + 2)); // Then, gather the new node's operands. SmallVector Ops; @@ -16162,7 +16161,7 @@ Tys[n] = VecTy; Tys[n++] = MVT::i32; Tys[n] = MVT::Other; - SDVTList SDTys = DAG.getVTList(makeArrayRef(Tys, NumResultVecs + 2)); + SDVTList SDTys = DAG.getVTList(ArrayRef(Tys, NumResultVecs + 2)); // Then, gather the new node's operands. SmallVector Ops; @@ -16243,7 +16242,7 @@ for (n = 0; n < NumVecs; ++n) Tys[n] = VT; Tys[n] = MVT::Other; - SDVTList SDTys = DAG.getVTList(makeArrayRef(Tys, NumVecs+1)); + SDVTList SDTys = DAG.getVTList(ArrayRef(Tys, NumVecs + 1)); SDValue Ops[] = { VLD->getOperand(0), VLD->getOperand(2) }; MemIntrinsicSDNode *VLDMemInt = cast(VLD); SDValue VLDDup = DAG.getMemIntrinsicNode(NewOpc, SDLoc(VLD), SDTys, Index: llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp =================================================================== --- llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp +++ llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp @@ -266,8 +266,7 @@ SrcOff += VTSize; BytesLeft -= VTSize; } - Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, - makeArrayRef(TFOps, i)); + Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, ArrayRef(TFOps, i)); i = 0; BytesLeft = BytesLeftSave; @@ -282,8 +281,7 @@ DstOff += VTSize; BytesLeft -= VTSize; } - return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, - makeArrayRef(TFOps, i)); + return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, ArrayRef(TFOps, i)); } SDValue ARMSelectionDAGInfo::EmitTargetCodeForMemmove( Index: llvm/lib/Target/AVR/AVRISelLowering.cpp =================================================================== --- llvm/lib/Target/AVR/AVRISelLowering.cpp +++ llvm/lib/Target/AVR/AVRISelLowering.cpp @@ -1127,11 +1127,11 @@ ArrayRef RegList8; ArrayRef RegList16; if (Tiny) { - RegList8 = makeArrayRef(RegList8Tiny, std::size(RegList8Tiny)); - RegList16 = makeArrayRef(RegList16Tiny, std::size(RegList16Tiny)); + RegList8 = ArrayRef(RegList8Tiny, std::size(RegList8Tiny)); + RegList16 = ArrayRef(RegList16Tiny, std::size(RegList16Tiny)); } else { - RegList8 = makeArrayRef(RegList8AVR, std::size(RegList8AVR)); - RegList16 = makeArrayRef(RegList16AVR, std::size(RegList16AVR)); + RegList8 = ArrayRef(RegList8AVR, std::size(RegList8AVR)); + RegList16 = ArrayRef(RegList16AVR, std::size(RegList16AVR)); } unsigned NumArgs = Args.size(); @@ -1227,11 +1227,11 @@ ArrayRef RegList8; ArrayRef RegList16; if (Tiny) { - RegList8 = makeArrayRef(RegList8Tiny, std::size(RegList8Tiny)); - RegList16 = makeArrayRef(RegList16Tiny, std::size(RegList16Tiny)); + RegList8 = ArrayRef(RegList8Tiny, std::size(RegList8Tiny)); + RegList16 = ArrayRef(RegList16Tiny, std::size(RegList16Tiny)); } else { - RegList8 = makeArrayRef(RegList8AVR, std::size(RegList8AVR)); - RegList16 = makeArrayRef(RegList16AVR, std::size(RegList16AVR)); + RegList8 = ArrayRef(RegList8AVR, std::size(RegList8AVR)); + RegList16 = ArrayRef(RegList16AVR, std::size(RegList16AVR)); } // GCC-ABI says that the size is rounded up to the next even number, Index: llvm/lib/Target/CSKY/CSKYISelLowering.cpp =================================================================== --- llvm/lib/Target/CSKY/CSKYISelLowering.cpp +++ llvm/lib/Target/CSKY/CSKYISelLowering.cpp @@ -364,7 +364,7 @@ const unsigned XLenInBytes = 4; const MVT XLenVT = MVT::i32; - ArrayRef ArgRegs = makeArrayRef(GPRArgRegs); + ArrayRef ArgRegs = ArrayRef(GPRArgRegs); unsigned Idx = CCInfo.getFirstUnallocated(ArgRegs); const TargetRegisterClass *RC = &CSKY::GPRRegClass; MachineFrameInfo &MFI = MF.getFrameInfo(); Index: llvm/lib/Target/DirectX/DXILWriter/DXILValueEnumerator.h =================================================================== --- llvm/lib/Target/DirectX/DXILWriter/DXILValueEnumerator.h +++ llvm/lib/Target/DirectX/DXILWriter/DXILValueEnumerator.h @@ -201,12 +201,12 @@ /// Get the MDString metadata for this block. ArrayRef getMDStrings() const { - return makeArrayRef(MDs).slice(NumModuleMDs, NumMDStrings); + return ArrayRef(MDs).slice(NumModuleMDs, NumMDStrings); } /// Get the non-MDString metadata for this block. ArrayRef getNonMDStrings() const { - return makeArrayRef(MDs).slice(NumModuleMDs).slice(NumMDStrings); + return ArrayRef(MDs).slice(NumModuleMDs).slice(NumMDStrings); } const TypeList &getTypes() const { return Types; } Index: llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp =================================================================== --- llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp +++ llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp @@ -1006,8 +1006,8 @@ static const Register Regs01[] = { LC0, SA0, LC1, SA1 }; static const Register Regs1[] = { LC1, SA1 }; - auto CheckRegs = IsInnerHWLoop ? makeArrayRef(Regs01, std::size(Regs01)) - : makeArrayRef(Regs1, std::size(Regs1)); + auto CheckRegs = IsInnerHWLoop ? ArrayRef(Regs01, std::size(Regs01)) + : ArrayRef(Regs1, std::size(Regs1)); for (Register R : CheckRegs) if (MI->modifiesRegister(R, TRI)) return true; Index: llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp =================================================================== --- llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp +++ llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp @@ -2083,7 +2083,7 @@ {MO_IEGOT, "hexagon-iegot"}, {MO_TPREL, "hexagon-tprel"} }; - return makeArrayRef(Flags); + return ArrayRef(Flags); } ArrayRef> @@ -2093,7 +2093,7 @@ static const std::pair Flags[] = { {HMOTF_ConstExtended, "hexagon-ext"} }; - return makeArrayRef(Flags); + return ArrayRef(Flags); } Register HexagonInstrInfo::createVR(MachineFunction *MF, MVT VT) const { Index: llvm/lib/Target/Hexagon/HexagonSubtarget.h =================================================================== --- llvm/lib/Target/Hexagon/HexagonSubtarget.h +++ llvm/lib/Target/Hexagon/HexagonSubtarget.h @@ -324,8 +324,8 @@ static MVT TypesV68[] = {MVT::i8, MVT::i16, MVT::i32, MVT::f16, MVT::f32}; if (useHVXV68Ops() && useHVXFloatingPoint()) - return makeArrayRef(TypesV68); - return makeArrayRef(Types); + return ArrayRef(TypesV68); + return ArrayRef(Types); } bool isHVXElementType(MVT Ty, bool IncludeBool = false) const; Index: llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp =================================================================== --- llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp +++ llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp @@ -610,7 +610,7 @@ } llvm::ArrayRef Hexagon_MC::GetVectRegRev() { - return makeArrayRef(VectRegRev); + return ArrayRef(VectRegRev); } namespace { Index: llvm/lib/Target/Lanai/LanaiInstrInfo.cpp =================================================================== --- llvm/lib/Target/Lanai/LanaiInstrInfo.cpp +++ llvm/lib/Target/Lanai/LanaiInstrInfo.cpp @@ -171,7 +171,7 @@ {MO_ABS_HI, "lanai-hi"}, {MO_ABS_LO, "lanai-lo"}, {MO_NO_FLAG, "lanai-nf"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } bool LanaiInstrInfo::analyzeCompare(const MachineInstr &MI, Register &SrcReg, Index: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp =================================================================== --- llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp +++ llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp @@ -2154,7 +2154,7 @@ } if (IsVarArg) { - ArrayRef ArgRegs = makeArrayRef(ArgGPRs); + ArrayRef ArgRegs = ArrayRef(ArgGPRs); unsigned Idx = CCInfo.getFirstUnallocated(ArgRegs); const TargetRegisterClass *RC = &LoongArch::GPRRegClass; MachineFrameInfo &MFI = MF.getFrameInfo(); Index: llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp =================================================================== --- llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp +++ llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp @@ -484,5 +484,5 @@ {MO_IE_PC_LO, "loongarch-ie-pc-lo"}, {MO_LD_PC_HI, "loongarch-ld-pc-hi"}, {MO_GD_PC_HI, "loongarch-gd-pc-hi"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } Index: llvm/lib/Target/M68k/M68kInstrInfo.cpp =================================================================== --- llvm/lib/Target/M68k/M68kInstrInfo.cpp +++ llvm/lib/Target/M68k/M68kInstrInfo.cpp @@ -810,7 +810,7 @@ {MO_GOTOFF, "m68k-gotoff"}, {MO_GOTPCREL, "m68k-gotpcrel"}, {MO_PLT, "m68k-plt"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } namespace { Index: llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp =================================================================== --- llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp +++ llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp @@ -33,17 +33,17 @@ ArrayRef MipsABIInfo::GetByValArgRegs() const { if (IsO32()) - return makeArrayRef(O32IntRegs); + return ArrayRef(O32IntRegs); if (IsN32() || IsN64()) - return makeArrayRef(Mips64IntRegs); + return ArrayRef(Mips64IntRegs); llvm_unreachable("Unhandled ABI"); } ArrayRef MipsABIInfo::GetVarArgRegs() const { if (IsO32()) - return makeArrayRef(O32IntRegs); + return ArrayRef(O32IntRegs); if (IsN32() || IsN64()) - return makeArrayRef(Mips64IntRegs); + return ArrayRef(Mips64IntRegs); llvm_unreachable("Unhandled ABI"); } Index: llvm/lib/Target/Mips/MipsInstrInfo.cpp =================================================================== --- llvm/lib/Target/Mips/MipsInstrInfo.cpp +++ llvm/lib/Target/Mips/MipsInstrInfo.cpp @@ -930,7 +930,7 @@ {MO_CALL_LO16, "mips-call-lo16"}, {MO_JALR, "mips-jalr"} }; - return makeArrayRef(Flags); + return ArrayRef(Flags); } std::optional Index: llvm/lib/Target/Mips/MipsSEISelLowering.cpp =================================================================== --- llvm/lib/Target/Mips/MipsSEISelLowering.cpp +++ llvm/lib/Target/Mips/MipsSEISelLowering.cpp @@ -508,7 +508,7 @@ SDValue Ops[] = { Op0->getOperand(0), Op0->getOperand(1), Op0Op2 }; return DAG.getNode(MipsISD::VEXTRACT_ZEXT_ELT, SDLoc(Op0), Op0->getVTList(), - makeArrayRef(Ops, Op0->getNumOperands())); + ArrayRef(Ops, Op0->getNumOperands())); } } @@ -917,7 +917,7 @@ Op0Op0->getOperand(2) }; return DAG.getNode(MipsISD::VEXTRACT_SEXT_ELT, SDLoc(Op0Op0), Op0Op0->getVTList(), - makeArrayRef(Ops, Op0Op0->getNumOperands())); + ArrayRef(Ops, Op0Op0->getNumOperands())); } } } @@ -1396,7 +1396,7 @@ LaneA, LaneB, LaneA, LaneB, LaneA, LaneB, LaneA, LaneB }; SDValue Result = DAG.getBuildVector( - ViaVecTy, DL, makeArrayRef(Ops, ViaVecTy.getVectorNumElements())); + ViaVecTy, DL, ArrayRef(Ops, ViaVecTy.getVectorNumElements())); if (ViaVecTy != ResVecTy) { SDValue One = DAG.getConstant(1, DL, ViaVecTy); @@ -1444,7 +1444,7 @@ SplatValueA, SplatValueB, SplatValueA, SplatValueB }; SDValue Result = DAG.getBuildVector( - ViaVecTy, DL, makeArrayRef(Ops, ViaVecTy.getVectorNumElements())); + ViaVecTy, DL, ArrayRef(Ops, ViaVecTy.getVectorNumElements())); if (VecTy != ViaVecTy) Result = DAG.getNode(ISD::BITCAST, DL, VecTy, Result); Index: llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp =================================================================== --- llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp +++ llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp @@ -220,7 +220,7 @@ } else { for (unsigned i = 0; i < NumOperands; ++i) { NewValue = - Builder.CreateInsertValue(NewValue, NewOperands[i], makeArrayRef(i)); + Builder.CreateInsertValue(NewValue, NewOperands[i], ArrayRef(i)); } } @@ -274,7 +274,7 @@ // GetElementPtrConstantExpr return Builder.CreateGEP(cast(C)->getSourceElementType(), NewOperands[0], - makeArrayRef(&NewOperands[1], NumOperands - 1), "", + ArrayRef(&NewOperands[1], NumOperands - 1), "", cast(C)->isInBounds()); case Instruction::Select: // SelectConstantExpr Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp =================================================================== --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -5391,8 +5391,8 @@ const SDLoc &dl) { SDValue MTCTROps[] = {Chain, Callee, Glue}; EVT ReturnTypes[] = {MVT::Other, MVT::Glue}; - Chain = DAG.getNode(PPCISD::MTCTR, dl, makeArrayRef(ReturnTypes, 2), - makeArrayRef(MTCTROps, Glue.getNode() ? 3 : 2)); + Chain = DAG.getNode(PPCISD::MTCTR, dl, ArrayRef(ReturnTypes, 2), + ArrayRef(MTCTROps, Glue.getNode() ? 3 : 2)); // The glue is the second value produced. Glue = Chain.getValue(1); } @@ -5940,8 +5940,8 @@ SDVTList VTs = DAG.getVTList(MVT::Other, MVT::Glue); SDValue Ops[] = { Chain, InFlag }; - Chain = DAG.getNode(seenFloatArg ? PPCISD::CR6SET : PPCISD::CR6UNSET, - dl, VTs, makeArrayRef(Ops, InFlag.getNode() ? 2 : 1)); + Chain = DAG.getNode(seenFloatArg ? PPCISD::CR6SET : PPCISD::CR6UNSET, dl, + VTs, ArrayRef(Ops, InFlag.getNode() ? 2 : 1)); InFlag = Chain.getValue(1); } @@ -10600,7 +10600,7 @@ if (Subtarget.isISAFuture()) { EVT ReturnTypes[] = {MVT::v256i1, MVT::v256i1}; SDValue WideVec = SDValue(DAG.getMachineNode(PPC::DMXXEXTFDMR512, dl, - makeArrayRef(ReturnTypes, 2), + ArrayRef(ReturnTypes, 2), Op.getOperand(1)), 0); SmallVector RetOps; @@ -11108,9 +11108,8 @@ if (StoreVT == MVT::v512i1) { if (Subtarget.isISAFuture()) { EVT ReturnTypes[] = {MVT::v256i1, MVT::v256i1}; - MachineSDNode *ExtNode = DAG.getMachineNode(PPC::DMXXEXTFDMR512, dl, - makeArrayRef(ReturnTypes, 2), - Op.getOperand(1)); + MachineSDNode *ExtNode = DAG.getMachineNode( + PPC::DMXXEXTFDMR512, dl, ArrayRef(ReturnTypes, 2), Op.getOperand(1)); Value = SDValue(ExtNode, 0); Value2 = SDValue(ExtNode, 1); Index: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp =================================================================== --- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp +++ llvm/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -2993,7 +2993,7 @@ {MO_TLSLD_LO, "ppc-tlsld-lo"}, {MO_TOC_LO, "ppc-toc-lo"}, {MO_TLS, "ppc-tls"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } ArrayRef> @@ -3012,7 +3012,7 @@ {MO_GOT_TLSGD_PCREL_FLAG, "ppc-got-tlsgd-pcrel"}, {MO_GOT_TLSLD_PCREL_FLAG, "ppc-got-tlsld-pcrel"}, {MO_GOT_TPREL_PCREL_FLAG, "ppc-got-tprel-pcrel"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } // Expand VSX Memory Pseudo instruction to either a VSX or a FP instruction. Index: llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp =================================================================== --- llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp +++ llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp @@ -392,7 +392,7 @@ Ops[*VecOperand] = Start; Type *SourceTy = GEP->getSourceElementType(); Value *BasePtr = - Builder.CreateGEP(SourceTy, Ops[0], makeArrayRef(Ops).drop_front()); + Builder.CreateGEP(SourceTy, Ops[0], ArrayRef(Ops).drop_front()); // Convert stride to pointer size if needed. Type *IntPtrTy = DL->getIntPtrType(BasePtr->getType()); @@ -428,7 +428,7 @@ Ops[*VecOperand] = BasePhi; Type *SourceTy = GEP->getSourceElementType(); Value *BasePtr = - Builder.CreateGEP(SourceTy, Ops[0], makeArrayRef(Ops).drop_front()); + Builder.CreateGEP(SourceTy, Ops[0], ArrayRef(Ops).drop_front()); // Final adjustments to stride should go in the start block. Builder.SetInsertPoint( Index: llvm/lib/Target/RISCV/RISCVISelLowering.cpp =================================================================== --- llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -12367,7 +12367,7 @@ MF.getInfo()->setIsVectorCall(); if (IsVarArg) { - ArrayRef ArgRegs = makeArrayRef(ArgGPRs); + ArrayRef ArgRegs = ArrayRef(ArgGPRs); unsigned Idx = CCInfo.getFirstUnallocated(ArgRegs); const TargetRegisterClass *RC = &RISCV::GPRRegClass; MachineFrameInfo &MFI = MF.getFrameInfo(); Index: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp =================================================================== --- llvm/lib/Target/RISCV/RISCVInstrInfo.cpp +++ llvm/lib/Target/RISCV/RISCVInstrInfo.cpp @@ -1833,7 +1833,7 @@ {MO_TPREL_ADD, "riscv-tprel-add"}, {MO_TLS_GOT_HI, "riscv-tls-got-hi"}, {MO_TLS_GD_HI, "riscv-tls-gd-hi"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } bool RISCVInstrInfo::isFunctionSafeToOutlineFrom( MachineFunction &MF, bool OutlineFromLinkOnceODRs) const { Index: llvm/lib/Target/SystemZ/SystemZISelLowering.cpp =================================================================== --- llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +++ llvm/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -1628,8 +1628,8 @@ } // Join the stores, which are independent of one another. Chain = DAG.getNode(ISD::TokenFactor, DL, MVT::Other, - makeArrayRef(&MemOps[NumFixedFPRs], - SystemZ::ELFNumArgFPRs-NumFixedFPRs)); + ArrayRef(&MemOps[NumFixedFPRs], + SystemZ::ELFNumArgFPRs - NumFixedFPRs)); } } @@ -3672,7 +3672,7 @@ bool IsReturnValueUsed = false; EVT VT = Op.getValueType(); SDValue AllocaCall = - makeExternalCall(Chain, DAG, "@@ALCAXP", VT, makeArrayRef(NeededSpace), + makeExternalCall(Chain, DAG, "@@ALCAXP", VT, ArrayRef(NeededSpace), CallingConv::C, IsSigned, DL, DoesNotReturn, IsReturnValueUsed) .first; Index: llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp =================================================================== --- llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp +++ llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp @@ -197,7 +197,7 @@ {WebAssembly::TI_OPERAND_STACK, "wasm-operand-stack"}, {WebAssembly::TI_GLOBAL_RELOC, "wasm-global-reloc"}, {WebAssembly::TI_LOCAL_INDIRECT, "wasm-local-indirect"}}; - return makeArrayRef(TargetIndices); + return ArrayRef(TargetIndices); } const MachineOperand & Index: llvm/lib/Target/X86/ImmutableGraph.h =================================================================== --- llvm/lib/Target/X86/ImmutableGraph.h +++ llvm/lib/Target/X86/ImmutableGraph.h @@ -72,7 +72,7 @@ // node. const Edge *edges_end() const { return (this + 1)->Edges; } ArrayRef edges() const { - return makeArrayRef(edges_begin(), edges_end()); + return ArrayRef(edges_begin(), edges_end()); } }; @@ -87,11 +87,11 @@ ImmutableGraph &operator=(ImmutableGraph &&) = delete; public: - ArrayRef nodes() const { return makeArrayRef(Nodes.get(), NodesSize); } + ArrayRef nodes() const { return ArrayRef(Nodes.get(), NodesSize); } const Node *nodes_begin() const { return nodes().begin(); } const Node *nodes_end() const { return nodes().end(); } - ArrayRef edges() const { return makeArrayRef(Edges.get(), EdgesSize); } + ArrayRef edges() const { return ArrayRef(Edges.get(), EdgesSize); } const Edge *edges_begin() const { return edges().begin(); } const Edge *edges_end() const { return edges().end(); } Index: llvm/lib/Target/X86/X86CallingConv.cpp =================================================================== --- llvm/lib/Target/X86/X86CallingConv.cpp +++ llvm/lib/Target/X86/X86CallingConv.cpp @@ -68,23 +68,23 @@ if (ValVT.is512BitVector()) { static const MCPhysReg RegListZMM[] = {X86::ZMM0, X86::ZMM1, X86::ZMM2, X86::ZMM3, X86::ZMM4, X86::ZMM5}; - return makeArrayRef(std::begin(RegListZMM), std::end(RegListZMM)); + return ArrayRef(std::begin(RegListZMM), std::end(RegListZMM)); } if (ValVT.is256BitVector()) { static const MCPhysReg RegListYMM[] = {X86::YMM0, X86::YMM1, X86::YMM2, X86::YMM3, X86::YMM4, X86::YMM5}; - return makeArrayRef(std::begin(RegListYMM), std::end(RegListYMM)); + return ArrayRef(std::begin(RegListYMM), std::end(RegListYMM)); } static const MCPhysReg RegListXMM[] = {X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3, X86::XMM4, X86::XMM5}; - return makeArrayRef(std::begin(RegListXMM), std::end(RegListXMM)); + return ArrayRef(std::begin(RegListXMM), std::end(RegListXMM)); } static ArrayRef CC_X86_64_VectorCallGetGPRs() { static const MCPhysReg RegListGPR[] = {X86::RCX, X86::RDX, X86::R8, X86::R9}; - return makeArrayRef(std::begin(RegListGPR), std::end(RegListGPR)); + return ArrayRef(std::begin(RegListGPR), std::end(RegListGPR)); } static bool CC_X86_VectorCallAssignRegister(unsigned &ValNo, MVT &ValVT, Index: llvm/lib/Target/X86/X86EvexToVex.cpp =================================================================== --- llvm/lib/Target/X86/X86EvexToVex.cpp +++ llvm/lib/Target/X86/X86EvexToVex.cpp @@ -251,8 +251,8 @@ // Use the VEX.L bit to select the 128 or 256-bit table. ArrayRef Table = - (Desc.TSFlags & X86II::VEX_L) ? makeArrayRef(X86EvexToVex256CompressTable) - : makeArrayRef(X86EvexToVex128CompressTable); + (Desc.TSFlags & X86II::VEX_L) ? ArrayRef(X86EvexToVex256CompressTable) + : ArrayRef(X86EvexToVex128CompressTable); const auto *I = llvm::lower_bound(Table, MI.getOpcode()); if (I == Table.end() || I->EvexOpcode != MI.getOpcode()) Index: llvm/lib/Target/X86/X86ISelLowering.cpp =================================================================== --- llvm/lib/Target/X86/X86ISelLowering.cpp +++ llvm/lib/Target/X86/X86ISelLowering.cpp @@ -3796,13 +3796,13 @@ static const MCPhysReg GPR64ArgRegsWin64[] = { X86::RCX, X86::RDX, X86::R8, X86::R9 }; - return makeArrayRef(std::begin(GPR64ArgRegsWin64), std::end(GPR64ArgRegsWin64)); + return ArrayRef(std::begin(GPR64ArgRegsWin64), std::end(GPR64ArgRegsWin64)); } static const MCPhysReg GPR64ArgRegs64Bit[] = { X86::RDI, X86::RSI, X86::RDX, X86::RCX, X86::R8, X86::R9 }; - return makeArrayRef(std::begin(GPR64ArgRegs64Bit), std::end(GPR64ArgRegs64Bit)); + return ArrayRef(std::begin(GPR64ArgRegs64Bit), std::end(GPR64ArgRegs64Bit)); } // FIXME: Get this from tablegen. @@ -3828,7 +3828,7 @@ X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3, X86::XMM4, X86::XMM5, X86::XMM6, X86::XMM7 }; - return makeArrayRef(std::begin(XMMArgRegs64Bit), std::end(XMMArgRegs64Bit)); + return ArrayRef(std::begin(XMMArgRegs64Bit), std::end(XMMArgRegs64Bit)); } #ifndef NDEBUG @@ -9665,7 +9665,7 @@ unsigned SeqLen = Sequence.size(); bool UpperZeroOrUndef = SeqLen == 1 || - llvm::all_of(makeArrayRef(Sequence).drop_front(), [](SDValue V) { + llvm::all_of(ArrayRef(Sequence).drop_front(), [](SDValue V) { return !V || V.isUndef() || isNullConstant(V); }); SDValue Op0 = Sequence[0]; @@ -29750,11 +29750,11 @@ const int Mask[] = {1, -1, 3, -1, 5, -1, 7, -1, 9, -1, 11, -1, 13, -1, 15, -1}; // => - SDValue Odd0 = DAG.getVectorShuffle(VT, dl, A, A, - makeArrayRef(&Mask[0], NumElts)); + SDValue Odd0 = + DAG.getVectorShuffle(VT, dl, A, A, ArrayRef(&Mask[0], NumElts)); // => - SDValue Odd1 = DAG.getVectorShuffle(VT, dl, B, B, - makeArrayRef(&Mask[0], NumElts)); + SDValue Odd1 = + DAG.getVectorShuffle(VT, dl, B, B, ArrayRef(&Mask[0], NumElts)); // Emit two multiplies, one for the lower 2 ints and one for the higher 2 // ints. @@ -41206,7 +41206,7 @@ // See if this reduces to a PSHUFD which is no more expensive and can // combine with more operations. Note that it has to at least flip the // dwords as otherwise it would have been removed as a no-op. - if (makeArrayRef(Mask).equals({2, 3, 0, 1})) { + if (ArrayRef(Mask).equals({2, 3, 0, 1})) { int DMask[] = {0, 1, 2, 3}; int DOffset = N.getOpcode() == X86ISD::PSHUFLW ? 0 : 2; DMask[DOffset + 0] = DOffset + 1; @@ -41241,8 +41241,8 @@ int MappedMask[8]; for (int i = 0; i < 8; ++i) MappedMask[i] = 2 * DMask[WordMask[i] / 2] + WordMask[i] % 2; - if (makeArrayRef(MappedMask).equals({0, 0, 1, 1, 2, 2, 3, 3}) || - makeArrayRef(MappedMask).equals({4, 4, 5, 5, 6, 6, 7, 7})) { + if (ArrayRef(MappedMask).equals({0, 0, 1, 1, 2, 2, 3, 3}) || + ArrayRef(MappedMask).equals({4, 4, 5, 5, 6, 6, 7, 7})) { // We can replace all three shuffles with an unpack. V = DAG.getBitcast(VT, D.getOperand(0)); return DAG.getNode(MappedMask[0] == 0 ? X86ISD::UNPCKL Index: llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp =================================================================== --- llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp +++ llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp @@ -841,7 +841,7 @@ auto V1 = II.getArgOperand(0); auto V2 = Constant::getNullValue(VecTy); - return Builder.CreateShuffleVector(V1, V2, makeArrayRef(Indexes, NumElts)); + return Builder.CreateShuffleVector(V1, V2, ArrayRef(Indexes, NumElts)); } /// Attempt to convert vpermilvar* to shufflevector if the mask is constant. @@ -888,7 +888,7 @@ } auto V1 = II.getArgOperand(0); - return Builder.CreateShuffleVector(V1, makeArrayRef(Indexes, NumElts)); + return Builder.CreateShuffleVector(V1, ArrayRef(Indexes, NumElts)); } /// Attempt to convert vpermd/vpermps to shufflevector if the mask is constant. @@ -922,7 +922,7 @@ } auto V1 = II.getArgOperand(0); - return Builder.CreateShuffleVector(V1, makeArrayRef(Indexes, Size)); + return Builder.CreateShuffleVector(V1, ArrayRef(Indexes, Size)); } std::optional Index: llvm/lib/Target/X86/X86InstrFMA3Info.cpp =================================================================== --- llvm/lib/Target/X86/X86InstrFMA3Info.cpp +++ llvm/lib/Target/X86/X86InstrFMA3Info.cpp @@ -158,11 +158,11 @@ ArrayRef Table; if (TSFlags & X86II::EVEX_RC) - Table = makeArrayRef(RoundGroups); + Table = ArrayRef(RoundGroups); else if (TSFlags & X86II::EVEX_B) - Table = makeArrayRef(BroadcastGroups); + Table = ArrayRef(BroadcastGroups); else - Table = makeArrayRef(Groups); + Table = ArrayRef(Groups); // FMA 132 instructions have an opcode of 0x96-0x9F // FMA 213 instructions have an opcode of 0xA6-0xAF Index: llvm/lib/Target/X86/X86InstrFoldTables.cpp =================================================================== --- llvm/lib/Target/X86/X86InstrFoldTables.cpp +++ llvm/lib/Target/X86/X86InstrFoldTables.cpp @@ -6101,15 +6101,15 @@ llvm::lookupFoldTable(unsigned RegOp, unsigned OpNum) { ArrayRef FoldTable; if (OpNum == 0) - FoldTable = makeArrayRef(MemoryFoldTable0); + FoldTable = ArrayRef(MemoryFoldTable0); else if (OpNum == 1) - FoldTable = makeArrayRef(MemoryFoldTable1); + FoldTable = ArrayRef(MemoryFoldTable1); else if (OpNum == 2) - FoldTable = makeArrayRef(MemoryFoldTable2); + FoldTable = ArrayRef(MemoryFoldTable2); else if (OpNum == 3) - FoldTable = makeArrayRef(MemoryFoldTable3); + FoldTable = ArrayRef(MemoryFoldTable3); else if (OpNum == 4) - FoldTable = makeArrayRef(MemoryFoldTable4); + FoldTable = ArrayRef(MemoryFoldTable4); else return nullptr; Index: llvm/lib/Target/X86/X86InstrInfo.cpp =================================================================== --- llvm/lib/Target/X86/X86InstrInfo.cpp +++ llvm/lib/Target/X86/X86InstrInfo.cpp @@ -9297,7 +9297,7 @@ {MO_TLVP_PIC_BASE, "x86-tlvp-pic-base"}, {MO_SECREL, "x86-secrel"}, {MO_COFFSTUB, "x86-coffstub"}}; - return makeArrayRef(TargetFlags); + return ArrayRef(TargetFlags); } namespace { Index: llvm/lib/Target/X86/X86InterleavedAccess.cpp =================================================================== --- llvm/lib/Target/X86/X86InterleavedAccess.cpp +++ llvm/lib/Target/X86/X86InterleavedAccess.cpp @@ -423,8 +423,8 @@ return; } - reorderSubVector(VT, TransposedMatrix, VecOut, makeArrayRef(Concat, 16), - NumOfElm, 4, Builder); + reorderSubVector(VT, TransposedMatrix, VecOut, ArrayRef(Concat, 16), NumOfElm, + 4, Builder); } // createShuffleStride returns shuffle mask of size N. @@ -534,7 +534,7 @@ for (unsigned j = 0; j < VecElems / 32; j++) for (int i = 0; i < 3; i++) Vec[i + j * 3] = Builder.CreateShuffleVector( - InVec[j * 6 + i], InVec[j * 6 + i + 3], makeArrayRef(Concat, 32)); + InVec[j * 6 + i], InVec[j * 6 + i + 3], ArrayRef(Concat, 32)); if (VecElems == 32) return; @@ -693,25 +693,25 @@ // dst = src1[0,1],src2[0,1] static constexpr int IntMask1[] = {0, 1, 4, 5}; - ArrayRef Mask = makeArrayRef(IntMask1, 4); + ArrayRef Mask = ArrayRef(IntMask1, 4); Value *IntrVec1 = Builder.CreateShuffleVector(Matrix[0], Matrix[2], Mask); Value *IntrVec2 = Builder.CreateShuffleVector(Matrix[1], Matrix[3], Mask); // dst = src1[2,3],src2[2,3] static constexpr int IntMask2[] = {2, 3, 6, 7}; - Mask = makeArrayRef(IntMask2, 4); + Mask = ArrayRef(IntMask2, 4); Value *IntrVec3 = Builder.CreateShuffleVector(Matrix[0], Matrix[2], Mask); Value *IntrVec4 = Builder.CreateShuffleVector(Matrix[1], Matrix[3], Mask); // dst = src1[0],src2[0],src1[2],src2[2] static constexpr int IntMask3[] = {0, 4, 2, 6}; - Mask = makeArrayRef(IntMask3, 4); + Mask = ArrayRef(IntMask3, 4); TransposedMatrix[0] = Builder.CreateShuffleVector(IntrVec1, IntrVec2, Mask); TransposedMatrix[2] = Builder.CreateShuffleVector(IntrVec3, IntrVec4, Mask); // dst = src1[1],src2[1],src1[3],src2[3] static constexpr int IntMask4[] = {1, 5, 3, 7}; - Mask = makeArrayRef(IntMask4, 4); + Mask = ArrayRef(IntMask4, 4); TransposedMatrix[1] = Builder.CreateShuffleVector(IntrVec1, IntrVec2, Mask); TransposedMatrix[3] = Builder.CreateShuffleVector(IntrVec3, IntrVec4, Mask); } @@ -841,7 +841,7 @@ for (unsigned i = 0; i < Factor; i++) Indices.push_back(Mask[i]); - ArrayRef Shuffles = makeArrayRef(SVI); + ArrayRef Shuffles = ArrayRef(SVI); // Create an interleaved access group. IRBuilder<> Builder(SI); Index: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp =================================================================== --- llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp +++ llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp @@ -441,7 +441,7 @@ Value *SubVecB = B.CreateBitCast(EltB, V2I16Ty); Value *ZeroV2I16 = Constant::getNullValue(V2I16Ty); int ShuffleMask[4] = {2, 0, 3, 1}; - auto ShuffleArray = makeArrayRef(ShuffleMask); + auto ShuffleArray = ArrayRef(ShuffleMask); Value *AV2F32 = B.CreateBitCast( B.CreateShuffleVector(SubVecA, ZeroV2I16, ShuffleArray), V2F32Ty); Value *BV2F32 = B.CreateBitCast( Index: llvm/lib/Target/X86/X86WinEHState.cpp =================================================================== --- llvm/lib/Target/X86/X86WinEHState.cpp +++ llvm/lib/Target/X86/X86WinEHState.cpp @@ -389,10 +389,10 @@ Type *ArgTys[5] = {Int8PtrType, Int8PtrType, Int8PtrType, Int8PtrType, Int8PtrType}; FunctionType *TrampolineTy = - FunctionType::get(Int32Ty, makeArrayRef(&ArgTys[0], 4), + FunctionType::get(Int32Ty, ArrayRef(&ArgTys[0], 4), /*isVarArg=*/false); FunctionType *TargetFuncTy = - FunctionType::get(Int32Ty, makeArrayRef(&ArgTys[0], 5), + FunctionType::get(Int32Ty, ArrayRef(&ArgTys[0], 5), /*isVarArg=*/false); Function *Trampoline = Function::Create(TrampolineTy, GlobalValue::InternalLinkage, Index: llvm/lib/Transforms/IPO/LowerTypeTests.cpp =================================================================== --- llvm/lib/Transforms/IPO/LowerTypeTests.cpp +++ llvm/lib/Transforms/IPO/LowerTypeTests.cpp @@ -309,7 +309,7 @@ } ArrayRef types() const { - return makeArrayRef(getTrailingObjects(), NTypes); + return ArrayRef(getTrailingObjects(), NTypes); } }; @@ -331,7 +331,7 @@ CallInst *CI; ArrayRef targets() const { - return makeArrayRef(getTrailingObjects(), NTargets); + return ArrayRef(getTrailingObjects(), NTargets); } unsigned UniqueId; Index: llvm/lib/Transforms/IPO/MergeFunctions.cpp =================================================================== --- llvm/lib/Transforms/IPO/MergeFunctions.cpp +++ llvm/lib/Transforms/IPO/MergeFunctions.cpp @@ -493,12 +493,11 @@ assert(SrcTy->getStructNumElements() == DestTy->getStructNumElements()); Value *Result = PoisonValue::get(DestTy); for (unsigned int I = 0, E = SrcTy->getStructNumElements(); I < E; ++I) { - Value *Element = createCast( - Builder, Builder.CreateExtractValue(V, makeArrayRef(I)), - DestTy->getStructElementType(I)); + Value *Element = + createCast(Builder, Builder.CreateExtractValue(V, ArrayRef(I)), + DestTy->getStructElementType(I)); - Result = - Builder.CreateInsertValue(Result, Element, makeArrayRef(I)); + Result = Builder.CreateInsertValue(Result, Element, ArrayRef(I)); } return Result; } Index: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp =================================================================== --- llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -727,7 +727,7 @@ auto *V1 = II.getArgOperand(0); auto *V2 = Constant::getNullValue(V1->getType()); - return Builder.CreateShuffleVector(V1, V2, makeArrayRef(Indexes)); + return Builder.CreateShuffleVector(V1, V2, ArrayRef(Indexes)); } // Returns true iff the 2 intrinsics have the same operands, limiting the Index: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp =================================================================== --- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -631,8 +631,8 @@ // Cast base to the expected type. Value *NewVal = Builder.CreateBitOrPointerCast( Base, PtrTy, Start->getName() + "to.ptr"); - NewVal = Builder.CreateInBoundsGEP( - ElemTy, NewVal, makeArrayRef(NewInsts[Val]), Val->getName() + ".ptr"); + NewVal = Builder.CreateInBoundsGEP(ElemTy, NewVal, ArrayRef(NewInsts[Val]), + Val->getName() + ".ptr"); NewVal = Builder.CreateBitOrPointerCast( NewVal, Val->getType(), Val->getName() + ".conv"); Val->replaceAllUsesWith(NewVal); Index: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp =================================================================== --- llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -666,7 +666,7 @@ Zero, ConstantInt::get(IdxType, i), }; - auto *Ptr = IC.Builder.CreateInBoundsGEP(ST, Addr, makeArrayRef(Indices), + auto *Ptr = IC.Builder.CreateInBoundsGEP(ST, Addr, ArrayRef(Indices), Name + ".elt"); auto *L = IC.Builder.CreateAlignedLoad( ST->getElementType(i), Ptr, @@ -712,7 +712,7 @@ Zero, ConstantInt::get(IdxType, i), }; - auto *Ptr = IC.Builder.CreateInBoundsGEP(AT, Addr, makeArrayRef(Indices), + auto *Ptr = IC.Builder.CreateInBoundsGEP(AT, Addr, ArrayRef(Indices), Name + ".elt"); auto *L = IC.Builder.CreateAlignedLoad(AT->getElementType(), Ptr, commonAlignment(Align, Offset), @@ -1192,8 +1192,8 @@ Zero, ConstantInt::get(IdxType, i), }; - auto *Ptr = IC.Builder.CreateInBoundsGEP(ST, Addr, makeArrayRef(Indices), - AddrName); + auto *Ptr = + IC.Builder.CreateInBoundsGEP(ST, Addr, ArrayRef(Indices), AddrName); auto *Val = IC.Builder.CreateExtractValue(V, i, EltName); auto EltAlign = commonAlignment(Align, SL->getElementOffset(i)); llvm::Instruction *NS = IC.Builder.CreateAlignedStore(Val, Ptr, EltAlign); @@ -1238,8 +1238,8 @@ Zero, ConstantInt::get(IdxType, i), }; - auto *Ptr = IC.Builder.CreateInBoundsGEP(AT, Addr, makeArrayRef(Indices), - AddrName); + auto *Ptr = + IC.Builder.CreateInBoundsGEP(AT, Addr, ArrayRef(Indices), AddrName); auto *Val = IC.Builder.CreateExtractValue(V, i, EltName); auto EltAlign = commonAlignment(Align, Offset); Instruction *NS = IC.Builder.CreateAlignedStore(Val, Ptr, EltAlign); Index: llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp =================================================================== --- llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp @@ -605,7 +605,7 @@ Value *Base = FixedOperands[0]; GetElementPtrInst *NewGEP = GetElementPtrInst::Create(FirstInst->getSourceElementType(), Base, - makeArrayRef(FixedOperands).slice(1)); + ArrayRef(FixedOperands).slice(1)); if (AllInBounds) NewGEP->setIsInBounds(); PHIArgMergedDebugLoc(NewGEP, PN); return NewGEP; Index: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp =================================================================== --- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -3386,7 +3386,7 @@ Value *NewEV = Builder.CreateExtractValue(IV->getAggregateOperand(), EV.getIndices()); return InsertValueInst::Create(NewEV, IV->getInsertedValueOperand(), - makeArrayRef(insi, inse)); + ArrayRef(insi, inse)); } if (insi == inse) // The insert list is a prefix of the extract list @@ -3398,7 +3398,7 @@ // with // %E extractvalue { i32 } { i32 42 }, 0 return ExtractValueInst::Create(IV->getInsertedValueOperand(), - makeArrayRef(exti, exte)); + ArrayRef(exti, exte)); } if (Instruction *R = foldExtractOfOverflowIntrinsic(EV)) Index: llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp =================================================================== --- llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp +++ llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp @@ -395,7 +395,7 @@ return AttributeList::get(Ctx, CallSiteAttrs.getFnAttrs(), CallSiteAttrs.getRetAttrs(), - llvm::makeArrayRef(ArgumentAttributes)); + llvm::ArrayRef(ArgumentAttributes)); } class DataFlowSanitizer { @@ -3197,7 +3197,7 @@ (int)AtomicOrderingCABI::seq_cst; return ConstantDataVector::get(IRB.getContext(), - makeArrayRef(OrderingTable, NumOrderings)); + ArrayRef(OrderingTable, NumOrderings)); } void DFSanVisitor::visitLibAtomicLoad(CallBase &CB) { @@ -3242,7 +3242,7 @@ (int)AtomicOrderingCABI::seq_cst; return ConstantDataVector::get(IRB.getContext(), - makeArrayRef(OrderingTable, NumOrderings)); + ArrayRef(OrderingTable, NumOrderings)); } void DFSanVisitor::visitLibAtomicStore(CallBase &CB) { Index: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp =================================================================== --- llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp +++ llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp @@ -599,7 +599,7 @@ #include "llvm/ProfileData/InstrProfData.inc" }; auto *ValueProfilingCallTy = - FunctionType::get(ReturnTy, makeArrayRef(ParamTypes), false); + FunctionType::get(ReturnTy, ArrayRef(ParamTypes), false); StringRef FuncName = CallType == ValueProfilingCallType::Default ? getInstrProfValueProfFuncName() : getInstrProfValueProfMemOpFuncName(); @@ -1012,7 +1012,7 @@ #define INSTR_PROF_DATA(Type, LLVMType, Name, Init) LLVMType, #include "llvm/ProfileData/InstrProfData.inc" }; - auto *DataTy = StructType::get(Ctx, makeArrayRef(DataTypes)); + auto *DataTy = StructType::get(Ctx, ArrayRef(DataTypes)); Constant *FunctionAddr = shouldRecordFunctionAddr(Fn) ? ConstantExpr::getBitCast(Fn, Int8PtrTy) @@ -1108,7 +1108,7 @@ #define INSTR_PROF_VALUE_NODE(Type, LLVMType, Name, Init) LLVMType, #include "llvm/ProfileData/InstrProfData.inc" }; - auto *VNodeTy = StructType::get(Ctx, makeArrayRef(VNodeTypes)); + auto *VNodeTy = StructType::get(Ctx, ArrayRef(VNodeTypes)); ArrayType *VNodesTy = ArrayType::get(VNodeTy, NumCounters); auto *VNodesVar = new GlobalVariable( @@ -1185,7 +1185,7 @@ if (NamesVar) { Type *ParamTypes[] = {VoidPtrTy, Int64Ty}; auto *NamesRegisterTy = - FunctionType::get(VoidTy, makeArrayRef(ParamTypes), false); + FunctionType::get(VoidTy, ArrayRef(ParamTypes), false); auto *NamesRegisterF = Function::Create(NamesRegisterTy, GlobalVariable::ExternalLinkage, getInstrProfNamesRegFuncName(), M); Index: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp =================================================================== --- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -2066,7 +2066,7 @@ (int)AtomicOrderingCABI::seq_cst; return ConstantDataVector::get(IRB.getContext(), - makeArrayRef(OrderingTable, NumOrderings)); + ArrayRef(OrderingTable, NumOrderings)); } AtomicOrdering addAcquireOrdering(AtomicOrdering a) { @@ -2101,7 +2101,7 @@ (int)AtomicOrderingCABI::seq_cst; return ConstantDataVector::get(IRB.getContext(), - makeArrayRef(OrderingTable, NumOrderings)); + ArrayRef(OrderingTable, NumOrderings)); } // ------------------- Visitors. @@ -2958,7 +2958,7 @@ Value *Op = I.getArgOperand(0); Type *OpType = Op->getType(); Function *BswapFunc = Intrinsic::getDeclaration( - F.getParent(), Intrinsic::bswap, makeArrayRef(&OpType, 1)); + F.getParent(), Intrinsic::bswap, ArrayRef(&OpType, 1)); setShadow(&I, IRB.CreateCall(BswapFunc, getShadow(Op))); setOrigin(&I, getOrigin(Op)); } Index: llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp =================================================================== --- llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp +++ llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp @@ -1538,7 +1538,7 @@ auto NewBlocksEnd = std::remove(std::begin(NewBlocks), std::end(NewBlocks), nullptr); - addToParentLoopIfNeeded(makeArrayRef(std::begin(NewBlocks), NewBlocksEnd)); + addToParentLoopIfNeeded(ArrayRef(std::begin(NewBlocks), NewBlocksEnd)); DT.recalculate(F); Index: llvm/lib/Transforms/Scalar/LoopDeletion.cpp =================================================================== --- llvm/lib/Transforms/Scalar/LoopDeletion.cpp +++ llvm/lib/Transforms/Scalar/LoopDeletion.cpp @@ -82,7 +82,7 @@ // blocks, then it is impossible to statically determine which value // should be used. AllOutgoingValuesSame = - all_of(makeArrayRef(ExitingBlocks).slice(1), [&](BasicBlock *BB) { + all_of(ArrayRef(ExitingBlocks).slice(1), [&](BasicBlock *BB) { return incoming == P.getIncomingValueForBlock(BB); }); Index: llvm/lib/Transforms/Scalar/LoopSink.cpp =================================================================== --- llvm/lib/Transforms/Scalar/LoopSink.cpp +++ llvm/lib/Transforms/Scalar/LoopSink.cpp @@ -215,7 +215,7 @@ BasicBlock *MoveBB = *SortedBBsToSinkInto.begin(); // FIXME: Optimize the efficiency for cloned value replacement. The current // implementation is O(SortedBBsToSinkInto.size() * I.num_uses()). - for (BasicBlock *N : makeArrayRef(SortedBBsToSinkInto).drop_front(1)) { + for (BasicBlock *N : ArrayRef(SortedBBsToSinkInto).drop_front(1)) { assert(LoopBlockNumber.find(N)->second > LoopBlockNumber.find(MoveBB)->second && "BBs not sorted!"); Index: llvm/lib/Transforms/Scalar/NewGVN.cpp =================================================================== --- llvm/lib/Transforms/Scalar/NewGVN.cpp +++ llvm/lib/Transforms/Scalar/NewGVN.cpp @@ -1200,10 +1200,9 @@ if (auto Simplified = checkExprResults(E, I, V)) return Simplified; } else if (auto *GEPI = dyn_cast(I)) { - Value *V = - simplifyGEPInst(GEPI->getSourceElementType(), *E->op_begin(), - makeArrayRef(std::next(E->op_begin()), E->op_end()), - GEPI->isInBounds(), Q); + Value *V = simplifyGEPInst(GEPI->getSourceElementType(), *E->op_begin(), + ArrayRef(std::next(E->op_begin()), E->op_end()), + GEPI->isInBounds(), Q); if (auto Simplified = checkExprResults(E, I, V)) return Simplified; } else if (AllConstant) { Index: llvm/lib/Transforms/Scalar/SROA.cpp =================================================================== --- llvm/lib/Transforms/Scalar/SROA.cpp +++ llvm/lib/Transforms/Scalar/SROA.cpp @@ -4079,7 +4079,7 @@ // Try to build up a sub-structure. StructType *SubTy = - StructType::get(STy->getContext(), makeArrayRef(EI, EE), STy->isPacked()); + StructType::get(STy->getContext(), ArrayRef(EI, EE), STy->isPacked()); const StructLayout *SubSL = DL.getStructLayout(SubTy); if (Size != SubSL->getSizeInBytes()) return nullptr; // The sub-struct doesn't have quite the size needed. Index: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp =================================================================== --- llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -1572,7 +1572,7 @@ // We need a stable insertion order. We use the order of the original loop // order and map into the correct parent loop. for (auto *BB : llvm::concat( - makeArrayRef(ClonedPH), ClonedLoopBlocks, ClonedExitsInLoops)) + ArrayRef(ClonedPH), ClonedLoopBlocks, ClonedExitsInLoops)) if (Loop *OuterL = ExitLoopMap.lookup(BB)) OuterL->addBasicBlockToLoop(BB, LI); @@ -2206,8 +2206,8 @@ // some *other* successor with a single data structure. We use this to // significantly reduce cloning. SmallDenseMap DominatingSucc; - for (auto *SuccBB : llvm::concat( - makeArrayRef(RetainedSuccBB), UnswitchedSuccBBs)) + for (auto *SuccBB : llvm::concat(ArrayRef(RetainedSuccBB), + UnswitchedSuccBBs)) if (SuccBB->getUniquePredecessor() || llvm::all_of(predecessors(SuccBB), [&](BasicBlock *PredBB) { return PredBB == ParentBB || DT.dominates(SuccBB, PredBB); Index: llvm/lib/Transforms/Utils/ModuleUtils.cpp =================================================================== --- llvm/lib/Transforms/Utils/ModuleUtils.cpp +++ llvm/lib/Transforms/Utils/ModuleUtils.cpp @@ -52,7 +52,7 @@ CSVals[2] = Data ? ConstantExpr::getPointerCast(Data, IRB.getInt8PtrTy()) : Constant::getNullValue(IRB.getInt8PtrTy()); Constant *RuntimeCtorInit = - ConstantStruct::get(EltTy, makeArrayRef(CSVals, EltTy->getNumElements())); + ConstantStruct::get(EltTy, ArrayRef(CSVals, EltTy->getNumElements())); CurrentCtors.push_back(RuntimeCtorInit); @@ -323,7 +323,7 @@ StringRef SectionName, Align Alignment) { // Embed the memory buffer into the module. Constant *ModuleConstant = ConstantDataArray::get( - M.getContext(), makeArrayRef(Buf.getBufferStart(), Buf.getBufferSize())); + M.getContext(), ArrayRef(Buf.getBufferStart(), Buf.getBufferSize())); GlobalVariable *GV = new GlobalVariable( M, ModuleConstant->getType(), true, GlobalValue::PrivateLinkage, ModuleConstant, "llvm.embedded.object"); Index: llvm/lib/Transforms/Utils/SCCPSolver.cpp =================================================================== --- llvm/lib/Transforms/Utils/SCCPSolver.cpp +++ llvm/lib/Transforms/Utils/SCCPSolver.cpp @@ -1377,7 +1377,7 @@ } Constant *Ptr = Operands[0]; - auto Indices = makeArrayRef(Operands.begin() + 1, Operands.end()); + auto Indices = ArrayRef(Operands.begin() + 1, Operands.end()); Constant *C = ConstantExpr::getGetElementPtr(I.getSourceElementType(), Ptr, Indices); markConstant(&I, C); Index: llvm/lib/Transforms/Utils/ValueMapper.cpp =================================================================== --- llvm/lib/Transforms/Utils/ValueMapper.cpp +++ llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -880,7 +880,7 @@ AppendingInits.resize(PrefixSize); mapAppendingVariable(*E.Data.AppendingGV.GV, E.Data.AppendingGV.InitPrefix, - E.AppendingGVIsOldCtorDtor, makeArrayRef(NewInits)); + E.AppendingGVIsOldCtorDtor, ArrayRef(NewInits)); break; } case WorklistEntry::MapAliasOrIFunc: { Index: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp =================================================================== --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -3947,7 +3947,7 @@ auto *It = ResOrder.begin(); for (unsigned K = 0; K < VF; K += Sz) { OrdersType CurrentOrder(TE.ReorderIndices); - SmallVector SubMask(makeArrayRef(ReusedMask).slice(K, Sz)); + SmallVector SubMask{ArrayRef(ReusedMask).slice(K, Sz)}; if (SubMask.front() == UndefMaskElem) std::iota(SubMask.begin(), SubMask.end(), 0); reorderOrder(CurrentOrder, SubMask); @@ -4083,7 +4083,7 @@ // Clear reorder since it is going to be applied to the new mask. TE.ReorderIndices.clear(); // Try to improve gathered nodes with clustered reuses, if possible. - reorderScalars(TE.Scalars, makeArrayRef(NewMask).slice(0, Sz)); + reorderScalars(TE.Scalars, ArrayRef(NewMask).slice(0, Sz)); // Fill the reuses mask with the identity submasks. for (auto *It = TE.ReuseShuffleIndices.begin(), *End = TE.ReuseShuffleIndices.end(); @@ -8849,8 +8849,8 @@ if (E->State != TreeEntry::NeedToGather && E->getOpcode() == Instruction::Store) { ArrayRef Mask = - makeArrayRef(reinterpret_cast(E->ReorderIndices.begin()), - E->ReorderIndices.size()); + ArrayRef(reinterpret_cast(E->ReorderIndices.begin()), + E->ReorderIndices.size()); ShuffleBuilder.add(V, Mask); } else { ShuffleBuilder.addOrdered(V, E->ReorderIndices); @@ -11233,7 +11233,7 @@ unsigned StartIdx = 0; for (unsigned Size = MaxVF; Size >= MinVF; Size /= 2) { for (unsigned Cnt = StartIdx, E = Operands.size(); Cnt + Size <= E;) { - ArrayRef Slice = makeArrayRef(Operands).slice(Cnt, Size); + ArrayRef Slice = ArrayRef(Operands).slice(Cnt, Size); if (!VectorizedStores.count(Slice.front()) && !VectorizedStores.count(Slice.back()) && vectorizeStoreChain(Slice, R, Cnt, MinVF)) { @@ -12506,7 +12506,7 @@ continue; unsigned NumOps = VectorizedVals.lookup(RdxVal); for (Instruction *RedOp : - makeArrayRef(ReducedValsToOps.find(RdxVal)->second) + ArrayRef(ReducedValsToOps.find(RdxVal)->second) .drop_back(NumOps)) ExtraReductions.emplace_back(RedOp, RdxVal); } @@ -13004,7 +13004,7 @@ // same/alternate ops only, this may result in some extra final // vectorization. if (NumElts > 1 && - TryToVectorizeHelper(makeArrayRef(IncIt, NumElts), LimitForRegisterSize)) { + TryToVectorizeHelper(ArrayRef(IncIt, NumElts), LimitForRegisterSize)) { // Success start over because instructions might have been changed. Changed = true; } else if (NumElts < Limit(*IncIt) && @@ -13026,8 +13026,9 @@ while (SameTypeIt != End && AreCompatible(*SameTypeIt, *It)) ++SameTypeIt; unsigned NumElts = (SameTypeIt - It); - if (NumElts > 1 && TryToVectorizeHelper(makeArrayRef(It, NumElts), - /*LimitForRegisterSize=*/false)) + if (NumElts > 1 && + TryToVectorizeHelper(ArrayRef(It, NumElts), + /*LimitForRegisterSize=*/false)) Changed = true; It = SameTypeIt; } Index: llvm/tools/dsymutil/MachOUtils.cpp =================================================================== --- llvm/tools/dsymutil/MachOUtils.cpp +++ llvm/tools/dsymutil/MachOUtils.cpp @@ -56,7 +56,7 @@ } static bool runLipo(StringRef SDKPath, SmallVectorImpl &Args) { - auto Path = sys::findProgramByName("lipo", makeArrayRef(SDKPath)); + auto Path = sys::findProgramByName("lipo", ArrayRef(SDKPath)); if (!Path) Path = sys::findProgramByName("lipo"); Index: llvm/tools/dsymutil/dsymutil.cpp =================================================================== --- llvm/tools/dsymutil/dsymutil.cpp +++ llvm/tools/dsymutil/dsymutil.cpp @@ -557,7 +557,7 @@ DsymutilOptTable T; unsigned MAI; unsigned MAC; - ArrayRef ArgsArr = makeArrayRef(argv + 1, argc - 1); + ArrayRef ArgsArr = ArrayRef(argv + 1, argc - 1); opt::InputArgList Args = T.ParseArgs(ArgsArr, MAI, MAC); void *P = (void *)(intptr_t)getOutputFileName; Index: llvm/tools/llvm-ar/llvm-ar.cpp =================================================================== --- llvm/tools/llvm-ar/llvm-ar.cpp +++ llvm/tools/llvm-ar/llvm-ar.cpp @@ -1330,7 +1330,7 @@ SmallVector Argv(argv + 1, argv + argc); StringSaver Saver(Alloc); - cl::ExpandResponseFiles(Saver, getRspQuoting(makeArrayRef(argv, argc)), Argv); + cl::ExpandResponseFiles(Saver, getRspQuoting(ArrayRef(argv, argc)), Argv); // Get BitMode from enviorment variable "OBJECT_MODE" for AIX OS, if // specified. @@ -1473,11 +1473,11 @@ }; if (Is("dlltool")) - return dlltoolDriverMain(makeArrayRef(argv, argc)); + return dlltoolDriverMain(ArrayRef(argv, argc)); if (Is("ranlib")) return ranlib_main(argc, argv); if (Is("lib")) - return libDriverMain(makeArrayRef(argv, argc)); + return libDriverMain(ArrayRef(argv, argc)); if (Is("ar")) return ar_main(argc, argv); Index: llvm/tools/llvm-cvtres/llvm-cvtres.cpp =================================================================== --- llvm/tools/llvm-cvtres/llvm-cvtres.cpp +++ llvm/tools/llvm-cvtres/llvm-cvtres.cpp @@ -121,7 +121,7 @@ CvtResOptTable T; unsigned MAI, MAC; - ArrayRef ArgsArr = makeArrayRef(Argv + 1, Argc - 1); + ArrayRef ArgsArr = ArrayRef(Argv + 1, Argc - 1); opt::InputArgList InputArgs = T.ParseArgs(ArgsArr, MAI, MAC); if (InputArgs.hasArg(OPT_HELP)) { Index: llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp =================================================================== --- llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp +++ llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp @@ -234,8 +234,8 @@ // Complete object locators in the MS-ABI start with '??_R4' else if (SymName.startswith("??_R4")) { CompleteObjectLocator COL; - COL.Data = makeArrayRef( - reinterpret_cast(SymContents.data()), 3); + COL.Data = + ArrayRef(reinterpret_cast(SymContents.data()), 3); StringRef *I = std::begin(COL.Symbols), *E = std::end(COL.Symbols); collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I, E); COLs[SymName] = COL; @@ -243,8 +243,8 @@ // Class hierarchy descriptors in the MS-ABI start with '??_R3' else if (SymName.startswith("??_R3")) { ClassHierarchyDescriptor CHD; - CHD.Data = makeArrayRef( - reinterpret_cast(SymContents.data()), 3); + CHD.Data = + ArrayRef(reinterpret_cast(SymContents.data()), 3); StringRef *I = std::begin(CHD.Symbols), *E = std::end(CHD.Symbols); collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I, E); CHDs[SymName] = CHD; @@ -259,7 +259,7 @@ // Base class descriptors in the MS-ABI start with '??_R1' else if (SymName.startswith("??_R1")) { BaseClassDescriptor BCD; - BCD.Data = makeArrayRef( + BCD.Data = ArrayRef( reinterpret_cast(SymContents.data()) + 1, 5); StringRef *I = std::begin(BCD.Symbols), *E = std::end(BCD.Symbols); collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I, E); Index: llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp =================================================================== --- llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp +++ llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp @@ -461,7 +461,7 @@ DwarfutilOptTable T; unsigned MAI; unsigned MAC; - ArrayRef ArgsArr = makeArrayRef(Argv + 1, Argc - 1); + ArrayRef ArgsArr = ArrayRef(Argv + 1, Argc - 1); opt::InputArgList Args = T.ParseArgs(ArgsArr, MAI, MAC); if (Args.hasArg(OPT_help) || Args.size() == 0) { Index: llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp =================================================================== --- llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp +++ llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp @@ -109,7 +109,7 @@ ExecutionMode::ALWAYS_PARALLEL_MISSING_USE_OR_DEF, ExecutionMode::PARALLEL_VIA_EXPLICIT_REGS, }; - return makeArrayRef(kAllExecutionModeBits); + return ArrayRef(kAllExecutionModeBits); } SmallVector getExecutionModeBits(ExecutionMode Execution) { Index: llvm/tools/llvm-exegesis/lib/X86/Target.cpp =================================================================== --- llvm/tools/llvm-exegesis/lib/X86/Target.cpp +++ llvm/tools/llvm-exegesis/lib/X86/Target.cpp @@ -713,12 +713,11 @@ ArrayRef getUnavailableRegisters() const override { if (DisableUpperSSERegisters) - return makeArrayRef(kUnavailableRegistersSSE, - sizeof(kUnavailableRegistersSSE) / - sizeof(kUnavailableRegistersSSE[0])); + return ArrayRef(kUnavailableRegistersSSE, + sizeof(kUnavailableRegistersSSE) / + sizeof(kUnavailableRegistersSSE[0])); - return makeArrayRef(kUnavailableRegisters, - std::size(kUnavailableRegisters)); + return ArrayRef(kUnavailableRegisters, std::size(kUnavailableRegisters)); } bool allowAsBackToBack(const Instruction &Instr) const override { Index: llvm/tools/llvm-lipo/llvm-lipo.cpp =================================================================== --- llvm/tools/llvm-lipo/llvm-lipo.cpp +++ llvm/tools/llvm-lipo/llvm-lipo.cpp @@ -729,7 +729,7 @@ llvm::InitializeAllTargetMCs(); llvm::InitializeAllAsmParsers(); - Config C = parseLipoOptions(makeArrayRef(argv + 1, argc - 1)); + Config C = parseLipoOptions(ArrayRef(argv + 1, argc - 1)); LLVMContext LLVMCtx; SmallVector, 1> InputBinaries = readInputBinaries(LLVMCtx, C.InputFiles); Index: llvm/tools/llvm-ml/llvm-ml.cpp =================================================================== --- llvm/tools/llvm-ml/llvm-ml.cpp +++ llvm/tools/llvm-ml/llvm-ml.cpp @@ -205,7 +205,7 @@ MLOptTable T; unsigned MissingArgIndex, MissingArgCount; - ArrayRef ArgsArr = makeArrayRef(Argv + 1, Argc - 1); + ArrayRef ArgsArr = ArrayRef(Argv + 1, Argc - 1); opt::InputArgList InputArgs = T.ParseArgs(ArgsArr, MissingArgIndex, MissingArgCount); Index: llvm/tools/llvm-mt/llvm-mt.cpp =================================================================== --- llvm/tools/llvm-mt/llvm-mt.cpp +++ llvm/tools/llvm-mt/llvm-mt.cpp @@ -87,7 +87,7 @@ CvtResOptTable T; unsigned MAI, MAC; - ArrayRef ArgsArr = makeArrayRef(Argv + 1, Argc - 1); + ArrayRef ArgsArr = ArrayRef(Argv + 1, Argc - 1); opt::InputArgList InputArgs = T.ParseArgs(ArgsArr, MAI, MAC); for (auto *Arg : InputArgs.filtered(OPT_INPUT)) { Index: llvm/tools/llvm-nm/llvm-nm.cpp =================================================================== --- llvm/tools/llvm-nm/llvm-nm.cpp +++ llvm/tools/llvm-nm/llvm-nm.cpp @@ -616,7 +616,7 @@ }; static const char *getDarwinStabString(uint8_t NType) { - for (auto I : makeArrayRef(DarwinStabNames)) + for (auto I : ArrayRef(DarwinStabNames)) if (I.NType == NType) return I.Name; return nullptr; Index: llvm/tools/llvm-objcopy/ObjcopyOptions.cpp =================================================================== --- llvm/tools/llvm-objcopy/ObjcopyOptions.cpp +++ llvm/tools/llvm-objcopy/ObjcopyOptions.cpp @@ -241,7 +241,7 @@ if (NameAndFlags.size() > 1) { Expected ParsedFlagSet = - parseSectionFlagSet(makeArrayRef(NameAndFlags).drop_front()); + parseSectionFlagSet(ArrayRef(NameAndFlags).drop_front()); if (!ParsedFlagSet) return ParsedFlagSet.takeError(); SR.NewFlags = *ParsedFlagSet; @@ -575,7 +575,7 @@ const char *const *DashDash = llvm::find_if(RawArgsArr, [](StringRef Str) { return Str == "--"; }); - ArrayRef ArgsArr = makeArrayRef(RawArgsArr.begin(), DashDash); + ArrayRef ArgsArr = ArrayRef(RawArgsArr.begin(), DashDash); if (DashDash != RawArgsArr.end()) DashDash = std::next(DashDash); @@ -1231,7 +1231,7 @@ function_ref ErrorCallback) { const char *const *DashDash = llvm::find_if(RawArgsArr, [](StringRef Str) { return Str == "--"; }); - ArrayRef ArgsArr = makeArrayRef(RawArgsArr.begin(), DashDash); + ArrayRef ArgsArr = ArrayRef(RawArgsArr.begin(), DashDash); if (DashDash != RawArgsArr.end()) DashDash = std::next(DashDash); Index: llvm/tools/llvm-objcopy/llvm-objcopy.cpp =================================================================== --- llvm/tools/llvm-objcopy/llvm-objcopy.cpp +++ llvm/tools/llvm-objcopy/llvm-objcopy.cpp @@ -240,7 +240,7 @@ : cl::TokenizeGNUCommandLine, NewArgv); - auto Args = makeArrayRef(NewArgv).drop_front(); + auto Args = ArrayRef(NewArgv).drop_front(); Expected DriverConfig = getDriverConfig(Args); if (!DriverConfig) { Index: llvm/tools/llvm-objdump/COFFDump.cpp =================================================================== --- llvm/tools/llvm-objdump/COFFDump.cpp +++ llvm/tools/llvm-objdump/COFFDump.cpp @@ -102,7 +102,7 @@ }; printU16("Magic", Hdr.Magic, "%04x"); - printOptionalEnumName(Hdr.Magic, makeArrayRef(PEHeaderMagic)); + printOptionalEnumName(Hdr.Magic, ArrayRef(PEHeaderMagic)); outs() << '\n'; print("MajorLinkerVersion", Hdr.MajorLinkerVersion); print("MinorLinkerVersion", Hdr.MinorLinkerVersion); @@ -127,7 +127,7 @@ printU32("SizeOfHeaders", Hdr.SizeOfHeaders, "%08x\n"); printU32("CheckSum", Hdr.CheckSum, "%08x\n"); printU16("Subsystem", Hdr.Subsystem, "%08x"); - printOptionalEnumName(Hdr.Subsystem, makeArrayRef(PEWindowsSubsystem)); + printOptionalEnumName(Hdr.Subsystem, ArrayRef(PEWindowsSubsystem)); outs() << '\n'; printU16("DllCharacteristics", Hdr.DLLCharacteristics, "%08x\n"); @@ -309,7 +309,7 @@ << " remaining in buffer"; return ; } - printUnwindCode(makeArrayRef(I, E)); + printUnwindCode(ArrayRef(I, E)); I += UsedSlots; } } @@ -655,7 +655,7 @@ if (UI->NumCodes) outs() << " Unwind Codes:\n"; - printAllUnwindCodes(makeArrayRef(&UI->UnwindCodes[0], UI->NumCodes)); + printAllUnwindCodes(ArrayRef(&UI->UnwindCodes[0], UI->NumCodes)); outs() << "\n"; outs().flush(); Index: llvm/tools/llvm-objdump/MachODump.cpp =================================================================== --- llvm/tools/llvm-objdump/MachODump.cpp +++ llvm/tools/llvm-objdump/MachODump.cpp @@ -255,19 +255,19 @@ case MachO::DICE_KIND_DATA: if (Length >= 4) { if (ShowRawInsn) - dumpBytes(makeArrayRef(bytes, 4), outs()); + dumpBytes(ArrayRef(bytes, 4), outs()); Value = bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; outs() << "\t.long " << Value; Size = 4; } else if (Length >= 2) { if (ShowRawInsn) - dumpBytes(makeArrayRef(bytes, 2), outs()); + dumpBytes(ArrayRef(bytes, 2), outs()); Value = bytes[1] << 8 | bytes[0]; outs() << "\t.short " << Value; Size = 2; } else { if (ShowRawInsn) - dumpBytes(makeArrayRef(bytes, 2), outs()); + dumpBytes(ArrayRef(bytes, 2), outs()); Value = bytes[0]; outs() << "\t.byte " << Value; Size = 1; @@ -279,14 +279,14 @@ break; case MachO::DICE_KIND_JUMP_TABLE8: if (ShowRawInsn) - dumpBytes(makeArrayRef(bytes, 1), outs()); + dumpBytes(ArrayRef(bytes, 1), outs()); Value = bytes[0]; outs() << "\t.byte " << format("%3u", Value) << "\t@ KIND_JUMP_TABLE8\n"; Size = 1; break; case MachO::DICE_KIND_JUMP_TABLE16: if (ShowRawInsn) - dumpBytes(makeArrayRef(bytes, 2), outs()); + dumpBytes(ArrayRef(bytes, 2), outs()); Value = bytes[1] << 8 | bytes[0]; outs() << "\t.short " << format("%5u", Value & 0xffff) << "\t@ KIND_JUMP_TABLE16\n"; @@ -295,7 +295,7 @@ case MachO::DICE_KIND_JUMP_TABLE32: case MachO::DICE_KIND_ABS_JUMP_TABLE32: if (ShowRawInsn) - dumpBytes(makeArrayRef(bytes, 4), outs()); + dumpBytes(ArrayRef(bytes, 4), outs()); Value = bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; outs() << "\t.long " << Value; if (Kind == MachO::DICE_KIND_JUMP_TABLE32) @@ -7916,7 +7916,7 @@ Annotations); if (gotInst) { if (ShowRawInsn || Arch == Triple::arm) { - dumpBytes(makeArrayRef(Bytes.data() + Index, Size), outs()); + dumpBytes(ArrayRef(Bytes.data() + Index, Size), outs()); } formatted_raw_ostream FormattedOS(outs()); StringRef AnnotationsStr = Annotations.str(); @@ -7997,7 +7997,7 @@ } if (ShowRawInsn || Arch == Triple::arm) { outs() << "\t"; - dumpBytes(makeArrayRef(Bytes.data() + Index, InstSize), outs()); + dumpBytes(ArrayRef(Bytes.data() + Index, InstSize), outs()); } StringRef AnnotationsStr = Annotations.str(); IP->printInst(&Inst, PC, AnnotationsStr, *STI, outs()); Index: llvm/tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- llvm/tools/llvm-objdump/llvm-objdump.cpp +++ llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -653,10 +653,10 @@ if (Bytes.size() >= 4) { // D should be casted to uint32_t here as it is passed by format to // snprintf as vararg. - for (uint32_t D : makeArrayRef( - reinterpret_cast(Bytes.data()), - Bytes.size() / 4)) - OS << format(" %08" PRIX32, D); + for (uint32_t D : + ArrayRef(reinterpret_cast(Bytes.data()), + Bytes.size() / 4)) + OS << format(" %08" PRIX32, D); } else { for (unsigned char B : Bytes) OS << format(" %02" PRIX8, B); Index: llvm/tools/llvm-rc/llvm-rc.cpp =================================================================== --- llvm/tools/llvm-rc/llvm-rc.cpp +++ llvm/tools/llvm-rc/llvm-rc.cpp @@ -740,10 +740,10 @@ char **DashDash = std::find_if(Argv + 1, Argv + Argc, [](StringRef Str) { return Str == "--"; }); - ArrayRef ArgsArr = makeArrayRef(Argv + 1, DashDash); + ArrayRef ArgsArr = ArrayRef(Argv + 1, DashDash); ArrayRef FileArgsArr; if (DashDash != Argv + Argc) - FileArgsArr = makeArrayRef(DashDash + 1, Argv + Argc); + FileArgsArr = ArrayRef(DashDash + 1, Argv + Argc); RcOptions Opts = getOptions(Argv[0], ArgsArr, FileArgsArr); Index: llvm/tools/llvm-readobj/ARMEHABIPrinter.h =================================================================== --- llvm/tools/llvm-readobj/ARMEHABIPrinter.h +++ llvm/tools/llvm-readobj/ARMEHABIPrinter.h @@ -91,7 +91,7 @@ {0xf8, 0xd0, &OpcodeDecoder::Decode_11010nnn}, {0xc0, 0xc0, &OpcodeDecoder::Decode_11xxxyyy}, }; - return makeArrayRef(Ring); + return ArrayRef(Ring); } inline void OpcodeDecoder::Decode_00xxxxxx(const uint8_t *Opcodes, Index: llvm/tools/llvm-readobj/COFFDumper.cpp =================================================================== --- llvm/tools/llvm-readobj/COFFDumper.cpp +++ llvm/tools/llvm-readobj/COFFDumper.cpp @@ -667,16 +667,15 @@ { DictScope D(W, "ImageFileHeader"); - W.printEnum ("Machine", Obj->getMachine(), - makeArrayRef(ImageFileMachineType)); + W.printEnum("Machine", Obj->getMachine(), ArrayRef(ImageFileMachineType)); W.printNumber("SectionCount", Obj->getNumberOfSections()); W.printHex ("TimeDateStamp", FormattedTime, Obj->getTimeDateStamp()); W.printHex ("PointerToSymbolTable", Obj->getPointerToSymbolTable()); W.printNumber("SymbolCount", Obj->getNumberOfSymbols()); W.printNumber("StringTableSize", Obj->getStringTableSize()); W.printNumber("OptionalHeaderSize", Obj->getSizeOfOptionalHeader()); - W.printFlags ("Characteristics", Obj->getCharacteristics(), - makeArrayRef(ImageFileCharacteristics)); + W.printFlags("Characteristics", Obj->getCharacteristics(), + ArrayRef(ImageFileCharacteristics)); } // Print PE header. This header does not exist if this is an object file and @@ -738,9 +737,9 @@ W.printNumber("SizeOfImage", Hdr->SizeOfImage); W.printNumber("SizeOfHeaders", Hdr->SizeOfHeaders); W.printHex ("CheckSum", Hdr->CheckSum); - W.printEnum ("Subsystem", Hdr->Subsystem, makeArrayRef(PEWindowsSubsystem)); - W.printFlags ("Characteristics", Hdr->DLLCharacteristics, - makeArrayRef(PEDLLCharacteristics)); + W.printEnum("Subsystem", Hdr->Subsystem, ArrayRef(PEWindowsSubsystem)); + W.printFlags("Characteristics", Hdr->DLLCharacteristics, + ArrayRef(PEDLLCharacteristics)); W.printNumber("SizeOfStackReserve", Hdr->SizeOfStackReserve); W.printNumber("SizeOfStackCommit", Hdr->SizeOfStackCommit); W.printNumber("SizeOfHeapReserve", Hdr->SizeOfHeapReserve); @@ -775,7 +774,7 @@ W.printHex("TimeDateStamp", FormattedTime, D.TimeDateStamp); W.printHex("MajorVersion", D.MajorVersion); W.printHex("MinorVersion", D.MinorVersion); - W.printEnum("Type", D.Type, makeArrayRef(ImageDebugType)); + W.printEnum("Type", D.Type, ArrayRef(ImageDebugType)); W.printHex("SizeOfData", D.SizeOfData); W.printHex("AddressOfRawData", D.AddressOfRawData); W.printHex("PointerToRawData", D.PointerToRawData); @@ -792,7 +791,7 @@ DictScope PDBScope(W, "PDBInfo"); W.printHex("PDBSignature", DebugInfo->Signature.CVSignature); if (DebugInfo->Signature.CVSignature == OMF::Signature::PDB70) { - W.printBinary("PDBGUID", makeArrayRef(DebugInfo->PDB70.Signature)); + W.printBinary("PDBGUID", ArrayRef(DebugInfo->PDB70.Signature)); W.printNumber("PDBAge", DebugInfo->PDB70.Age); W.printString("PDBFileName", PDBFileName); } @@ -808,7 +807,7 @@ // but that might change in the future uint16_t Characteristics = RawData[0]; W.printFlags("ExtendedCharacteristics", Characteristics, - makeArrayRef(PEExtendedDLLCharacteristics)); + ArrayRef(PEExtendedDLLCharacteristics)); } W.printBinaryBlock("RawData", RawData); } @@ -935,8 +934,7 @@ W.printHex("GuardCFCheckDispatch", Conf->GuardCFCheckDispatch); W.printHex("GuardCFFunctionTable", Conf->GuardCFFunctionTable); W.printNumber("GuardCFFunctionCount", Conf->GuardCFFunctionCount); - W.printFlags("GuardFlags", Conf->GuardFlags, - makeArrayRef(PELoadConfigGuardFlags), + W.printFlags("GuardFlags", Conf->GuardFlags, ArrayRef(PELoadConfigGuardFlags), (uint32_t)COFF::GuardFlags::CF_FUNCTION_TABLE_SIZE_MASK); Tables.GuardFidTableVA = Conf->GuardCFFunctionTable; @@ -1082,7 +1080,7 @@ W.printHex("IgnoredSubsectionKind", SubType); SubType &= ~SubsectionIgnoreFlag; } - W.printEnum("SubSectionType", SubType, makeArrayRef(SubSectionTypes)); + W.printEnum("SubSectionType", SubType, ArrayRef(SubSectionTypes)); W.printHex("SubSectionSize", SubSectionSize); // Get the contents of the subsection. @@ -1179,7 +1177,7 @@ W.printHex("MaxStackSize", FD.MaxStackSize); W.printHex("PrologSize", FD.PrologSize); W.printHex("SavedRegsSize", FD.SavedRegsSize); - W.printFlags("Flags", FD.Flags, makeArrayRef(FrameDataFlags)); + W.printFlags("Flags", FD.Flags, ArrayRef(FrameDataFlags)); // The FrameFunc string is a small RPN program. It can be broken up into // statements that end in the '=' operator, which assigns the value on @@ -1297,7 +1295,7 @@ W.printHex("Filename", Filename, FC.FileNameOffset); W.printHex("ChecksumSize", FC.Checksum.size()); W.printEnum("ChecksumKind", uint8_t(FC.Kind), - makeArrayRef(FileChecksumKindNames)); + ArrayRef(FileChecksumKindNames)); W.printBinary("ChecksumBytes", FC.Checksum); } @@ -1436,9 +1434,9 @@ W.printHex ("PointerToLineNumbers", Section->PointerToLinenumbers); W.printNumber("RelocationCount", Section->NumberOfRelocations); W.printNumber("LineNumberCount", Section->NumberOfLinenumbers); - W.printFlags ("Characteristics", Section->Characteristics, - makeArrayRef(ImageSectionCharacteristics), - COFF::SectionCharacteristics(0x00F00000)); + W.printFlags("Characteristics", Section->Characteristics, + ArrayRef(ImageSectionCharacteristics), + COFF::SectionCharacteristics(0x00F00000)); if (opts::SectionRelocations) { ListScope D(W, "Relocations"); @@ -1574,11 +1572,10 @@ W.printString("Name", SymbolName); W.printNumber("Value", Symbol.getValue()); W.printNumber("Section", SectionName, Symbol.getSectionNumber()); - W.printEnum ("BaseType", Symbol.getBaseType(), makeArrayRef(ImageSymType)); - W.printEnum ("ComplexType", Symbol.getComplexType(), - makeArrayRef(ImageSymDType)); - W.printEnum ("StorageClass", Symbol.getStorageClass(), - makeArrayRef(ImageSymClass)); + W.printEnum("BaseType", Symbol.getBaseType(), ArrayRef(ImageSymType)); + W.printEnum("ComplexType", Symbol.getComplexType(), ArrayRef(ImageSymDType)); + W.printEnum("StorageClass", Symbol.getStorageClass(), + ArrayRef(ImageSymClass)); W.printNumber("AuxSymbolCount", Symbol.getNumberOfAuxSymbols()); for (uint8_t I = 0; I < Symbol.getNumberOfAuxSymbols(); ++I) { @@ -1600,8 +1597,8 @@ DictScope AS(W, "AuxWeakExternal"); W.printNumber("Linked", getSymbolName(Aux->TagIndex), Aux->TagIndex); - W.printEnum ("Search", Aux->Characteristics, - makeArrayRef(WeakExternalCharacteristics)); + W.printEnum("Search", Aux->Characteristics, + ArrayRef(WeakExternalCharacteristics)); } else if (Symbol.isFileRecord()) { const char *FileName; @@ -1626,7 +1623,7 @@ W.printNumber("LineNumberCount", Aux->NumberOfLinenumbers); W.printHex("Checksum", Aux->CheckSum); W.printNumber("Number", AuxNumber); - W.printEnum("Selection", Aux->Selection, makeArrayRef(ImageCOMDATSelect)); + W.printEnum("Selection", Aux->Selection, ArrayRef(ImageCOMDATSelect)); if (Section && Section->Characteristics & COFF::IMAGE_SCN_LNK_COMDAT && Aux->Selection == COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE) { @@ -1682,7 +1679,7 @@ } default: W.printEnum("unsupported Image Machine", Obj->getMachine(), - makeArrayRef(ImageFileMachineType)); + ArrayRef(ImageFileMachineType)); break; } } @@ -1930,7 +1927,7 @@ std::copy(RawEntryNameString.begin(), RawEntryNameString.end(), EndianCorrectedNameString.begin() + 1); EndianCorrectedNameString[0] = UNI_UTF16_BYTE_ORDER_MARK_SWAPPED; - RawEntryNameString = makeArrayRef(EndianCorrectedNameString); + RawEntryNameString = ArrayRef(EndianCorrectedNameString); } std::string EntryNameString; if (!llvm::convertUTF16ToUTF8String(RawEntryNameString, EntryNameString)) @@ -2142,6 +2139,6 @@ W.printHex("AddressOfCallBacks", TlsTable->AddressOfCallBacks); W.printHex("SizeOfZeroFill", TlsTable->SizeOfZeroFill); W.printFlags("Characteristics", TlsTable->Characteristics, - makeArrayRef(ImageSectionCharacteristics), + ArrayRef(ImageSectionCharacteristics), COFF::SectionCharacteristics(COFF::IMAGE_SCN_ALIGN_MASK)); } Index: llvm/tools/llvm-readobj/ELFDumper.cpp =================================================================== --- llvm/tools/llvm-readobj/ELFDumper.cpp +++ llvm/tools/llvm-readobj/ELFDumper.cpp @@ -2317,7 +2317,7 @@ case DT_MIPS_XHASH: return FormatHexValue(Value); case DT_MIPS_FLAGS: - return FormatFlags(Value, makeArrayRef(ElfDynamicDTMipsFlags)); + return FormatFlags(Value, ArrayRef(ElfDynamicDTMipsFlags)); default: break; } @@ -2390,9 +2390,9 @@ .str(); } case DT_FLAGS: - return FormatFlags(Value, makeArrayRef(ElfDynamicDTFlags)); + return FormatFlags(Value, ArrayRef(ElfDynamicDTFlags)); case DT_FLAGS_1: - return FormatFlags(Value, makeArrayRef(ElfDynamicDTFlags1)); + return FormatFlags(Value, ArrayRef(ElfDynamicDTFlags1)); default: return FormatHexValue(Value); } @@ -3297,7 +3297,7 @@ auto It = llvm::find_if(ElfObjectFileType, [&](const EnumEntry &E) { return E.Value == Type; }); - if (It != makeArrayRef(ElfObjectFileType).end()) + if (It != ArrayRef(ElfObjectFileType).end()) return It; return nullptr; } @@ -3320,9 +3320,9 @@ for (int i = 0; i < ELF::EI_NIDENT; i++) OS << format(" %02x", static_cast(e.e_ident[i])); OS << "\n"; - Str = enumToString(e.e_ident[ELF::EI_CLASS], makeArrayRef(ElfClass)); + Str = enumToString(e.e_ident[ELF::EI_CLASS], ArrayRef(ElfClass)); printFields(OS, "Class:", Str); - Str = enumToString(e.e_ident[ELF::EI_DATA], makeArrayRef(ElfDataEncoding)); + Str = enumToString(e.e_ident[ELF::EI_DATA], ArrayRef(ElfDataEncoding)); printFields(OS, "Data:", Str); OS.PadToColumn(2u); OS << "Version:"; @@ -3331,7 +3331,7 @@ if (e.e_version == ELF::EV_CURRENT) OS << " (current)"; OS << "\n"; - Str = enumToString(e.e_ident[ELF::EI_OSABI], makeArrayRef(ElfOSABI)); + Str = enumToString(e.e_ident[ELF::EI_OSABI], ArrayRef(ElfOSABI)); printFields(OS, "OS/ABI:", Str); printFields(OS, "ABI Version:", std::to_string(e.e_ident[ELF::EI_ABIVERSION])); @@ -3348,7 +3348,7 @@ } printFields(OS, "Type:", Str); - Str = enumToString(e.e_machine, makeArrayRef(ElfMachineType)); + Str = enumToString(e.e_machine, ArrayRef(ElfMachineType)); printFields(OS, "Machine:", Str); Str = "0x" + utohexstr(e.e_version); printFields(OS, "Version:", Str); @@ -3360,21 +3360,20 @@ printFields(OS, "Start of section headers:", Str); std::string ElfFlags; if (e.e_machine == EM_MIPS) - ElfFlags = - printFlags(e.e_flags, makeArrayRef(ElfHeaderMipsFlags), - unsigned(ELF::EF_MIPS_ARCH), unsigned(ELF::EF_MIPS_ABI), - unsigned(ELF::EF_MIPS_MACH)); + ElfFlags = printFlags( + e.e_flags, ArrayRef(ElfHeaderMipsFlags), unsigned(ELF::EF_MIPS_ARCH), + unsigned(ELF::EF_MIPS_ABI), unsigned(ELF::EF_MIPS_MACH)); else if (e.e_machine == EM_RISCV) - ElfFlags = printFlags(e.e_flags, makeArrayRef(ElfHeaderRISCVFlags)); + ElfFlags = printFlags(e.e_flags, ArrayRef(ElfHeaderRISCVFlags)); else if (e.e_machine == EM_AVR) - ElfFlags = printFlags(e.e_flags, makeArrayRef(ElfHeaderAVRFlags), + ElfFlags = printFlags(e.e_flags, ArrayRef(ElfHeaderAVRFlags), unsigned(ELF::EF_AVR_ARCH_MASK)); else if (e.e_machine == EM_LOONGARCH) - ElfFlags = printFlags(e.e_flags, makeArrayRef(ElfHeaderLoongArchFlags), + ElfFlags = printFlags(e.e_flags, ArrayRef(ElfHeaderLoongArchFlags), unsigned(ELF::EF_LOONGARCH_ABI_MODIFIER_MASK), unsigned(ELF::EF_LOONGARCH_OBJABI_MASK)); else if (e.e_machine == EM_XTENSA) - ElfFlags = printFlags(e.e_flags, makeArrayRef(ElfHeaderXtensaFlags), + ElfFlags = printFlags(e.e_flags, ArrayRef(ElfHeaderXtensaFlags), unsigned(ELF::EF_XTENSA_MACH)); Str = "0x" + utohexstr(e.e_flags); if (!ElfFlags.empty()) @@ -3854,14 +3853,14 @@ unsigned char SymbolType = Symbol.getType(); if (this->Obj.getHeader().e_machine == ELF::EM_AMDGPU && SymbolType >= ELF::STT_LOOS && SymbolType < ELF::STT_HIOS) - Fields[3].Str = enumToString(SymbolType, makeArrayRef(AMDGPUSymbolTypes)); + Fields[3].Str = enumToString(SymbolType, ArrayRef(AMDGPUSymbolTypes)); else - Fields[3].Str = enumToString(SymbolType, makeArrayRef(ElfSymbolTypes)); + Fields[3].Str = enumToString(SymbolType, ArrayRef(ElfSymbolTypes)); Fields[4].Str = - enumToString(Symbol.getBinding(), makeArrayRef(ElfSymbolBindings)); + enumToString(Symbol.getBinding(), ArrayRef(ElfSymbolBindings)); Fields[5].Str = - enumToString(Symbol.getVisibility(), makeArrayRef(ElfSymbolVisibilities)); + enumToString(Symbol.getVisibility(), ArrayRef(ElfSymbolVisibilities)); if (Symbol.st_other & ~0x3) { if (this->Obj.getHeader().e_machine == ELF::EM_AARCH64) { @@ -3917,14 +3916,14 @@ unsigned char SymbolType = Symbol->getType(); if (this->Obj.getHeader().e_machine == ELF::EM_AMDGPU && SymbolType >= ELF::STT_LOOS && SymbolType < ELF::STT_HIOS) - Fields[4].Str = enumToString(SymbolType, makeArrayRef(AMDGPUSymbolTypes)); + Fields[4].Str = enumToString(SymbolType, ArrayRef(AMDGPUSymbolTypes)); else - Fields[4].Str = enumToString(SymbolType, makeArrayRef(ElfSymbolTypes)); + Fields[4].Str = enumToString(SymbolType, ArrayRef(ElfSymbolTypes)); Fields[5].Str = - enumToString(Symbol->getBinding(), makeArrayRef(ElfSymbolBindings)); - Fields[6].Str = enumToString(Symbol->getVisibility(), - makeArrayRef(ElfSymbolVisibilities)); + enumToString(Symbol->getBinding(), ArrayRef(ElfSymbolBindings)); + Fields[6].Str = + enumToString(Symbol->getVisibility(), ArrayRef(ElfSymbolVisibilities)); Fields[7].Str = getSymbolSectionNdx(*Symbol, SymIndex, ShndxTable); Fields[8].Str = this->getFullSymbolName(*Symbol, SymIndex, ShndxTable, StrTable, true); @@ -4328,7 +4327,7 @@ Field Fields[8] = {2, 17, 26, 37 + Bias, 48 + Bias, 56 + Bias, 64 + Bias, 68 + Bias}; OS << "\nElf file type is " - << enumToString(Header.e_type, makeArrayRef(ElfObjectFileType)) << "\n" + << enumToString(Header.e_type, ArrayRef(ElfObjectFileType)) << "\n" << "Entry point " << format_hex(Header.e_entry, 3) << "\n" << "There are " << Header.e_phnum << " program headers," << " starting at offset " << Header.e_phoff << "\n\n" @@ -5254,7 +5253,7 @@ support::endian::read32(Desc.data()); std::string FlagsStr; raw_string_ostream OS(FlagsStr); - printFlags(Value, makeArrayRef(FreeBSDFeatureCtlFlags), OS); + printFlags(Value, ArrayRef(FreeBSDFeatureCtlFlags), OS); if (OS.str().empty()) OS << "0x" << utohexstr(Value); else @@ -6378,7 +6377,7 @@ OS.PadToColumn(31 + 2 * Bias); OS << to_string(format_hex_no_prefix(Sym.st_value, 8 + Bias)); OS.PadToColumn(40 + 3 * Bias); - OS << enumToString(Sym.getType(), makeArrayRef(ElfSymbolTypes)); + OS << enumToString(Sym.getType(), ArrayRef(ElfSymbolTypes)); OS.PadToColumn(48 + 3 * Bias); OS << getSymbolSectionNdx(Sym, &Sym - this->dynamic_symbols().begin(), ShndxTable); @@ -6432,7 +6431,7 @@ OS.PadToColumn(20 + 2 * Bias); OS << to_string(format_hex_no_prefix(Sym.st_value, 8 + Bias)); OS.PadToColumn(29 + 3 * Bias); - OS << enumToString(Sym.getType(), makeArrayRef(ElfSymbolTypes)); + OS << enumToString(Sym.getType(), ArrayRef(ElfSymbolTypes)); OS.PadToColumn(37 + 3 * Bias); OS << getSymbolSectionNdx(Sym, &Sym - this->dynamic_symbols().begin(), ShndxTable); @@ -6479,15 +6478,15 @@ OS << "GPR size: " << getMipsRegisterSize(Flags->gpr_size) << "\n"; OS << "CPR1 size: " << getMipsRegisterSize(Flags->cpr1_size) << "\n"; OS << "CPR2 size: " << getMipsRegisterSize(Flags->cpr2_size) << "\n"; - OS << "FP ABI: " - << enumToString(Flags->fp_abi, makeArrayRef(ElfMipsFpABIType)) << "\n"; + OS << "FP ABI: " << enumToString(Flags->fp_abi, ArrayRef(ElfMipsFpABIType)) + << "\n"; OS << "ISA Extension: " - << enumToString(Flags->isa_ext, makeArrayRef(ElfMipsISAExtType)) << "\n"; + << enumToString(Flags->isa_ext, ArrayRef(ElfMipsISAExtType)) << "\n"; if (Flags->ases == 0) OS << "ASEs: None\n"; else // FIXME: Print each flag on a separate line. - OS << "ASEs: " << printFlags(Flags->ases, makeArrayRef(ElfMipsASEFlags)) + OS << "ASEs: " << printFlags(Flags->ases, ArrayRef(ElfMipsASEFlags)) << "\n"; OS << "FLAGS 1: " << format_hex_no_prefix(Flags->flags1, 8, false) << "\n"; OS << "FLAGS 2: " << format_hex_no_prefix(Flags->flags2, 8, false) << "\n"; @@ -6500,30 +6499,30 @@ DictScope D(W, "ElfHeader"); { DictScope D(W, "Ident"); - W.printBinary("Magic", makeArrayRef(E.e_ident).slice(ELF::EI_MAG0, 4)); - W.printEnum("Class", E.e_ident[ELF::EI_CLASS], makeArrayRef(ElfClass)); + W.printBinary("Magic", ArrayRef(E.e_ident).slice(ELF::EI_MAG0, 4)); + W.printEnum("Class", E.e_ident[ELF::EI_CLASS], ArrayRef(ElfClass)); W.printEnum("DataEncoding", E.e_ident[ELF::EI_DATA], - makeArrayRef(ElfDataEncoding)); + ArrayRef(ElfDataEncoding)); W.printNumber("FileVersion", E.e_ident[ELF::EI_VERSION]); - auto OSABI = makeArrayRef(ElfOSABI); + auto OSABI = ArrayRef(ElfOSABI); if (E.e_ident[ELF::EI_OSABI] >= ELF::ELFOSABI_FIRST_ARCH && E.e_ident[ELF::EI_OSABI] <= ELF::ELFOSABI_LAST_ARCH) { switch (E.e_machine) { case ELF::EM_AMDGPU: - OSABI = makeArrayRef(AMDGPUElfOSABI); + OSABI = ArrayRef(AMDGPUElfOSABI); break; case ELF::EM_ARM: - OSABI = makeArrayRef(ARMElfOSABI); + OSABI = ArrayRef(ARMElfOSABI); break; case ELF::EM_TI_C6000: - OSABI = makeArrayRef(C6000ElfOSABI); + OSABI = ArrayRef(C6000ElfOSABI); break; } } W.printEnum("OS/ABI", E.e_ident[ELF::EI_OSABI], OSABI); W.printNumber("ABIVersion", E.e_ident[ELF::EI_ABIVERSION]); - W.printBinary("Unused", makeArrayRef(E.e_ident).slice(ELF::EI_PAD)); + W.printBinary("Unused", ArrayRef(E.e_ident).slice(ELF::EI_PAD)); } std::string TypeStr; @@ -6539,13 +6538,13 @@ } W.printString("Type", TypeStr + " (0x" + utohexstr(E.e_type) + ")"); - W.printEnum("Machine", E.e_machine, makeArrayRef(ElfMachineType)); + W.printEnum("Machine", E.e_machine, ArrayRef(ElfMachineType)); W.printNumber("Version", E.e_version); W.printHex("Entry", E.e_entry); W.printHex("ProgramHeaderOffset", E.e_phoff); W.printHex("SectionHeaderOffset", E.e_shoff); if (E.e_machine == EM_MIPS) - W.printFlags("Flags", E.e_flags, makeArrayRef(ElfHeaderMipsFlags), + W.printFlags("Flags", E.e_flags, ArrayRef(ElfHeaderMipsFlags), unsigned(ELF::EF_MIPS_ARCH), unsigned(ELF::EF_MIPS_ABI), unsigned(ELF::EF_MIPS_MACH)); else if (E.e_machine == EM_AMDGPU) { @@ -6558,29 +6557,29 @@ [[fallthrough]]; case ELF::ELFABIVERSION_AMDGPU_HSA_V3: W.printFlags("Flags", E.e_flags, - makeArrayRef(ElfHeaderAMDGPUFlagsABIVersion3), + ArrayRef(ElfHeaderAMDGPUFlagsABIVersion3), unsigned(ELF::EF_AMDGPU_MACH)); break; case ELF::ELFABIVERSION_AMDGPU_HSA_V4: case ELF::ELFABIVERSION_AMDGPU_HSA_V5: W.printFlags("Flags", E.e_flags, - makeArrayRef(ElfHeaderAMDGPUFlagsABIVersion4), + ArrayRef(ElfHeaderAMDGPUFlagsABIVersion4), unsigned(ELF::EF_AMDGPU_MACH), unsigned(ELF::EF_AMDGPU_FEATURE_XNACK_V4), unsigned(ELF::EF_AMDGPU_FEATURE_SRAMECC_V4)); break; } } else if (E.e_machine == EM_RISCV) - W.printFlags("Flags", E.e_flags, makeArrayRef(ElfHeaderRISCVFlags)); + W.printFlags("Flags", E.e_flags, ArrayRef(ElfHeaderRISCVFlags)); else if (E.e_machine == EM_AVR) - W.printFlags("Flags", E.e_flags, makeArrayRef(ElfHeaderAVRFlags), + W.printFlags("Flags", E.e_flags, ArrayRef(ElfHeaderAVRFlags), unsigned(ELF::EF_AVR_ARCH_MASK)); else if (E.e_machine == EM_LOONGARCH) - W.printFlags("Flags", E.e_flags, makeArrayRef(ElfHeaderLoongArchFlags), + W.printFlags("Flags", E.e_flags, ArrayRef(ElfHeaderLoongArchFlags), unsigned(ELF::EF_LOONGARCH_ABI_MODIFIER_MASK), unsigned(ELF::EF_LOONGARCH_OBJABI_MASK)); else if (E.e_machine == EM_XTENSA) - W.printFlags("Flags", E.e_flags, makeArrayRef(ElfHeaderXtensaFlags), + W.printFlags("Flags", E.e_flags, ArrayRef(ElfHeaderXtensaFlags), unsigned(ELF::EF_XTENSA_MACH)); else W.printFlags("Flags", E.e_flags); @@ -6687,7 +6686,7 @@ object::getELFSectionTypeName(this->Obj.getHeader().e_machine, Sec.sh_type), Sec.sh_type); - W.printFlags("Flags", Sec.sh_flags, makeArrayRef(FlagsList)); + W.printFlags("Flags", Sec.sh_flags, ArrayRef(FlagsList)); W.printHex("Address", Sec.sh_addr); W.printHex("Offset", Sec.sh_offset); W.printNumber("Size", Sec.sh_size); @@ -6797,12 +6796,12 @@ W.printNumber("Name", FullSymbolName, Symbol.st_name); W.printHex("Value", Symbol.st_value); W.printNumber("Size", Symbol.st_size); - W.printEnum("Binding", Symbol.getBinding(), makeArrayRef(ElfSymbolBindings)); + W.printEnum("Binding", Symbol.getBinding(), ArrayRef(ElfSymbolBindings)); if (this->Obj.getHeader().e_machine == ELF::EM_AMDGPU && SymbolType >= ELF::STT_LOOS && SymbolType < ELF::STT_HIOS) - W.printEnum("Type", SymbolType, makeArrayRef(AMDGPUSymbolTypes)); + W.printEnum("Type", SymbolType, ArrayRef(AMDGPUSymbolTypes)); else - W.printEnum("Type", SymbolType, makeArrayRef(ElfSymbolTypes)); + W.printEnum("Type", SymbolType, ArrayRef(ElfSymbolTypes)); if (Symbol.st_other == 0) // Usually st_other flag is zero. Do not pollute the output // by flags enumeration in that case. @@ -6831,7 +6830,7 @@ std::begin(ElfRISCVSymOtherFlags), std::end(ElfRISCVSymOtherFlags)); } - W.printFlags("Other", Symbol.st_other, makeArrayRef(SymOtherFlags), 0x3u); + W.printFlags("Other", Symbol.st_other, ArrayRef(SymOtherFlags), 0x3u); } printSymbolSection(Symbol, SymIndex, ShndxTable); } @@ -6914,7 +6913,7 @@ W.printHex("PhysicalAddress", Phdr.p_paddr); W.printNumber("FileSize", Phdr.p_filesz); W.printNumber("MemSize", Phdr.p_memsz); - W.printFlags("Flags", Phdr.p_flags, makeArrayRef(ElfSegmentFlags)); + W.printFlags("Flags", Phdr.p_flags, ArrayRef(ElfSegmentFlags)); W.printNumber("Alignment", Phdr.p_align); } } @@ -6968,7 +6967,7 @@ for (const VerDef &D : *V) { DictScope Def(W, "Definition"); W.printNumber("Version", D.Version); - W.printFlags("Flags", D.Flags, makeArrayRef(SymVersionFlags)); + W.printFlags("Flags", D.Flags, ArrayRef(SymVersionFlags)); W.printNumber("Index", D.Ndx); W.printNumber("Hash", D.Hash); W.printString("Name", D.Name.c_str()); @@ -7001,7 +7000,7 @@ for (const VernAux &Aux : VN.AuxV) { DictScope Entry(W, "Entry"); W.printNumber("Hash", Aux.Hash); - W.printFlags("Flags", Aux.Flags, makeArrayRef(SymVersionFlags)); + W.printFlags("Flags", Aux.Flags, ArrayRef(SymVersionFlags)); W.printNumber("Index", Aux.Other); W.printString("Name", Aux.Name.c_str()); } @@ -7441,7 +7440,7 @@ const Elf_Sym &Sym = *Parser.getGotSym(&E); W.printHex("Value", Sym.st_value); - W.printEnum("Type", Sym.getType(), makeArrayRef(ElfSymbolTypes)); + W.printEnum("Type", Sym.getType(), ArrayRef(ElfSymbolTypes)); const unsigned SymIndex = &Sym - this->dynamic_symbols().begin(); DataRegion ShndxTable( @@ -7491,7 +7490,7 @@ const Elf_Sym &Sym = *Parser.getPltSym(&E); W.printHex("Value", Sym.st_value); - W.printEnum("Type", Sym.getType(), makeArrayRef(ElfSymbolTypes)); + W.printEnum("Type", Sym.getType(), ArrayRef(ElfSymbolTypes)); printSymbolSection(Sym, &Sym - this->dynamic_symbols().begin(), ShndxTable); @@ -7528,13 +7527,13 @@ else OS << format("MIPS%ur%u", Flags->isa_level, Flags->isa_rev); OS << "\n"; - W.printEnum("ISA Extension", Flags->isa_ext, makeArrayRef(ElfMipsISAExtType)); - W.printFlags("ASEs", Flags->ases, makeArrayRef(ElfMipsASEFlags)); - W.printEnum("FP ABI", Flags->fp_abi, makeArrayRef(ElfMipsFpABIType)); + W.printEnum("ISA Extension", Flags->isa_ext, ArrayRef(ElfMipsISAExtType)); + W.printFlags("ASEs", Flags->ases, ArrayRef(ElfMipsASEFlags)); + W.printEnum("FP ABI", Flags->fp_abi, ArrayRef(ElfMipsFpABIType)); W.printNumber("GPR size", getMipsRegisterSize(Flags->gpr_size)); W.printNumber("CPR1 size", getMipsRegisterSize(Flags->cpr1_size)); W.printNumber("CPR2 size", getMipsRegisterSize(Flags->cpr2_size)); - W.printFlags("Flags 1", Flags->flags1, makeArrayRef(ElfMipsFlags1)); + W.printFlags("Flags 1", Flags->flags1, ArrayRef(ElfMipsFlags1)); W.printHex("Flags 2", Flags->flags2); } Index: llvm/tools/llvm-readobj/MachODumper.cpp =================================================================== --- llvm/tools/llvm-readobj/MachODumper.cpp +++ llvm/tools/llvm-readobj/MachODumper.cpp @@ -431,36 +431,36 @@ template void MachODumper::printFileHeaders(const MachHeader &Header) { - W.printEnum("Magic", Header.magic, makeArrayRef(MachOMagics)); - W.printEnum("CpuType", Header.cputype, makeArrayRef(MachOHeaderCpuTypes)); + W.printEnum("Magic", Header.magic, ArrayRef(MachOMagics)); + W.printEnum("CpuType", Header.cputype, ArrayRef(MachOHeaderCpuTypes)); uint32_t subtype = Header.cpusubtype & ~MachO::CPU_SUBTYPE_MASK; switch (Header.cputype) { case MachO::CPU_TYPE_X86: - W.printEnum("CpuSubType", subtype, makeArrayRef(MachOHeaderCpuSubtypesX86)); + W.printEnum("CpuSubType", subtype, ArrayRef(MachOHeaderCpuSubtypesX86)); break; case MachO::CPU_TYPE_X86_64: - W.printEnum("CpuSubType", subtype, makeArrayRef(MachOHeaderCpuSubtypesX64)); + W.printEnum("CpuSubType", subtype, ArrayRef(MachOHeaderCpuSubtypesX64)); break; case MachO::CPU_TYPE_ARM: - W.printEnum("CpuSubType", subtype, makeArrayRef(MachOHeaderCpuSubtypesARM)); + W.printEnum("CpuSubType", subtype, ArrayRef(MachOHeaderCpuSubtypesARM)); break; case MachO::CPU_TYPE_POWERPC: - W.printEnum("CpuSubType", subtype, makeArrayRef(MachOHeaderCpuSubtypesPPC)); + W.printEnum("CpuSubType", subtype, ArrayRef(MachOHeaderCpuSubtypesPPC)); break; case MachO::CPU_TYPE_SPARC: - W.printEnum("CpuSubType", subtype, makeArrayRef(MachOHeaderCpuSubtypesSPARC)); + W.printEnum("CpuSubType", subtype, ArrayRef(MachOHeaderCpuSubtypesSPARC)); break; case MachO::CPU_TYPE_ARM64: - W.printEnum("CpuSubType", subtype, makeArrayRef(MachOHeaderCpuSubtypesARM64)); + W.printEnum("CpuSubType", subtype, ArrayRef(MachOHeaderCpuSubtypesARM64)); break; case MachO::CPU_TYPE_POWERPC64: default: W.printHex("CpuSubtype", subtype); } - W.printEnum("FileType", Header.filetype, makeArrayRef(MachOHeaderFileTypes)); + W.printEnum("FileType", Header.filetype, ArrayRef(MachOHeaderFileTypes)); W.printNumber("NumOfLoadCommands", Header.ncmds); W.printNumber("SizeOfLoadCommands", Header.sizeofcmds); - W.printFlags("Flags", Header.flags, makeArrayRef(MachOHeaderFlags)); + W.printFlags("Flags", Header.flags, ArrayRef(MachOHeaderFlags)); } void MachODumper::printSectionHeaders() { return printSectionHeaders(Obj); } @@ -490,10 +490,9 @@ W.printNumber("Alignment", MOSection.Alignment); W.printHex("RelocationOffset", MOSection.RelocationTableOffset); W.printNumber("RelocationCount", MOSection.NumRelocationTableEntries); - W.printEnum("Type", MOSection.Flags & 0xFF, - makeArrayRef(MachOSectionTypes)); + W.printEnum("Type", MOSection.Flags & 0xFF, ArrayRef(MachOSectionTypes)); W.printFlags("Attributes", MOSection.Flags >> 8, - makeArrayRef(MachOSectionAttributes)); + ArrayRef(MachOSectionAttributes)); W.printHex("Reserved1", MOSection.Reserved1); W.printHex("Reserved2", MOSection.Reserved2); if (Obj->is64Bit()) @@ -694,13 +693,13 @@ if (MOSymbol.Type & MachO::N_EXT) W.startLine() << "Extern\n"; W.printEnum("Type", uint8_t(MOSymbol.Type & MachO::N_TYPE), - makeArrayRef(MachOSymbolTypes)); + ArrayRef(MachOSymbolTypes)); } W.printHex("Section", SectionName, MOSymbol.SectionIndex); W.printEnum("RefType", static_cast(MOSymbol.Flags & 0x7), - makeArrayRef(MachOSymbolRefTypes)); + ArrayRef(MachOSymbolRefTypes)); W.printFlags("Flags", static_cast(MOSymbol.Flags & ~0x7), - makeArrayRef(MachOSymbolFlags)); + ArrayRef(MachOSymbolFlags)); W.printHex("Value", MOSymbol.Value); } Index: llvm/tools/llvm-readobj/WasmDumper.cpp =================================================================== --- llvm/tools/llvm-readobj/WasmDumper.cpp +++ llvm/tools/llvm-readobj/WasmDumper.cpp @@ -156,7 +156,7 @@ for (const SectionRef &Section : Obj->sections()) { const WasmSection &WasmSec = Obj->getWasmSection(Section); DictScope SectionD(W, "Section"); - W.printEnum("Type", WasmSec.Type, makeArrayRef(WasmSectionTypes)); + W.printEnum("Type", WasmSec.Type, ArrayRef(WasmSectionTypes)); W.printNumber("Size", static_cast(WasmSec.Content.size())); W.printNumber("Offset", WasmSec.Offset); switch (WasmSec.Type) { @@ -221,8 +221,8 @@ DictScope D(W, "Symbol"); WasmSymbol Symbol = Obj->getWasmSymbol(Sym.getRawDataRefImpl()); W.printString("Name", Symbol.Info.Name); - W.printEnum("Type", Symbol.Info.Kind, makeArrayRef(WasmSymbolTypes)); - W.printFlags("Flags", Symbol.Info.Flags, makeArrayRef(WasmSymbolFlags)); + W.printEnum("Type", Symbol.Info.Kind, ArrayRef(WasmSymbolTypes)); + W.printFlags("Flags", Symbol.Info.Flags, ArrayRef(WasmSymbolFlags)); if (Symbol.Info.Flags & wasm::WASM_SYMBOL_UNDEFINED) { if (Symbol.Info.ImportName) { Index: llvm/tools/llvm-readobj/Win64EHDumper.cpp =================================================================== --- llvm/tools/llvm-readobj/Win64EHDumper.cpp +++ llvm/tools/llvm-readobj/Win64EHDumper.cpp @@ -315,11 +315,11 @@ off_t Offset, const UnwindInfo &UI) { DictScope UIS(SW, "UnwindInfo"); SW.printNumber("Version", UI.getVersion()); - SW.printFlags("Flags", UI.getFlags(), makeArrayRef(UnwindFlags)); + SW.printFlags("Flags", UI.getFlags(), ArrayRef(UnwindFlags)); SW.printNumber("PrologSize", UI.PrologSize); if (UI.getFrameRegister()) { SW.printEnum("FrameRegister", UI.getFrameRegister(), - makeArrayRef(UnwindOpInfo)); + ArrayRef(UnwindOpInfo)); SW.printHex("FrameOffset", UI.getFrameOffset()); } else { SW.printString("FrameRegister", StringRef("-")); @@ -337,7 +337,7 @@ return; } - printUnwindCode(UI, makeArrayRef(UCI, UCE)); + printUnwindCode(UI, ArrayRef(UCI, UCE)); UCI = UCI + UsedSlots - 1; } } Index: llvm/tools/llvm-readobj/XCOFFDumper.cpp =================================================================== --- llvm/tools/llvm-readobj/XCOFFDumper.cpp +++ llvm/tools/llvm-readobj/XCOFFDumper.cpp @@ -255,7 +255,7 @@ W.printHex("SymbolType", LoadSecSymEntPtr->SymbolType); W.printEnum("StorageClass", static_cast(LoadSecSymEntPtr->StorageClass), - makeArrayRef(SymStorageClass)); + ArrayRef(SymStorageClass)); W.printHex("ImportFileID", LoadSecSymEntPtr->ImportFileID); W.printNumber("ParameterTypeCheck", LoadSecSymEntPtr->ParameterTypeCheck); } @@ -330,7 +330,7 @@ W.printNumber("FixupBitValue", IsFixupIndicated(Info) ? 1 : 0); W.printNumber("Length", GetRelocatedLength(Info)); W.printEnum("Type", static_cast(Type), - makeArrayRef(RelocationTypeNameclass)); + ArrayRef(RelocationTypeNameclass)); W.printNumber("SectionNumber", LoaderSecRelEntPtr->SectionNum); } else { W.startLine() << format_hex(LoaderSecRelEntPtr->VirtualAddr, @@ -469,8 +469,7 @@ W.printString("IsSigned", Reloc.isRelocationSigned() ? "Yes" : "No"); W.printNumber("FixupBitValue", Reloc.isFixupIndicated() ? 1 : 0); W.printNumber("Length", Reloc.getRelocatedLength()); - W.printEnum("Type", (uint8_t)Reloc.Type, - makeArrayRef(RelocationTypeNameclass)); + W.printEnum("Type", (uint8_t)Reloc.Type, ArrayRef(RelocationTypeNameclass)); } else { raw_ostream &OS = W.startLine(); OS << W.hex(Reloc.VirtualAddress) << " " << RelocName << " " << SymbolName @@ -535,10 +534,10 @@ Obj.getSymbolIndex(reinterpret_cast(AuxEntPtr))); W.printString("Name", FileName); W.printEnum("Type", static_cast(AuxEntPtr->Type), - makeArrayRef(FileStringType)); + ArrayRef(FileStringType)); if (Obj.is64Bit()) { W.printEnum("Auxiliary Type", static_cast(AuxEntPtr->AuxType), - makeArrayRef(SymAuxType)); + ArrayRef(SymAuxType)); } } @@ -576,14 +575,14 @@ // Print out symbol alignment and type. W.printNumber("SymbolAlignmentLog2", AuxEntRef.getAlignmentLog2()); W.printEnum("SymbolType", AuxEntRef.getSymbolType(), - makeArrayRef(CsectSymbolTypeClass)); + ArrayRef(CsectSymbolTypeClass)); W.printEnum("StorageMappingClass", static_cast(AuxEntRef.getStorageMappingClass()), - makeArrayRef(CsectStorageMappingClass)); + ArrayRef(CsectStorageMappingClass)); if (Obj.is64Bit()) { W.printEnum("Auxiliary Type", static_cast(XCOFF::AUX_CSECT), - makeArrayRef(SymAuxType)); + ArrayRef(SymAuxType)); } else { W.printHex("StabInfoIndex", AuxEntRef.getStabInfoIndex32()); W.printHex("StabSectNum", AuxEntRef.getStabSectNum32()); @@ -615,7 +614,7 @@ W.printHex("SizeOfFunction", AuxEntPtr->SizeOfFunction); W.printNumber("SymbolIndexOfNextBeyond", AuxEntPtr->SymIdxOfNextBeyond); W.printEnum("Auxiliary Type", static_cast(AuxEntPtr->AuxType), - makeArrayRef(SymAuxType)); + ArrayRef(SymAuxType)); } void XCOFFDumper::printFunctionAuxEnt(const XCOFFFunctionAuxEnt32 *AuxEntPtr) { @@ -640,7 +639,7 @@ W.printHex("PointerToLineNum", AuxEntPtr->PtrToLineNum); W.printNumber("SymbolIndexOfNextBeyond", AuxEntPtr->SymIdxOfNextBeyond); W.printEnum("Auxiliary Type", static_cast(AuxEntPtr->AuxType), - makeArrayRef(SymAuxType)); + ArrayRef(SymAuxType)); } void XCOFFDumper::printBlockAuxEnt(const XCOFFBlockAuxEnt32 *AuxEntPtr) { @@ -661,7 +660,7 @@ Obj.getSymbolIndex(reinterpret_cast(AuxEntPtr))); W.printHex("LineNumber", AuxEntPtr->LineNum); W.printEnum("Auxiliary Type", static_cast(AuxEntPtr->AuxType), - makeArrayRef(SymAuxType)); + ArrayRef(SymAuxType)); } template @@ -673,7 +672,7 @@ W.printNumber("NumberOfRelocEntries", AuxEntPtr->NumberOfRelocEnt); if (Obj.is64Bit()) W.printEnum("Auxiliary Type", static_cast(XCOFF::AUX_SECT), - makeArrayRef(SymAuxType)); + ArrayRef(SymAuxType)); } static StringRef GetSymbolValueName(XCOFF::StorageClass SC) { @@ -761,14 +760,14 @@ W.printString("Section", SectionName); if (SymbolClass == XCOFF::C_FILE) { W.printEnum("Source Language ID", SymbolEntRef.getLanguageIdForCFile(), - makeArrayRef(CFileLangIdClass)); + ArrayRef(CFileLangIdClass)); W.printEnum("CPU Version ID", SymbolEntRef.getCPUTypeIddForCFile(), - makeArrayRef(CFileCpuIdClass)); + ArrayRef(CFileCpuIdClass)); } else W.printHex("Type", SymbolEntRef.getSymbolType()); W.printEnum("StorageClass", static_cast(SymbolClass), - makeArrayRef(SymStorageClass)); + ArrayRef(SymStorageClass)); W.printNumber("NumberOfAuxEntries", NumberOfAuxEntries); if (NumberOfAuxEntries == 0) @@ -778,7 +777,7 @@ if (NumberOfAuxEntries > 1) reportUniqueWarning("the " + enumToString(static_cast(SymbolClass), - makeArrayRef(SymStorageClass)) + + ArrayRef(SymStorageClass)) + " symbol at index " + Twine(SymbolIdx) + " should not have more than 1 " "auxiliary entry"); @@ -1198,7 +1197,7 @@ if (Sec.isReservedSectionType()) W.printHex("Flags", "Reserved", SectionType); else - W.printEnum("Type", SectionType, makeArrayRef(SectionTypeFlagsNames)); + W.printEnum("Type", SectionType, ArrayRef(SectionTypeFlagsNames)); } if (opts::SectionRelocations) Index: llvm/tools/llvm-stress/llvm-stress.cpp =================================================================== --- llvm/tools/llvm-stress/llvm-stress.cpp +++ llvm/tools/llvm-stress/llvm-stress.cpp @@ -438,7 +438,7 @@ for (unsigned i = 0; i < 2; ++i) RandomBits[i] = Ran->Rand64(); - APInt RandomInt(Ty->getPrimitiveSizeInBits(), makeArrayRef(RandomBits)); + APInt RandomInt(Ty->getPrimitiveSizeInBits(), ArrayRef(RandomBits)); APFloat RandomFloat(Ty->getFltSemantics(), RandomInt); if (getRandom() & 1) Index: llvm/tools/lto/lto.cpp =================================================================== --- llvm/tools/lto/lto.cpp +++ llvm/tools/lto/lto.cpp @@ -496,7 +496,7 @@ SmallVector Options; for (int i = 0; i < number; ++i) Options.push_back(options[i]); - unwrap(cg)->setCodeGenDebugOptions(makeArrayRef(Options)); + unwrap(cg)->setCodeGenDebugOptions(ArrayRef(Options)); } unsigned int lto_api_version() { return LTO_API_VERSION; } Index: llvm/tools/obj2yaml/elf2yaml.cpp =================================================================== --- llvm/tools/obj2yaml/elf2yaml.cpp +++ llvm/tools/obj2yaml/elf2yaml.cpp @@ -247,8 +247,7 @@ else ExpectedOffset = sizeof(typename ELFT::Ehdr); - for (const std::unique_ptr &C : - makeArrayRef(V).drop_front()) { + for (const std::unique_ptr &C : ArrayRef(V).drop_front()) { ELFYAML::Section &Sec = *cast(C.get()); const typename ELFT::Shdr &SecHdr = S[Sec.OriginalSecNdx]; @@ -360,7 +359,7 @@ std::vector OriginalOrder; if (!Chunks.empty()) for (const std::unique_ptr &C : - makeArrayRef(Chunks).drop_front()) + ArrayRef(Chunks).drop_front()) OriginalOrder.push_back(cast(C.get())); // Sometimes the order of sections in the section header table does not match Index: llvm/unittests/ADT/ArrayRefTest.cpp =================================================================== --- llvm/unittests/ADT/ArrayRefTest.cpp +++ llvm/unittests/ADT/ArrayRefTest.cpp @@ -44,9 +44,9 @@ TEST(ArrayRefTest, AllocatorCopy) { BumpPtrAllocator Alloc; static const uint16_t Words1[] = { 1, 4, 200, 37 }; - ArrayRef Array1 = makeArrayRef(Words1, 4); + ArrayRef Array1 = ArrayRef(Words1, 4); static const uint16_t Words2[] = { 11, 4003, 67, 64000, 13 }; - ArrayRef Array2 = makeArrayRef(Words2, 5); + ArrayRef Array2 = ArrayRef(Words2, 5); ArrayRef Array1c = Array1.copy(Alloc); ArrayRef Array2c = Array2.copy(Alloc); EXPECT_TRUE(Array1.equals(Array1c)); @@ -63,9 +63,9 @@ void operator=(const NonAssignable &RHS) { assert(RHS.Ptr != nullptr); } bool operator==(const NonAssignable &RHS) const { return Ptr == RHS.Ptr; } } Array3Src[] = {"hello", "world"}; - ArrayRef Array3Copy = makeArrayRef(Array3Src).copy(Alloc); - EXPECT_EQ(makeArrayRef(Array3Src), Array3Copy); - EXPECT_NE(makeArrayRef(Array3Src).data(), Array3Copy.data()); + ArrayRef Array3Copy = ArrayRef(Array3Src).copy(Alloc); + EXPECT_EQ(ArrayRef(Array3Src), Array3Copy); + EXPECT_NE(ArrayRef(Array3Src).data(), Array3Copy.data()); } // This test is pure UB given the ArrayRef<> implementation. @@ -222,31 +222,32 @@ EXPECT_TRUE(A.empty()); } -TEST(ArrayRefTest, makeArrayRef) { +TEST(ArrayRefTest, ArrayRef) { static const int A1[] = {1, 2, 3, 4, 5, 6, 7, 8}; - // No copy expected for non-const ArrayRef (true no-op) + // A copy is expected for non-const ArrayRef (thin copy) ArrayRef AR1(A1); - ArrayRef &AR1Ref = makeArrayRef(AR1); - EXPECT_EQ(&AR1, &AR1Ref); + const ArrayRef &AR1Ref = ArrayRef(AR1); + EXPECT_NE(&AR1, &AR1Ref); + EXPECT_TRUE(AR1.equals(AR1Ref)); // A copy is expected for non-const ArrayRef (thin copy) const ArrayRef AR2(A1); - const ArrayRef &AR2Ref = makeArrayRef(AR2); + const ArrayRef &AR2Ref = ArrayRef(AR2); EXPECT_NE(&AR2Ref, &AR2); EXPECT_TRUE(AR2.equals(AR2Ref)); } TEST(ArrayRefTest, OwningArrayRef) { static const int A1[] = {0, 1}; - OwningArrayRef A(makeArrayRef(A1)); + OwningArrayRef A{ArrayRef(A1)}; OwningArrayRef B(std::move(A)); EXPECT_EQ(A.data(), nullptr); } -TEST(ArrayRefTest, makeArrayRefFromStdArray) { +TEST(ArrayRefTest, ArrayRefFromStdArray) { std::array A1{{42, -5, 0, 1000000, -1000000}}; - ArrayRef A2 = makeArrayRef(A1); + ArrayRef A2 = ArrayRef(A1); EXPECT_EQ(A1.size(), A2.size()); for (std::size_t i = 0; i < A1.size(); ++i) { Index: llvm/unittests/ADT/EditDistanceTest.cpp =================================================================== --- llvm/unittests/ADT/EditDistanceTest.cpp +++ llvm/unittests/ADT/EditDistanceTest.cpp @@ -29,8 +29,8 @@ return X; }; unsigned EditDist = llvm::ComputeMappedEditDistance( - makeArrayRef(A.data(), A.size()), makeArrayRef(B.data(), B.size()), - TrackMaps, true, MaxEditDistance); + ArrayRef(A.data(), A.size()), ArrayRef(B.data(), B.size()), TrackMaps, + true, MaxEditDistance); return {NumMaps, EditDist}; } Index: llvm/unittests/ADT/SmallVectorTest.cpp =================================================================== --- llvm/unittests/ADT/SmallVectorTest.cpp +++ llvm/unittests/ADT/SmallVectorTest.cpp @@ -1128,18 +1128,18 @@ SmallVector V1 = {}; EXPECT_TRUE(V1.empty()); V1 = {0, 0}; - EXPECT_TRUE(makeArrayRef(V1).equals({0, 0})); + EXPECT_TRUE(ArrayRef(V1).equals({0, 0})); V1 = {-1, -1}; - EXPECT_TRUE(makeArrayRef(V1).equals({-1, -1})); + EXPECT_TRUE(ArrayRef(V1).equals({-1, -1})); SmallVector V2 = {1, 2, 3, 4}; - EXPECT_TRUE(makeArrayRef(V2).equals({1, 2, 3, 4})); + EXPECT_TRUE(ArrayRef(V2).equals({1, 2, 3, 4})); V2.assign({4}); - EXPECT_TRUE(makeArrayRef(V2).equals({4})); + EXPECT_TRUE(ArrayRef(V2).equals({4})); V2.append({3, 2}); - EXPECT_TRUE(makeArrayRef(V2).equals({4, 3, 2})); + EXPECT_TRUE(ArrayRef(V2).equals({4, 3, 2})); V2.insert(V2.begin() + 1, 5); - EXPECT_TRUE(makeArrayRef(V2).equals({4, 5, 3, 2})); + EXPECT_TRUE(ArrayRef(V2).equals({4, 5, 3, 2})); } TEST(SmallVectorTest, ToVector) { Index: llvm/unittests/ADT/TinyPtrVectorTest.cpp =================================================================== --- llvm/unittests/ADT/TinyPtrVectorTest.cpp +++ llvm/unittests/ADT/TinyPtrVectorTest.cpp @@ -53,9 +53,7 @@ PtrT makePtr(ValueT *V) { return PtrT(V); } - ArrayRef testArray(size_t N) { - return makeArrayRef(&TestPtrs[0], N); - } + ArrayRef testArray(size_t N) { return ArrayRef(&TestPtrs[0], N); } void appendValues(VectorT &V, ArrayRef Values) { for (size_t i = 0, e = Values.size(); i != e; ++i) Index: llvm/unittests/Analysis/MemoryProfileInfoTest.cpp =================================================================== --- llvm/unittests/Analysis/MemoryProfileInfoTest.cpp +++ llvm/unittests/Analysis/MemoryProfileInfoTest.cpp @@ -407,10 +407,10 @@ StackIds.push_back(*ContextIter); if (First) { std::vector Expected = {2, 3, 4}; - EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected)); + EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected)); } else { std::vector Expected = {2, 3, 5}; - EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected)); + EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected)); } First = false; } @@ -435,10 +435,10 @@ StackIds.push_back(Index->getStackIdAtIndex(StackIdIndex)); if (First) { std::vector Expected = {3, 4}; - EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected)); + EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected)); } else { std::vector Expected = {3, 5}; - EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected)); + EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected)); } First = false; } @@ -455,10 +455,10 @@ StackIds.push_back(Index->getStackIdAtIndex(StackIdIndex)); if (First) { std::vector Expected = {1, 2, 3, 4}; - EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected)); + EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected)); } else { std::vector Expected = {1, 2, 3, 5}; - EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected)); + EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected)); } First = false; } Index: llvm/unittests/Analysis/VectorUtilsTest.cpp =================================================================== --- llvm/unittests/Analysis/VectorUtilsTest.cpp +++ llvm/unittests/Analysis/VectorUtilsTest.cpp @@ -105,9 +105,10 @@ TEST_F(BasicTest, narrowShuffleMaskElts) { SmallVector ScaledMask; narrowShuffleMaskElts(1, {3,2,0,-2}, ScaledMask); - EXPECT_EQ(makeArrayRef(ScaledMask), makeArrayRef({3,2,0,-2})); + EXPECT_EQ(ArrayRef(ScaledMask), ArrayRef({3, 2, 0, -2})); narrowShuffleMaskElts(4, {3,2,0,-1}, ScaledMask); - EXPECT_EQ(makeArrayRef(ScaledMask), makeArrayRef({12,13,14,15,8,9,10,11,0,1,2,3,-1,-1,-1,-1})); + EXPECT_EQ(ArrayRef(ScaledMask), ArrayRef({12, 13, 14, 15, 8, 9, 10, 11, 0, 1, + 2, 3, -1, -1, -1, -1})); } TEST_F(BasicTest, widenShuffleMaskElts) { @@ -116,11 +117,11 @@ // scale == 1 is a copy EXPECT_TRUE(widenShuffleMaskElts(1, {3,2,0,-1}, WideMask)); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({3,2,0,-1})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({3, 2, 0, -1})); // back to original mask - narrowShuffleMaskElts(1, makeArrayRef(WideMask), NarrowMask); - EXPECT_EQ(makeArrayRef(NarrowMask), makeArrayRef({3,2,0,-1})); + narrowShuffleMaskElts(1, ArrayRef(WideMask), NarrowMask); + EXPECT_EQ(ArrayRef(NarrowMask), ArrayRef({3, 2, 0, -1})); // can't widen non-consecutive 3/2 EXPECT_FALSE(widenShuffleMaskElts(2, {3,2,0,-1}, WideMask)); @@ -130,30 +131,31 @@ // can always widen identity to single element EXPECT_TRUE(widenShuffleMaskElts(3, {0,1,2}, WideMask)); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({0})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({0})); // back to original mask - narrowShuffleMaskElts(3, makeArrayRef(WideMask), NarrowMask); - EXPECT_EQ(makeArrayRef(NarrowMask), makeArrayRef({0,1,2})); + narrowShuffleMaskElts(3, ArrayRef(WideMask), NarrowMask); + EXPECT_EQ(ArrayRef(NarrowMask), ArrayRef({0, 1, 2})); // groups of 4 must be consecutive/undef EXPECT_TRUE(widenShuffleMaskElts(4, {12,13,14,15,8,9,10,11,0,1,2,3,-1,-1,-1,-1}, WideMask)); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({3,2,0,-1})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({3, 2, 0, -1})); // back to original mask - narrowShuffleMaskElts(4, makeArrayRef(WideMask), NarrowMask); - EXPECT_EQ(makeArrayRef(NarrowMask), makeArrayRef({12,13,14,15,8,9,10,11,0,1,2,3,-1,-1,-1,-1})); + narrowShuffleMaskElts(4, ArrayRef(WideMask), NarrowMask); + EXPECT_EQ(ArrayRef(NarrowMask), ArrayRef({12, 13, 14, 15, 8, 9, 10, 11, 0, 1, + 2, 3, -1, -1, -1, -1})); // groups of 2 must be consecutive/undef EXPECT_FALSE(widenShuffleMaskElts(2, {12,12,14,15,8,9,10,11,0,1,2,3,-1,-1,-1,-1}, WideMask)); // groups of 3 must be consecutive/undef EXPECT_TRUE(widenShuffleMaskElts(3, {6,7,8,0,1,2,-1,-1,-1}, WideMask)); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({2,0,-1})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({2, 0, -1})); // back to original mask - narrowShuffleMaskElts(3, makeArrayRef(WideMask), NarrowMask); - EXPECT_EQ(makeArrayRef(NarrowMask), makeArrayRef({6,7,8,0,1,2,-1,-1,-1})); + narrowShuffleMaskElts(3, ArrayRef(WideMask), NarrowMask); + EXPECT_EQ(ArrayRef(NarrowMask), ArrayRef({6, 7, 8, 0, 1, 2, -1, -1, -1})); // groups of 3 must be consecutive/undef (partial undefs are not ok) EXPECT_FALSE(widenShuffleMaskElts(3, {-1,7,8,0,-1,2,-1,-1,-1}, WideMask)); @@ -163,7 +165,7 @@ // negative indexes must match across a wide element EXPECT_TRUE(widenShuffleMaskElts(2, {-2,-2,-3,-3}, WideMask)); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({-2,-3})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({-2, -3})); } TEST_F(BasicTest, getShuffleMaskWithWidestElts) { @@ -171,43 +173,42 @@ // can not widen anything here. getShuffleMaskWithWidestElts({3, 2, 0, -1}, WideMask); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({3, 2, 0, -1})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({3, 2, 0, -1})); // can't widen non-consecutive 3/2 getShuffleMaskWithWidestElts({3, 2, 0, -1}, WideMask); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({3, 2, 0, -1})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({3, 2, 0, -1})); // can always widen identity to single element getShuffleMaskWithWidestElts({0, 1, 2}, WideMask); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({0})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({0})); // groups of 4 must be consecutive/undef getShuffleMaskWithWidestElts( {12, 13, 14, 15, 8, 9, 10, 11, 0, 1, 2, 3, -1, -1, -1, -1}, WideMask); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({3, 2, 0, -1})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({3, 2, 0, -1})); // groups of 2 must be consecutive/undef getShuffleMaskWithWidestElts( {12, 12, 14, 15, 8, 9, 10, 11, 0, 1, 2, 3, -1, -1, -1, -1}, WideMask); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({12, 12, 14, 15, 8, 9, 10, 11, - 0, 1, 2, 3, -1, -1, -1, -1})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({12, 12, 14, 15, 8, 9, 10, 11, 0, 1, 2, + 3, -1, -1, -1, -1})); // groups of 3 must be consecutive/undef getShuffleMaskWithWidestElts({6, 7, 8, 0, 1, 2, -1, -1, -1}, WideMask); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({2, 0, -1})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({2, 0, -1})); // groups of 3 must be consecutive/undef (partial undefs are not ok) getShuffleMaskWithWidestElts({-1, 7, 8, 0, -1, 2, -1, -1, -1}, WideMask); - EXPECT_EQ(makeArrayRef(WideMask), - makeArrayRef({-1, 7, 8, 0, -1, 2, -1, -1, -1})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({-1, 7, 8, 0, -1, 2, -1, -1, -1})); // negative indexes must match across a wide element getShuffleMaskWithWidestElts({-1, -2, -1, -1}, WideMask); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({-1, -2, -1, -1})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({-1, -2, -1, -1})); // negative indexes must match across a wide element getShuffleMaskWithWidestElts({-2, -2, -3, -3}, WideMask); - EXPECT_EQ(makeArrayRef(WideMask), makeArrayRef({-2, -3})); + EXPECT_EQ(ArrayRef(WideMask), ArrayRef({-2, -3})); } TEST_F(BasicTest, getShuffleDemandedElts) { Index: llvm/unittests/Bitstream/BitstreamReaderTest.cpp =================================================================== --- llvm/unittests/Bitstream/BitstreamReaderTest.cpp +++ llvm/unittests/Bitstream/BitstreamReaderTest.cpp @@ -108,7 +108,7 @@ Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); AbbrevID = Stream.EmitAbbrev(std::move(Abbrev)); unsigned Record[] = {RecordID}; - Stream.EmitRecordWithBlob(AbbrevID, makeArrayRef(Record), BlobIn); + Stream.EmitRecordWithBlob(AbbrevID, ArrayRef(Record), BlobIn); Stream.ExitBlock(); } Index: llvm/unittests/DebugInfo/MSF/MappedBlockStreamTest.cpp =================================================================== --- llvm/unittests/DebugInfo/MSF/MappedBlockStreamTest.cpp +++ llvm/unittests/DebugInfo/MSF/MappedBlockStreamTest.cpp @@ -493,7 +493,7 @@ MATCHER_P3(BlockIsFilledWith, Layout, BlockIndex, Byte, "succeeded") { uint64_t Offset = msf::blockToOffset(BlockIndex, Layout.SB->BlockSize); - ArrayRef BufferRef = makeArrayRef(arg); + ArrayRef BufferRef = ArrayRef(arg); BufferRef = BufferRef.slice(Offset, Layout.SB->BlockSize); return llvm::all_of(BufferRef, [this](uint8_t B) { return B == Byte; }); } Index: llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp =================================================================== --- llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp +++ llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp @@ -332,7 +332,7 @@ // Choose an instruction and connect to later operations. size_t IP = uniform(IB.Rand, 1, Insts.size() - 1); Instruction *Inst = Insts[IP - 1]; - auto ConnectAfter = makeArrayRef(Insts).slice(IP); + auto ConnectAfter = ArrayRef(Insts).slice(IP); IB.connectToSink(*BB, ConnectAfter, Inst); ASSERT_FALSE(verifyModule(*M, &errs())); } Index: llvm/unittests/IR/AttributesTest.cpp =================================================================== --- llvm/unittests/IR/AttributesTest.cpp +++ llvm/unittests/IR/AttributesTest.cpp @@ -201,9 +201,9 @@ { AttributeSet AS1 = AttributeSet::get( - C1, makeArrayRef(Attribute::get(C1, Attribute::NoReturn))); + C1, ArrayRef(Attribute::get(C1, Attribute::NoReturn))); AttributeSet AS2 = AttributeSet::get( - C2, makeArrayRef(Attribute::get(C2, Attribute::NoReturn))); + C2, ArrayRef(Attribute::get(C2, Attribute::NoReturn))); EXPECT_TRUE(AS1.hasParentContext(C1)); EXPECT_FALSE(AS1.hasParentContext(C2)); EXPECT_FALSE(AS2.hasParentContext(C1)); Index: llvm/unittests/IR/DebugInfoTest.cpp =================================================================== --- llvm/unittests/IR/DebugInfoTest.cpp +++ llvm/unittests/IR/DebugInfoTest.cpp @@ -84,7 +84,7 @@ { \ SmallVector V; \ EXPECT_EQ(REMAINDER, DINode::splitFlags(FLAGS, V)); \ - EXPECT_TRUE(makeArrayRef(V).equals(VECTOR)); \ + EXPECT_TRUE(ArrayRef(V).equals(VECTOR)); \ } CHECK_SPLIT(DINode::FlagPublic, {DINode::FlagPublic}, DINode::FlagZero); CHECK_SPLIT(DINode::FlagProtected, {DINode::FlagProtected}, DINode::FlagZero); Index: llvm/unittests/IR/MetadataTest.cpp =================================================================== --- llvm/unittests/IR/MetadataTest.cpp +++ llvm/unittests/IR/MetadataTest.cpp @@ -2931,7 +2931,7 @@ TEST_F(DIExpressionTest, get) { uint64_t Elements[] = {2, 6, 9, 78, 0}; auto *N = DIExpression::get(Context, Elements); - EXPECT_EQ(makeArrayRef(Elements), N->getElements()); + EXPECT_EQ(ArrayRef(Elements), N->getElements()); EXPECT_EQ(N, DIExpression::get(Context, Elements)); EXPECT_EQ(5u, N->getNumElements()); Index: llvm/unittests/Object/ELFTypesTest.cpp =================================================================== --- llvm/unittests/Object/ELFTypesTest.cpp +++ llvm/unittests/Object/ELFTypesTest.cpp @@ -43,7 +43,7 @@ TEST(ELFTypesTest, NoteTest) { static const uint8_t Random[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; - ArrayRef RandomData = makeArrayRef(Random); + ArrayRef RandomData = ArrayRef(Random); NoteTestData TestData; auto Note1 = TestData.getElfNote(StringRef("AMD"), ELF::NT_AMDGPU_METADATA, Index: llvm/unittests/ObjectYAML/MinidumpYAMLTest.cpp =================================================================== --- llvm/unittests/ObjectYAML/MinidumpYAMLTest.cpp +++ llvm/unittests/ObjectYAML/MinidumpYAMLTest.cpp @@ -137,7 +137,7 @@ EXPECT_EQ(OSPlatform::Linux, SysInfo.PlatformId); EXPECT_EQ( (ArrayRef{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}), - makeArrayRef(SysInfo.CPU.Other.ProcessorFeatures)); + ArrayRef(SysInfo.CPU.Other.ProcessorFeatures)); } // Test that we can parse a normal-looking ExceptionStream. Index: llvm/unittests/ProfileData/CoverageMappingTest.cpp =================================================================== --- llvm/unittests/ProfileData/CoverageMappingTest.cpp +++ llvm/unittests/ProfileData/CoverageMappingTest.cpp @@ -213,7 +213,7 @@ Filenames.resize(Files.size() + 1); for (const auto &E : Files) Filenames[E.getValue()] = E.getKey().str(); - ArrayRef FilenameRefs = llvm::makeArrayRef(Filenames); + ArrayRef FilenameRefs = llvm::ArrayRef(Filenames); RawCoverageMappingReader Reader(Coverage, FilenameRefs, Data.Filenames, Data.Expressions, Data.Regions); EXPECT_THAT_ERROR(Reader.read(), Succeeded()); @@ -279,7 +279,7 @@ InputFunctionCoverageData &Input = InputFunctions.back(); OutputFunctionCoverageData &Output = OutputFunctions.back(); - size_t N = makeArrayRef(Input.Regions).size(); + size_t N = ArrayRef(Input.Regions).size(); ASSERT_EQ(N, Output.Regions.size()); for (size_t I = 0; I < N; ++I) { ASSERT_EQ(Input.Regions[I].Count, Output.Regions[I].Count); Index: llvm/unittests/ProfileData/InstrProfTest.cpp =================================================================== --- llvm/unittests/ProfileData/InstrProfTest.cpp +++ llvm/unittests/ProfileData/InstrProfTest.cpp @@ -551,7 +551,7 @@ // Annotate with 4 records. InstrProfValueData VD0Sorted[] = {{1000, 6}, {2000, 5}, {3000, 4}, {4000, 3}, {5000, 2}, {6000, 1}}; - annotateValueSite(*M, *Inst, makeArrayRef(VD0Sorted).slice(2), 10, + annotateValueSite(*M, *Inst, ArrayRef(VD0Sorted).slice(2), 10, IPVK_IndirectCallTarget, 5); Res = getValueProfDataFromInst(*Inst, IPVK_IndirectCallTarget, 5, ValueData, N, T); Index: llvm/unittests/Remarks/YAMLRemarksSerializerTest.cpp =================================================================== --- llvm/unittests/Remarks/YAMLRemarksSerializerTest.cpp +++ llvm/unittests/Remarks/YAMLRemarksSerializerTest.cpp @@ -55,7 +55,7 @@ StringRef ExpectedR, StringRef ExpectedMeta, std::optional StrTab = std::nullopt) { return check(SerializerFormat, remarks::SerializerMode::Separate, - makeArrayRef(&R, &R + 1), ExpectedR, ExpectedMeta, + ArrayRef(&R, &R + 1), ExpectedR, ExpectedMeta, std::move(StrTab)); } @@ -64,7 +64,7 @@ StringRef ExpectedR, std::optional StrTab = std::nullopt) { return check(SerializerFormat, remarks::SerializerMode::Standalone, - makeArrayRef(&R, &R + 1), ExpectedR, + ArrayRef(&R, &R + 1), ExpectedR, /*ExpectedMeta=*/std::nullopt, std::move(StrTab)); } Index: llvm/unittests/Support/BinaryStreamTest.cpp =================================================================== --- llvm/unittests/Support/BinaryStreamTest.cpp +++ llvm/unittests/Support/BinaryStreamTest.cpp @@ -46,7 +46,7 @@ uint8_t *Ptr = Allocator.Allocate(Size); ::memcpy(Ptr, Ref.data(), Ref.size()); ::memcpy(Ptr + Ref.size(), Data.data(), BytesLeft); - Buffer = makeArrayRef(Ptr, Size); + Buffer = ArrayRef(Ptr, Size); return Error::success(); } @@ -203,9 +203,9 @@ // 1. If the read fits it should work. ASSERT_EQ(InputData.size(), Stream.Input->getLength()); ASSERT_THAT_ERROR(Stream.Input->readBytes(2, 1, Buffer), Succeeded()); - EXPECT_EQ(makeArrayRef(InputData).slice(2, 1), Buffer); + EXPECT_EQ(ArrayRef(InputData).slice(2, 1), Buffer); ASSERT_THAT_ERROR(Stream.Input->readBytes(0, 4, Buffer), Succeeded()); - EXPECT_EQ(makeArrayRef(InputData).slice(0, 4), Buffer); + EXPECT_EQ(ArrayRef(InputData).slice(0, 4), Buffer); // 2. Reading past the bounds of the input should fail. EXPECT_THAT_ERROR(Stream.Input->readBytes(4, 2, Buffer), Failed()); @@ -223,12 +223,12 @@ // Read 1 byte from offset 2 should work ASSERT_EQ(InputData.size(), Ref.getLength()); ASSERT_THAT_ERROR(Ref.readBytes(2, 1, Buffer), Succeeded()); - EXPECT_EQ(makeArrayRef(InputData).slice(2, 1), Buffer); + EXPECT_EQ(ArrayRef(InputData).slice(2, 1), Buffer); // Reading everything from offset 2 on. ASSERT_THAT_ERROR(Ref.readLongestContiguousChunk(2, Buffer), Succeeded()); if (Stream.IsContiguous) - EXPECT_EQ(makeArrayRef(InputData).slice(2), Buffer); + EXPECT_EQ(ArrayRef(InputData).slice(2), Buffer); else EXPECT_FALSE(Buffer.empty()); @@ -241,14 +241,14 @@ Ref = Ref.drop_front(1); ASSERT_THAT_ERROR(Ref.readBytes(2, 1, Buffer), Succeeded()); if (Stream.IsContiguous) - EXPECT_EQ(makeArrayRef(InputData).slice(3, 1), Buffer); + EXPECT_EQ(ArrayRef(InputData).slice(3, 1), Buffer); else EXPECT_FALSE(Buffer.empty()); // Reading everything from offset 2 on after dropping 1 byte. ASSERT_THAT_ERROR(Ref.readLongestContiguousChunk(2, Buffer), Succeeded()); if (Stream.IsContiguous) - EXPECT_EQ(makeArrayRef(InputData).slice(3), Buffer); + EXPECT_EQ(ArrayRef(InputData).slice(3), Buffer); else EXPECT_FALSE(Buffer.empty()); @@ -260,7 +260,7 @@ // But if we read the longest contiguous chunk instead, we should still // get the 1 byte at the end. ASSERT_THAT_ERROR(Ref.readLongestContiguousChunk(2, Buffer), Succeeded()); - EXPECT_EQ(makeArrayRef(InputData).take_back(), Buffer); + EXPECT_EQ(ArrayRef(InputData).take_back(), Buffer); } } @@ -316,7 +316,7 @@ TEST_F(BinaryStreamTest, DropOperations) { std::vector InputData = {1, 2, 3, 4, 5, 4, 3, 2, 1}; - auto RefData = makeArrayRef(InputData); + auto RefData = ArrayRef(InputData); initializeInput(InputData, 1); ArrayRef Result; @@ -383,7 +383,7 @@ ArrayRef Data2; ASSERT_THAT_ERROR(Stream.Output->readBytes(Offset, ExpectedSize, Data2), Succeeded()); - EXPECT_EQ(makeArrayRef(InputData).drop_front(Offset), Data2); + EXPECT_EQ(ArrayRef(InputData).drop_front(Offset), Data2); } std::vector BigData = {0, 1, 2, 3, 4}; @@ -397,7 +397,7 @@ EXPECT_EQ(0U, Stream.getLength()); std::vector InputData = {'T', 'e', 's', 't', 'T', 'e', 's', 't'}; - auto Test = makeArrayRef(InputData).take_front(4); + auto Test = ArrayRef(InputData).take_front(4); // Writing past the end of the stream is an error. EXPECT_THAT_ERROR(Stream.writeBytes(4, Test), Failed()); @@ -575,7 +575,7 @@ ArrayRef IntsRef; ASSERT_THAT_ERROR(Reader.readArray(IntsRef, Ints.size()), Succeeded()); ASSERT_EQ(0U, Reader.bytesRemaining()); - EXPECT_EQ(makeArrayRef(Ints), IntsRef); + EXPECT_EQ(ArrayRef(Ints), IntsRef); Reader.setOffset(0); FixedStreamArray FixedIntsRef; @@ -699,7 +699,7 @@ const uint8_t *Bytes = reinterpret_cast(&Foos[0]); - initializeInput(makeArrayRef(Bytes, 3 * sizeof(Foo)), alignof(Foo)); + initializeInput(ArrayRef(Bytes, 3 * sizeof(Foo)), alignof(Foo)); for (auto &Stream : Streams) { // 1. Reading object pointers. @@ -803,7 +803,7 @@ ASSERT_THAT_ERROR(ReaderBacker.readArray(Ints2, SourceInts.size()), Succeeded()); - EXPECT_EQ(makeArrayRef(SourceInts), Ints2); + EXPECT_EQ(ArrayRef(SourceInts), Ints2); } } @@ -827,7 +827,7 @@ ASSERT_THAT_ERROR(Reader.readCString(S), Succeeded()); InStrings.push_back(S); } - EXPECT_EQ(makeArrayRef(Strings), makeArrayRef(InStrings)); + EXPECT_EQ(ArrayRef(Strings), ArrayRef(InStrings)); } } Index: llvm/unittests/Support/CRCTest.cpp =================================================================== --- llvm/unittests/Support/CRCTest.cpp +++ llvm/unittests/Support/CRCTest.cpp @@ -55,7 +55,7 @@ // Test expectation generated with: // $ truncate --size=`echo 2^32-1+42 | bc` /tmp/foo // $ crc32 /tmp/foo - EXPECT_EQ(0xE46F28FBU, llvm::crc32(makeArrayRef(TestData, TestSize))); + EXPECT_EQ(0xE46F28FBU, llvm::crc32(ArrayRef(TestData, TestSize))); free(TestData); } Index: llvm/unittests/Support/CommandLineTest.cpp =================================================================== --- llvm/unittests/Support/CommandLineTest.cpp +++ llvm/unittests/Support/CommandLineTest.cpp @@ -436,7 +436,7 @@ const cl::OptionCategory *VisibleCategories[] = {&TestCategory, &TestCategory2}; - cl::HideUnrelatedOptions(makeArrayRef(VisibleCategories)); + cl::HideUnrelatedOptions(ArrayRef(VisibleCategories)); ASSERT_EQ(cl::ReallyHidden, TestOption1.getOptionHiddenFlag()) << "Failed to hide extra option."; Index: llvm/unittests/Support/ConvertUTFTest.cpp =================================================================== --- llvm/unittests/Support/ConvertUTFTest.cpp +++ llvm/unittests/Support/ConvertUTFTest.cpp @@ -75,7 +75,7 @@ TEST(ConvertUTFTest, OddLengthInput) { std::string Result; - bool Success = convertUTF16ToUTF8String(makeArrayRef("xxxxx", 5), Result); + bool Success = convertUTF16ToUTF8String(ArrayRef("xxxxx", 5), Result); EXPECT_FALSE(Success); } @@ -88,25 +88,25 @@ } TEST(ConvertUTFTest, HasUTF16BOM) { - bool HasBOM = hasUTF16ByteOrderMark(makeArrayRef("\xff\xfe", 2)); + bool HasBOM = hasUTF16ByteOrderMark(ArrayRef("\xff\xfe", 2)); EXPECT_TRUE(HasBOM); - HasBOM = hasUTF16ByteOrderMark(makeArrayRef("\xfe\xff", 2)); + HasBOM = hasUTF16ByteOrderMark(ArrayRef("\xfe\xff", 2)); EXPECT_TRUE(HasBOM); - HasBOM = hasUTF16ByteOrderMark(makeArrayRef("\xfe\xff ", 3)); + HasBOM = hasUTF16ByteOrderMark(ArrayRef("\xfe\xff ", 3)); EXPECT_TRUE(HasBOM); // Don't care about odd lengths. - HasBOM = hasUTF16ByteOrderMark(makeArrayRef("\xfe\xff\x00asdf", 6)); + HasBOM = hasUTF16ByteOrderMark(ArrayRef("\xfe\xff\x00asdf", 6)); EXPECT_TRUE(HasBOM); HasBOM = hasUTF16ByteOrderMark(std::nullopt); EXPECT_FALSE(HasBOM); - HasBOM = hasUTF16ByteOrderMark(makeArrayRef("\xfe", 1)); + HasBOM = hasUTF16ByteOrderMark(ArrayRef("\xfe", 1)); EXPECT_FALSE(HasBOM); } TEST(ConvertUTFTest, UTF16WrappersForConvertUTF16ToUTF8String) { // Src is the look of disapproval. alignas(UTF16) static const char Src[] = "\xff\xfe\xa0\x0c_\x00\xa0\x0c"; - ArrayRef SrcRef = makeArrayRef((const UTF16 *)Src, 4); + ArrayRef SrcRef = ArrayRef((const UTF16 *)Src, 4); std::string Result; bool Success = convertUTF16ToUTF8String(SrcRef, Result); EXPECT_TRUE(Success); Index: llvm/unittests/Support/HashBuilderTest.cpp =================================================================== --- llvm/unittests/Support/HashBuilderTest.cpp +++ llvm/unittests/Support/HashBuilderTest.cpp @@ -102,7 +102,7 @@ constexpr auto E = HE::Endianness; H Hasher; auto SwappedData = llvm::support::endian::byte_swap(Data, E); - Hasher.update(llvm::makeArrayRef( + Hasher.update(llvm::ArrayRef( reinterpret_cast(&SwappedData), sizeof(Data))); return Hasher.final(); }; @@ -157,8 +157,8 @@ friend void addHash(llvm::HashBuilderImpl &HBuilder, const StructWithFastHash &Value) { if (Endianness == llvm::support::endian::system_endianness()) { - HBuilder.update(llvm::makeArrayRef( - reinterpret_cast(&Value), sizeof(Value))); + HBuilder.update(llvm::ArrayRef(reinterpret_cast(&Value), + sizeof(Value))); } else { // Rely on existing `add` methods to handle endianness. HBuilder.add(Value.I); @@ -181,7 +181,7 @@ friend void addHash(llvm::HashBuilderImpl &HBuilder, const CustomContainer &Value) { if (Endianness == llvm::support::endian::system_endianness()) { - HBuilder.update(llvm::makeArrayRef( + HBuilder.update(llvm::ArrayRef( reinterpret_cast(&Value.Size), sizeof(Value.Size) + Value.Size * sizeof(Value.Elements[0]))); } else { Index: llvm/unittests/Support/IndexedAccessorTest.cpp =================================================================== --- llvm/unittests/Support/IndexedAccessorTest.cpp +++ llvm/unittests/Support/IndexedAccessorTest.cpp @@ -39,7 +39,7 @@ namespace { TEST(AccessorRange, SliceTest) { int rawData[] = {0, 1, 2, 3, 4}; - ArrayRef data = llvm::makeArrayRef(rawData); + ArrayRef data = llvm::ArrayRef(rawData); ArrayIndexedAccessorRange range(rawData, /*start=*/0, /*numElements=*/5); compareData(range, data); Index: llvm/unittests/Support/MD5Test.cpp =================================================================== --- llvm/unittests/Support/MD5Test.cpp +++ llvm/unittests/Support/MD5Test.cpp @@ -40,20 +40,20 @@ } TEST(MD5Test, MD5) { - TestMD5Sum(makeArrayRef((const uint8_t *)"", (size_t) 0), + TestMD5Sum(ArrayRef((const uint8_t *)"", (size_t)0), "d41d8cd98f00b204e9800998ecf8427e"); - TestMD5Sum(makeArrayRef((const uint8_t *)"a", (size_t) 1), + TestMD5Sum(ArrayRef((const uint8_t *)"a", (size_t)1), "0cc175b9c0f1b6a831c399e269772661"); - TestMD5Sum(makeArrayRef((const uint8_t *)"abcdefghijklmnopqrstuvwxyz", - (size_t) 26), - "c3fcd3d76192e4007dfb496cca67e13b"); - TestMD5Sum(makeArrayRef((const uint8_t *)"\0", (size_t) 1), + TestMD5Sum( + ArrayRef((const uint8_t *)"abcdefghijklmnopqrstuvwxyz", (size_t)26), + "c3fcd3d76192e4007dfb496cca67e13b"); + TestMD5Sum(ArrayRef((const uint8_t *)"\0", (size_t)1), "93b885adfe0da089cdf634904fd59f71"); - TestMD5Sum(makeArrayRef((const uint8_t *)"a\0", (size_t) 2), + TestMD5Sum(ArrayRef((const uint8_t *)"a\0", (size_t)2), "4144e195f46de78a3623da7364d04f11"); - TestMD5Sum(makeArrayRef((const uint8_t *)"abcdefghijklmnopqrstuvwxyz\0", - (size_t) 27), - "81948d1f1554f58cd1a56ebb01f808cb"); + TestMD5Sum( + ArrayRef((const uint8_t *)"abcdefghijklmnopqrstuvwxyz\0", (size_t)27), + "81948d1f1554f58cd1a56ebb01f808cb"); TestMD5Sum("abcdefghijklmnopqrstuvwxyz", "c3fcd3d76192e4007dfb496cca67e13b"); } Index: llvm/unittests/Support/ScopedPrinterTest.cpp =================================================================== --- llvm/unittests/Support/ScopedPrinterTest.cpp +++ llvm/unittests/Support/ScopedPrinterTest.cpp @@ -226,8 +226,8 @@ {"Name3", "AltName3", 3}, {"Name4", "AltName4", 2}}; EnumEntry OtherEnum{"Name5", "AltName5", 5}; - W.printEnum("Exists", EnumList[1].Value, makeArrayRef(EnumList)); - W.printEnum("DoesNotExist", OtherEnum.Value, makeArrayRef(EnumList)); + W.printEnum("Exists", EnumList[1].Value, ArrayRef(EnumList)); + W.printEnum("DoesNotExist", OtherEnum.Value, ArrayRef(EnumList)); }; const char *ExpectedOut = R"(Exists: Name2 (0x2) @@ -259,11 +259,10 @@ {"SecondByte2", "Second2", 0x20u}, {"SecondByte3", "Second3", 0x30u}, {"ThirdByte1", "Third1", 0x100u}, {"ThirdByte2", "Third2", 0x200u}, {"ThirdByte3", "Third3", 0x300u}}; - W.printFlags("ZeroFlag", 0, makeArrayRef(SingleBitFlags)); - W.printFlags("NoFlag", 1 << 3, makeArrayRef(SingleBitFlags)); - W.printFlags("Flag1", SingleBitFlags[1].Value, - makeArrayRef(SingleBitFlags)); - W.printFlags("Flag1&3", (1 << 2) + 1, makeArrayRef(SingleBitFlags)); + W.printFlags("ZeroFlag", 0, ArrayRef(SingleBitFlags)); + W.printFlags("NoFlag", 1 << 3, ArrayRef(SingleBitFlags)); + W.printFlags("Flag1", SingleBitFlags[1].Value, ArrayRef(SingleBitFlags)); + W.printFlags("Flag1&3", (1 << 2) + 1, ArrayRef(SingleBitFlags)); W.printFlags("ZeroFlagRaw", 0); W.printFlags("NoFlagRaw", 1 << 3); @@ -271,21 +270,19 @@ W.printFlags("Flag1&3Raw", (1 << 2) + 1); W.printFlags("FlagSorted", (1 << 2) + (1 << 1) + 1, - makeArrayRef(UnsortedFlags)); + ArrayRef(UnsortedFlags)); uint16_t NoBitMask = 0; uint16_t FirstByteMask = 0xFu; uint16_t SecondByteMask = 0xF0u; uint16_t ThirdByteMask = 0xF00u; - W.printFlags("NoBitMask", 0xFFFu, makeArrayRef(EnumFlags), NoBitMask); - W.printFlags("FirstByteMask", 0x3u, makeArrayRef(EnumFlags), FirstByteMask); - W.printFlags("SecondByteMask", 0x30u, makeArrayRef(EnumFlags), - SecondByteMask); - W.printFlags("ValueOutsideMask", 0x1u, makeArrayRef(EnumFlags), - SecondByteMask); - W.printFlags("FirstSecondByteMask", 0xFFu, makeArrayRef(EnumFlags), + W.printFlags("NoBitMask", 0xFFFu, ArrayRef(EnumFlags), NoBitMask); + W.printFlags("FirstByteMask", 0x3u, ArrayRef(EnumFlags), FirstByteMask); + W.printFlags("SecondByteMask", 0x30u, ArrayRef(EnumFlags), SecondByteMask); + W.printFlags("ValueOutsideMask", 0x1u, ArrayRef(EnumFlags), SecondByteMask); + W.printFlags("FirstSecondByteMask", 0xFFu, ArrayRef(EnumFlags), FirstByteMask, SecondByteMask); - W.printFlags("FirstSecondThirdByteMask", 0x333u, makeArrayRef(EnumFlags), + W.printFlags("FirstSecondThirdByteMask", 0x333u, ArrayRef(EnumFlags), FirstByteMask, SecondByteMask, ThirdByteMask); }; @@ -662,7 +659,7 @@ APSInt("-9999999999999999999999")}; W.printList("EmptyList", EmptyList); W.printList("StringList", StringList); - W.printList("BoolList", makeArrayRef(BoolList)); + W.printList("BoolList", ArrayRef(BoolList)); W.printList("uint64List", Unsigned64List); W.printList("uint32List", Unsigned32List); W.printList("uint16List", Unsigned16List); Index: llvm/unittests/Support/SourceMgrTest.cpp =================================================================== --- llvm/unittests/Support/SourceMgrTest.cpp +++ llvm/unittests/Support/SourceMgrTest.cpp @@ -511,7 +511,7 @@ TEST_F(SourceMgrTest, BasicFixit) { setMainBuffer("aaa bbb\nccc ddd\n", "file.in"); printMessage(getLoc(4), SourceMgr::DK_Error, "message", std::nullopt, - makeArrayRef(SMFixIt(getRange(4, 3), "zzz"))); + ArrayRef(SMFixIt(getRange(4, 3), "zzz"))); EXPECT_EQ("file.in:1:5: error: message\n" "aaa bbb\n" @@ -523,7 +523,7 @@ TEST_F(SourceMgrTest, FixitForTab) { setMainBuffer("aaa\tbbb\nccc ddd\n", "file.in"); printMessage(getLoc(3), SourceMgr::DK_Error, "message", std::nullopt, - makeArrayRef(SMFixIt(getRange(3, 1), "zzz"))); + ArrayRef(SMFixIt(getRange(3, 1), "zzz"))); EXPECT_EQ("file.in:1:4: error: message\n" "aaa bbb\n" Index: llvm/unittests/TableGen/AutomataTest.cpp =================================================================== --- llvm/unittests/TableGen/AutomataTest.cpp +++ llvm/unittests/TableGen/AutomataTest.cpp @@ -30,7 +30,7 @@ #include "AutomataAutomata.inc" TEST(Automata, SimpleAutomatonAcceptsFromInitialState) { - Automaton A(makeArrayRef(SimpleAutomatonTransitions)); + Automaton A{ArrayRef(SimpleAutomatonTransitions)}; EXPECT_TRUE(A.add(SK_a)); A.reset(); EXPECT_TRUE(A.add(SK_b)); @@ -41,7 +41,7 @@ } TEST(Automata, SimpleAutomatonAcceptsSequences) { - Automaton A(makeArrayRef(SimpleAutomatonTransitions)); + Automaton A{ArrayRef(SimpleAutomatonTransitions)}; // Test sequence A.reset(); EXPECT_TRUE(A.add(SK_a)); @@ -59,7 +59,7 @@ } TEST(Automata, TupleAutomatonAccepts) { - Automaton A(makeArrayRef(TupleAutomatonTransitions)); + Automaton A{ArrayRef(TupleAutomatonTransitions)}; A.reset(); EXPECT_TRUE( A.add(TupleAutomatonAction{SK_a, SK_b, "yeet"})); @@ -75,7 +75,7 @@ } TEST(Automata, NfaAutomatonAccepts) { - Automaton A(makeArrayRef(NfaAutomatonTransitions)); + Automaton A{ArrayRef(NfaAutomatonTransitions)}; // Test sequences , , , . All should be accepted. A.reset(); @@ -99,7 +99,8 @@ } TEST(Automata, BinPackerAutomatonAccepts) { - Automaton A(makeArrayRef(BinPackerAutomatonTransitions)); + Automaton A{ + ArrayRef(BinPackerAutomatonTransitions)}; // Expect that we can pack two double-bins in 0-4, then no more in 0-4. A.reset(); @@ -129,8 +130,9 @@ ((a << 5) | (b << 4) | (c << 3) | (d << 2) | (e << 1) | (f << 0)) TEST(Automata, BinPackerAutomatonExplains) { - Automaton A(makeArrayRef(BinPackerAutomatonTransitions), - makeArrayRef(BinPackerAutomatonTransitionInfo)); + Automaton A{ + ArrayRef(BinPackerAutomatonTransitions), + ArrayRef(BinPackerAutomatonTransitionInfo)}; // Pack two double-bins in 0-4, then a single bin in 0-6. EXPECT_TRUE(A.add(BRK_0_to_4_dbl)); EXPECT_TRUE(A.add(BRK_0_to_4_dbl)); Index: llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp =================================================================== --- llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp +++ llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp @@ -37,9 +37,9 @@ MCInstrInfo MII; MCRegisterInfo MRI; MCSubtargetInfo STI(Triple(""), "", "", "", - makeArrayRef((SubtargetFeatureKV *)NULL, 0), - makeArrayRef((SubtargetSubTypeKV *)NULL, 0), NULL, NULL, - NULL, NULL, NULL, NULL); + ArrayRef((SubtargetFeatureKV *)NULL, 0), + ArrayRef((SubtargetSubTypeKV *)NULL, 0), NULL, NULL, NULL, + NULL, NULL, NULL); MCContext Ctx(Triple(""), &MAI, &MRI, &STI); MCInst MI; Index: llvm/utils/TableGen/AsmWriterEmitter.cpp =================================================================== --- llvm/utils/TableGen/AsmWriterEmitter.cpp +++ llvm/utils/TableGen/AsmWriterEmitter.cpp @@ -1177,9 +1177,9 @@ O << "#endif\n\n"; O.indent(2) << "AliasMatchingData M {\n"; - O.indent(2) << " makeArrayRef(OpToPatterns),\n"; - O.indent(2) << " makeArrayRef(Patterns),\n"; - O.indent(2) << " makeArrayRef(Conds),\n"; + O.indent(2) << " ArrayRef(OpToPatterns),\n"; + O.indent(2) << " ArrayRef(Patterns),\n"; + O.indent(2) << " ArrayRef(Conds),\n"; O.indent(2) << " StringRef(AsmStrings, std::size(AsmStrings)),\n"; if (MCOpPredicates.empty()) O.indent(2) << " nullptr,\n"; Index: llvm/utils/TableGen/CodeEmitterGen.cpp =================================================================== --- llvm/utils/TableGen/CodeEmitterGen.cpp +++ llvm/utils/TableGen/CodeEmitterGen.cpp @@ -517,9 +517,8 @@ o << " const unsigned opcode = MI.getOpcode();\n" << " if (Scratch.getBitWidth() != " << BitWidth << ")\n" << " Scratch = Scratch.zext(" << BitWidth << ");\n" - << " Inst = APInt(" << BitWidth - << ", makeArrayRef(InstBits + opcode * " << NumWords << ", " << NumWords - << "));\n" + << " Inst = APInt(" << BitWidth << ", ArrayRef(InstBits + opcode * " + << NumWords << ", " << NumWords << "));\n" << " APInt &Value = Inst;\n" << " APInt &op = Scratch;\n" << " switch (opcode) {\n"; Index: llvm/utils/TableGen/CodeGenRegisters.h =================================================================== --- llvm/utils/TableGen/CodeGenRegisters.h +++ llvm/utils/TableGen/CodeGenRegisters.h @@ -234,7 +234,7 @@ const RegUnitList &getRegUnits() const { return RegUnits; } ArrayRef getRegUnitLaneMasks() const { - return makeArrayRef(RegUnitLaneMasks).slice(0, NativeRegUnits.count()); + return ArrayRef(RegUnitLaneMasks).slice(0, NativeRegUnits.count()); } // Get the native register units. This is a prefix of getRegUnits(). @@ -531,7 +531,7 @@ ArrayRef getRoots() const { assert(!(Roots[1] && !Roots[0]) && "Invalid roots array"); - return makeArrayRef(Roots, !!Roots[0] + !!Roots[1]); + return ArrayRef(Roots, !!Roots[0] + !!Roots[1]); } }; Index: llvm/utils/TableGen/CodeGenSchedule.h =================================================================== --- llvm/utils/TableGen/CodeGenSchedule.h +++ llvm/utils/TableGen/CodeGenSchedule.h @@ -145,8 +145,7 @@ bool isKeyEqual(Record *IC, ArrayRef W, ArrayRef R) const { - return ItinClassDef == IC && makeArrayRef(Writes) == W && - makeArrayRef(Reads) == R; + return ItinClassDef == IC && ArrayRef(Writes) == W && ArrayRef(Reads) == R; } // Is this class generated from a variants if existing classes? Instructions Index: llvm/utils/TableGen/CodeGenSchedule.cpp =================================================================== --- llvm/utils/TableGen/CodeGenSchedule.cpp +++ llvm/utils/TableGen/CodeGenSchedule.cpp @@ -838,7 +838,7 @@ std::vector &RWVec = IsRead ? SchedReads : SchedWrites; auto I = find_if(RWVec, [Seq](CodeGenSchedRW &RW) { - return makeArrayRef(RW.Sequence) == Seq; + return ArrayRef(RW.Sequence) == Seq; }); // Index zero reserved for invalid RW. return I == RWVec.end() ? 0 : std::distance(RWVec.begin(), I); Index: llvm/utils/TableGen/GlobalISelEmitter.cpp =================================================================== --- llvm/utils/TableGen/GlobalISelEmitter.cpp +++ llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -4423,7 +4423,7 @@ // Treat G_BUILD_VECTOR as the canonical opcode, and G_BUILD_VECTOR_TRUNC // as an alternative. InsnOperand.getInsnMatcher().addPredicate( - makeArrayRef({&BuildVector, &BuildVectorTrunc})); + ArrayRef({&BuildVector, &BuildVectorTrunc})); // TODO: Handle both G_BUILD_VECTOR and G_BUILD_VECTOR_TRUNC We could // theoretically not emit any opcode check, but getOpcodeMatcher currently Index: llvm/utils/TableGen/IntrinsicEmitter.cpp =================================================================== --- llvm/utils/TableGen/IntrinsicEmitter.cpp +++ llvm/utils/TableGen/IntrinsicEmitter.cpp @@ -860,7 +860,7 @@ OS << " }\n"; OS << " }\n"; - OS << " return AttributeList::get(C, makeArrayRef(AS, NumAttrs));\n"; + OS << " return AttributeList::get(C, ArrayRef(AS, NumAttrs));\n"; OS << "}\n"; OS << "#endif // GET_INTRINSIC_ATTRIBUTES\n\n"; } Index: llvm/utils/TableGen/PseudoLoweringEmitter.cpp =================================================================== --- llvm/utils/TableGen/PseudoLoweringEmitter.cpp +++ llvm/utils/TableGen/PseudoLoweringEmitter.cpp @@ -301,7 +301,7 @@ void PseudoLoweringEmitter::run(raw_ostream &o) { StringRef Classes[] = {"PseudoInstExpansion", "Instruction"}; std::vector Insts = - Records.getAllDerivedDefinitions(makeArrayRef(Classes)); + Records.getAllDerivedDefinitions(ArrayRef(Classes)); // Process the pseudo expansion definitions, validating them as we do so. Records.startTimer("Process definitions"); Index: llvm/utils/TableGen/RegisterInfoEmitter.cpp =================================================================== --- llvm/utils/TableGen/RegisterInfoEmitter.cpp +++ llvm/utils/TableGen/RegisterInfoEmitter.cpp @@ -1408,12 +1408,12 @@ OS << " const MCRegisterClass &MCR = " << Target.getName() << "MCRegisterClasses[" << RC.getQualifiedName() + "RegClassID];\n" << " const ArrayRef Order[] = {\n" - << " makeArrayRef(MCR.begin(), MCR.getNumRegs()"; + << " ArrayRef(MCR.begin(), MCR.getNumRegs()"; for (unsigned oi = 1, oe = RC.getNumOrders(); oi != oe; ++oi) if (RC.getOrder(oi).empty()) OS << "),\n ArrayRef("; else - OS << "),\n makeArrayRef(AltOrder" << oi; + OS << "),\n ArrayRef(AltOrder" << oi; OS << ")\n };\n const unsigned Select = " << RC.getName() << "AltOrderSelect(MF);\n assert(Select < " << RC.getNumOrders() << ");\n return Order[Select];\n}\n"; @@ -1740,7 +1740,7 @@ for (Record *CSRSet : CSRSets) OS << " " << CSRSet->getName() << "_RegMask,\n"; OS << " };\n"; - OS << " return makeArrayRef(Masks);\n"; + OS << " return ArrayRef(Masks);\n"; } else { OS << " return std::nullopt;\n"; } @@ -1806,7 +1806,7 @@ for (Record *CSRSet : CSRSets) OS << " " << '"' << CSRSet->getName() << '"' << ",\n"; OS << " };\n"; - OS << " return makeArrayRef(Names);\n"; + OS << " return ArrayRef(Names);\n"; } else { OS << " return std::nullopt;\n"; } Index: llvm/utils/TableGen/SearchableTableEmitter.cpp =================================================================== --- llvm/utils/TableGen/SearchableTableEmitter.cpp +++ llvm/utils/TableGen/SearchableTableEmitter.cpp @@ -378,7 +378,7 @@ } if (IsContiguous) { - OS << " auto Table = makeArrayRef(" << IndexName << ");\n"; + OS << " auto Table = ArrayRef(" << IndexName << ");\n"; OS << " size_t Idx = " << Index.Fields[0].Name << ";\n"; OS << " return Idx >= Table.size() ? nullptr : "; if (IsPrimary) @@ -423,7 +423,7 @@ } OS << "};\n"; - OS << " auto Table = makeArrayRef(" << IndexName << ");\n"; + OS << " auto Table = ArrayRef(" << IndexName << ");\n"; OS << " auto Idx = std::lower_bound(Table.begin(), Table.end(), Key,\n"; OS << " [](const " << IndexTypeName << " &LHS, const KeyType &RHS) {\n"; Index: llvm/utils/TableGen/SubtargetEmitter.cpp =================================================================== --- llvm/utils/TableGen/SubtargetEmitter.cpp +++ llvm/utils/TableGen/SubtargetEmitter.cpp @@ -1953,11 +1953,11 @@ << "StringRef TuneCPU, StringRef FS)\n" << " : TargetSubtargetInfo(TT, CPU, TuneCPU, FS, "; if (NumFeatures) - OS << "makeArrayRef(" << Target << "FeatureKV, " << NumFeatures << "), "; + OS << "ArrayRef(" << Target << "FeatureKV, " << NumFeatures << "), "; else OS << "std::nullopt, "; if (NumProcs) - OS << "makeArrayRef(" << Target << "SubTypeKV, " << NumProcs << "), "; + OS << "ArrayRef(" << Target << "SubTypeKV, " << NumProcs << "), "; else OS << "None, "; OS << '\n'; OS.indent(24); Index: mlir/examples/toy/Ch2/mlir/MLIRGen.cpp =================================================================== --- mlir/examples/toy/Ch2/mlir/MLIRGen.cpp +++ mlir/examples/toy/Ch2/mlir/MLIRGen.cpp @@ -34,7 +34,6 @@ using llvm::cast; using llvm::dyn_cast; using llvm::isa; -using llvm::makeArrayRef; using llvm::ScopedHashTableScope; using llvm::SmallVector; using llvm::StringRef; @@ -226,8 +225,8 @@ } // Otherwise, this return operation has zero operands. - builder.create(location, expr ? makeArrayRef(expr) - : ArrayRef()); + builder.create(location, + expr ? ArrayRef(expr) : ArrayRef()); return mlir::success(); } @@ -267,7 +266,7 @@ // This is the actual attribute that holds the list of values for this // tensor literal. auto dataAttribute = - mlir::DenseElementsAttr::get(dataType, llvm::makeArrayRef(data)); + mlir::DenseElementsAttr::get(dataType, llvm::ArrayRef(data)); // Build the MLIR op `toy.constant`. This invokes the `ConstantOp::build` // method. Index: mlir/examples/toy/Ch3/mlir/MLIRGen.cpp =================================================================== --- mlir/examples/toy/Ch3/mlir/MLIRGen.cpp +++ mlir/examples/toy/Ch3/mlir/MLIRGen.cpp @@ -34,7 +34,6 @@ using llvm::cast; using llvm::dyn_cast; using llvm::isa; -using llvm::makeArrayRef; using llvm::ScopedHashTableScope; using llvm::SmallVector; using llvm::StringRef; @@ -226,8 +225,8 @@ } // Otherwise, this return operation has zero operands. - builder.create(location, expr ? makeArrayRef(expr) - : ArrayRef()); + builder.create(location, + expr ? ArrayRef(expr) : ArrayRef()); return mlir::success(); } @@ -267,7 +266,7 @@ // This is the actual attribute that holds the list of values for this // tensor literal. auto dataAttribute = - mlir::DenseElementsAttr::get(dataType, llvm::makeArrayRef(data)); + mlir::DenseElementsAttr::get(dataType, llvm::ArrayRef(data)); // Build the MLIR op `toy.constant`. This invokes the `ConstantOp::build` // method. Index: mlir/examples/toy/Ch4/mlir/MLIRGen.cpp =================================================================== --- mlir/examples/toy/Ch4/mlir/MLIRGen.cpp +++ mlir/examples/toy/Ch4/mlir/MLIRGen.cpp @@ -34,7 +34,6 @@ using llvm::cast; using llvm::dyn_cast; using llvm::isa; -using llvm::makeArrayRef; using llvm::ScopedHashTableScope; using llvm::SmallVector; using llvm::StringRef; @@ -230,8 +229,8 @@ } // Otherwise, this return operation has zero operands. - builder.create(location, expr ? makeArrayRef(expr) - : ArrayRef()); + builder.create(location, + expr ? ArrayRef(expr) : ArrayRef()); return mlir::success(); } @@ -271,7 +270,7 @@ // This is the actual attribute that holds the list of values for this // tensor literal. auto dataAttribute = - mlir::DenseElementsAttr::get(dataType, llvm::makeArrayRef(data)); + mlir::DenseElementsAttr::get(dataType, llvm::ArrayRef(data)); // Build the MLIR op `toy.constant`. This invokes the `ConstantOp::build` // method. Index: mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp =================================================================== --- mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp +++ mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp @@ -177,7 +177,7 @@ if (dimension == valueShape.size()) { rewriter.create( loc, rewriter.create(loc, *valueIt++), alloc, - llvm::makeArrayRef(indices)); + llvm::ArrayRef(indices)); return; } Index: mlir/examples/toy/Ch5/mlir/MLIRGen.cpp =================================================================== --- mlir/examples/toy/Ch5/mlir/MLIRGen.cpp +++ mlir/examples/toy/Ch5/mlir/MLIRGen.cpp @@ -34,7 +34,6 @@ using llvm::cast; using llvm::dyn_cast; using llvm::isa; -using llvm::makeArrayRef; using llvm::ScopedHashTableScope; using llvm::SmallVector; using llvm::StringRef; @@ -230,8 +229,8 @@ } // Otherwise, this return operation has zero operands. - builder.create(location, expr ? makeArrayRef(expr) - : ArrayRef()); + builder.create(location, + expr ? ArrayRef(expr) : ArrayRef()); return mlir::success(); } @@ -271,7 +270,7 @@ // This is the actual attribute that holds the list of values for this // tensor literal. auto dataAttribute = - mlir::DenseElementsAttr::get(dataType, llvm::makeArrayRef(data)); + mlir::DenseElementsAttr::get(dataType, llvm::ArrayRef(data)); // Build the MLIR op `toy.constant`. This invokes the `ConstantOp::build` // method. Index: mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp =================================================================== --- mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp +++ mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp @@ -177,7 +177,7 @@ if (dimension == valueShape.size()) { rewriter.create( loc, rewriter.create(loc, *valueIt++), alloc, - llvm::makeArrayRef(indices)); + llvm::ArrayRef(indices)); return; } Index: mlir/examples/toy/Ch6/mlir/MLIRGen.cpp =================================================================== --- mlir/examples/toy/Ch6/mlir/MLIRGen.cpp +++ mlir/examples/toy/Ch6/mlir/MLIRGen.cpp @@ -34,7 +34,6 @@ using llvm::cast; using llvm::dyn_cast; using llvm::isa; -using llvm::makeArrayRef; using llvm::ScopedHashTableScope; using llvm::SmallVector; using llvm::StringRef; @@ -230,8 +229,8 @@ } // Otherwise, this return operation has zero operands. - builder.create(location, expr ? makeArrayRef(expr) - : ArrayRef()); + builder.create(location, + expr ? ArrayRef(expr) : ArrayRef()); return mlir::success(); } @@ -271,7 +270,7 @@ // This is the actual attribute that holds the list of values for this // tensor literal. auto dataAttribute = - mlir::DenseElementsAttr::get(dataType, llvm::makeArrayRef(data)); + mlir::DenseElementsAttr::get(dataType, llvm::ArrayRef(data)); // Build the MLIR op `toy.constant`. This invokes the `ConstantOp::build` // method. Index: mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp =================================================================== --- mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp +++ mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp @@ -177,7 +177,7 @@ if (dimension == valueShape.size()) { rewriter.create( loc, rewriter.create(loc, *valueIt++), alloc, - llvm::makeArrayRef(indices)); + llvm::ArrayRef(indices)); return; } Index: mlir/examples/toy/Ch7/mlir/MLIRGen.cpp =================================================================== --- mlir/examples/toy/Ch7/mlir/MLIRGen.cpp +++ mlir/examples/toy/Ch7/mlir/MLIRGen.cpp @@ -34,7 +34,6 @@ using llvm::cast; using llvm::dyn_cast; using llvm::isa; -using llvm::makeArrayRef; using llvm::ScopedHashTableScope; using llvm::SmallVector; using llvm::StringRef; @@ -363,8 +362,8 @@ } // Otherwise, this return operation has zero operands. - builder.create(location, expr ? makeArrayRef(expr) - : ArrayRef()); + builder.create(location, + expr ? ArrayRef(expr) : ArrayRef()); return mlir::success(); } @@ -401,7 +400,7 @@ // This is the actual attribute that holds the list of values for this // tensor literal. - return mlir::DenseElementsAttr::get(dataType, llvm::makeArrayRef(data)); + return mlir::DenseElementsAttr::get(dataType, llvm::ArrayRef(data)); } mlir::DenseElementsAttr getConstantAttr(NumberExprAST &lit) { // The type of this attribute is tensor of 64-bit floating-point with no @@ -412,7 +411,7 @@ // This is the actual attribute that holds the list of values for this // tensor literal. return mlir::DenseElementsAttr::get(dataType, - llvm::makeArrayRef(lit.getValue())); + llvm::ArrayRef(lit.getValue())); } /// Emit a constant for a struct literal. It will be emitted as an array of /// other literals in an Attribute attached to a `toy.struct_constant` Index: mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td =================================================================== --- mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td +++ mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td @@ -98,7 +98,7 @@ let builders = [OpBuilder<(ins "::mlir::Type":$result, "::mlir::Value":$lhs, "::mlir::Value":$rhs, "/*optional*/ ::mlir::StringAttr":$error), [{ - build($_builder, $_state, result, ::llvm::makeArrayRef({lhs, rhs}), error); + build($_builder, $_state, result, ::llvm::ArrayRef({lhs, rhs}), error); }]> ]; @@ -210,7 +210,7 @@ // Convenience builder alias for the binary version. let builders = [ OpBuilder<(ins "::mlir::Value":$lhs, "::mlir::Value":$rhs), - [{ build($_builder, $_state, ::llvm::makeArrayRef({lhs, rhs})); }]>, + [{ build($_builder, $_state, ::llvm::ArrayRef({lhs, rhs})); }]>, ]; let assemblyFormat = "$shapes attr-dict `:` type($shapes)"; @@ -276,7 +276,7 @@ let builders = [ OpBuilder<(ins "::mlir::Value":$lhs, "::mlir::Value":$rhs), - [{ build($_builder, $_state, ::llvm::makeArrayRef({lhs, rhs})); }]>, + [{ build($_builder, $_state, ::llvm::ArrayRef({lhs, rhs})); }]>, ]; let hasFolder = 1; @@ -966,7 +966,7 @@ let builders = [ OpBuilder<(ins "::mlir::Value":$lhs, "::mlir::Value":$rhs), - [{ build($_builder, $_state, ::llvm::makeArrayRef({lhs, rhs})); }]>, + [{ build($_builder, $_state, ::llvm::ArrayRef({lhs, rhs})); }]>, ]; let hasCanonicalizer = 1; Index: mlir/include/mlir/Dialect/Tosa/Utils/ShapeUtils.h =================================================================== --- mlir/include/mlir/Dialect/Tosa/Utils/ShapeUtils.h +++ mlir/include/mlir/Dialect/Tosa/Utils/ShapeUtils.h @@ -68,7 +68,7 @@ Type getType() const { if (hasRank) - return RankedTensorType::get(llvm::makeArrayRef(sizes), dtype); + return RankedTensorType::get(llvm::ArrayRef(sizes), dtype); return UnrankedTensorType::get(dtype); } Index: mlir/include/mlir/IR/AsmState.h =================================================================== --- mlir/include/mlir/IR/AsmState.h +++ mlir/include/mlir/IR/AsmState.h @@ -144,8 +144,7 @@ /// known to be of the correct type. template ArrayRef getDataAs() const { - return llvm::makeArrayRef((const T *)data.data(), - data.size() / sizeof(T)); + return llvm::ArrayRef((const T *)data.data(), data.size() / sizeof(T)); } /// Return a mutable reference to the raw underlying data of this blob. Index: mlir/include/mlir/IR/AttrTypeBase.td =================================================================== --- mlir/include/mlir/IR/AttrTypeBase.td +++ mlir/include/mlir/IR/AttrTypeBase.td @@ -368,7 +368,7 @@ OptionalParameter<"::llvm::ArrayRef<" # arrayOf # ">", desc> { let allocator = [{$_dst = $_allocator.copyInto($_self);}]; let cppStorageType = "::llvm::SmallVector<" # arrayOf # ">"; - let comparator = "::llvm::makeArrayRef($_lhs) == ::llvm::makeArrayRef($_rhs)"; + let comparator = "::llvm::ArrayRef($_lhs) == ::llvm::ArrayRef($_rhs)"; } // For classes which require allocation and have their own allocateInto method. Index: mlir/include/mlir/IR/BuiltinAttributes.h =================================================================== --- mlir/include/mlir/IR/BuiltinAttributes.h +++ mlir/include/mlir/IR/BuiltinAttributes.h @@ -125,7 +125,7 @@ is_valid_cpp_fp_type::value || detail::is_complex_t::value>> static DenseElementsAttr get(const ShapedType &type, T value) { - return get(type, llvm::makeArrayRef(value)); + return get(type, llvm::ArrayRef(value)); } /// Constructs a dense complex elements attribute from an array of complex @@ -911,7 +911,7 @@ /// simply wraps the DenseElementsAttr::get calls. template static DenseFPElementsAttr get(const ShapedType &type, Arg &&arg) { - return DenseElementsAttr::get(type, llvm::makeArrayRef(arg)) + return DenseElementsAttr::get(type, llvm::ArrayRef(arg)) .template cast(); } template @@ -953,7 +953,7 @@ /// simply wraps the DenseElementsAttr::get calls. template static DenseIntElementsAttr get(const ShapedType &type, Arg &&arg) { - return DenseElementsAttr::get(type, llvm::makeArrayRef(arg)) + return DenseElementsAttr::get(type, llvm::ArrayRef(arg)) .template cast(); } template Index: mlir/include/mlir/IR/OpBase.td =================================================================== --- mlir/include/mlir/IR/OpBase.td +++ mlir/include/mlir/IR/OpBase.td @@ -1363,7 +1363,7 @@ let constBuilderCall = "::mlir::DenseElementsAttr::get(" "::mlir::RankedTensorType::get({}, " "$_builder.getIntegerType(" # width # ")), " - "::llvm::makeArrayRef($0)).cast<::mlir::DenseIntElementsAttr>()"; + "::llvm::ArrayRef($0)).cast<::mlir::DenseIntElementsAttr>()"; } def I32ElementsAttr : SignlessIntElementsAttr<32>; @@ -1384,7 +1384,7 @@ let constBuilderCall = "::mlir::DenseIntElementsAttr::get(" "::mlir::RankedTensorType::get({" # !interleave(dims, ", ") # - "}, $_builder.getIntegerType(" # width # ")), ::llvm::makeArrayRef($0))"; + "}, $_builder.getIntegerType(" # width # ")), ::llvm::ArrayRef($0))"; } class RankedI32ElementsAttr dims> : @@ -1404,7 +1404,7 @@ // Note that this is only constructing scalar elements attribute. let constBuilderCall = "::mlir::DenseElementsAttr::get(" "::mlir::RankedTensorType::get({}, $_builder.getF" # width # "Type())," - "::llvm::makeArrayRef($0))"; + "::llvm::ArrayRef($0))"; let convertFromStorage = "$_self"; } @@ -1429,7 +1429,7 @@ let constBuilderCall = "::mlir::DenseElementsAttr::get(" "::mlir::RankedTensorType::get({" # !interleave(dims, ", ") # "}, $_builder.getF" # width # "Type()), " - "::llvm::makeArrayRef($0)).cast<::mlir::DenseFPElementsAttr>()"; + "::llvm::ArrayRef($0)).cast<::mlir::DenseFPElementsAttr>()"; let convertFromStorage = "$_self"; } Index: mlir/include/mlir/IR/OpDefinition.h =================================================================== --- mlir/include/mlir/IR/OpDefinition.h +++ mlir/include/mlir/IR/OpDefinition.h @@ -1251,8 +1251,7 @@ return op->emitOpError() << "expects parent op " << (sizeof...(ParentOpTypes) != 1 ? "to be one of '" : "'") - << llvm::makeArrayRef({ParentOpTypes::getOperationName()...}) - << "'"; + << llvm::ArrayRef({ParentOpTypes::getOperationName()...}) << "'"; } }; }; Index: mlir/lib/Analysis/Presburger/PresburgerSpace.cpp =================================================================== --- mlir/lib/Analysis/Presburger/PresburgerSpace.cpp +++ mlir/lib/Analysis/Presburger/PresburgerSpace.cpp @@ -170,10 +170,9 @@ "alignment."); ArrayRef kindAttachments = - makeArrayRef(identifiers) - .slice(getVarKindOffset(kind), getNumVarKind(kind)); + ArrayRef(identifiers).slice(getVarKindOffset(kind), getNumVarKind(kind)); ArrayRef otherKindAttachments = - makeArrayRef(other.identifiers) + ArrayRef(other.identifiers) .slice(other.getVarKindOffset(kind), other.getNumVarKind(kind)); return kindAttachments == otherKindAttachments; } Index: mlir/lib/AsmParser/AsmParserState.cpp =================================================================== --- mlir/lib/AsmParser/AsmParserState.cpp +++ mlir/lib/AsmParser/AsmParserState.cpp @@ -102,7 +102,7 @@ // Access State auto AsmParserState::getBlockDefs() const -> iterator_range { - return llvm::make_pointee_range(llvm::makeArrayRef(impl->blocks)); + return llvm::make_pointee_range(llvm::ArrayRef(impl->blocks)); } auto AsmParserState::getBlockDef(Block *block) const @@ -112,7 +112,7 @@ } auto AsmParserState::getOpDefs() const -> iterator_range { - return llvm::make_pointee_range(llvm::makeArrayRef(impl->operations)); + return llvm::make_pointee_range(llvm::ArrayRef(impl->operations)); } auto AsmParserState::getOpDef(Operation *op) const Index: mlir/lib/AsmParser/AttributeParser.cpp =================================================================== --- mlir/lib/AsmParser/AttributeParser.cpp +++ mlir/lib/AsmParser/AttributeParser.cpp @@ -575,7 +575,7 @@ return nullptr; if (isComplex) { // If this is a complex, treat the parsed values as complex values. - auto complexData = llvm::makeArrayRef( + auto complexData = llvm::ArrayRef( reinterpret_cast *>(intValues.data()), intValues.size() / 2); return DenseElementsAttr::get(type, complexData); @@ -589,7 +589,7 @@ return nullptr; if (isComplex) { // If this is a complex, treat the parsed values as complex values. - auto complexData = llvm::makeArrayRef( + auto complexData = llvm::ArrayRef( reinterpret_cast *>(floatValues.data()), floatValues.size() / 2); return DenseElementsAttr::get(type, complexData); Index: mlir/lib/Bindings/Python/IRCore.cpp =================================================================== --- mlir/lib/Bindings/Python/IRCore.cpp +++ mlir/lib/Bindings/Python/IRCore.cpp @@ -2496,7 +2496,7 @@ throw py::value_error("No caller frames provided"); MlirLocation caller = frames.back().get(); for (const PyLocation &frame : - llvm::reverse(llvm::makeArrayRef(frames).drop_back())) + llvm::reverse(llvm::ArrayRef(frames).drop_back())) caller = mlirLocationCallSiteGet(frame.get(), caller); return PyLocation(context->getRef(), mlirLocationCallSiteGet(callee.get(), caller)); Index: mlir/lib/Bytecode/Reader/BytecodeReader.cpp =================================================================== --- mlir/lib/Bytecode/Reader/BytecodeReader.cpp +++ mlir/lib/Bytecode/Reader/BytecodeReader.cpp @@ -919,8 +919,8 @@ if (failed(reader.parseVarInt(dataSize)) || failed(reader.parseBytes(dataSize, data))) return failure(); - result = llvm::makeArrayRef(reinterpret_cast(data.data()), - data.size()); + result = llvm::ArrayRef(reinterpret_cast(data.data()), + data.size()); return success(); } Index: mlir/lib/CAPI/Dialect/Quant.cpp =================================================================== --- mlir/lib/CAPI/Dialect/Quant.cpp +++ mlir/lib/CAPI/Dialect/Quant.cpp @@ -167,7 +167,7 @@ int64_t storageTypeMax) { return wrap(quant::UniformQuantizedPerAxisType::get( flags, unwrap(storageType), unwrap(expressedType), - llvm::makeArrayRef(scales, nDims), llvm::makeArrayRef(zeroPoints, nDims), + llvm::ArrayRef(scales, nDims), llvm::ArrayRef(zeroPoints, nDims), quantizedDimension, storageTypeMin, storageTypeMax)); } Index: mlir/lib/CAPI/IR/AffineMap.cpp =================================================================== --- mlir/lib/CAPI/IR/AffineMap.cpp +++ mlir/lib/CAPI/IR/AffineMap.cpp @@ -68,7 +68,7 @@ MlirAffineMap mlirAffineMapPermutationGet(MlirContext ctx, intptr_t size, unsigned *permutation) { return wrap(AffineMap::getPermutationMap( - llvm::makeArrayRef(permutation, static_cast(size)), unwrap(ctx))); + llvm::ArrayRef(permutation, static_cast(size)), unwrap(ctx))); } bool mlirAffineMapIsIdentity(MlirAffineMap affineMap) { Index: mlir/lib/CAPI/IR/BuiltinAttributes.cpp =================================================================== --- mlir/lib/CAPI/IR/BuiltinAttributes.cpp +++ mlir/lib/CAPI/IR/BuiltinAttributes.cpp @@ -301,13 +301,13 @@ uint64_t *idxs) { return wrap(unwrap(attr) .cast() - .getValues()[llvm::makeArrayRef(idxs, rank)]); + .getValues()[llvm::ArrayRef(idxs, rank)]); } bool mlirElementsAttrIsValidIndex(MlirAttribute attr, intptr_t rank, uint64_t *idxs) { return unwrap(attr).cast().isValidIndex( - llvm::makeArrayRef(idxs, rank)); + llvm::ArrayRef(idxs, rank)); } int64_t mlirElementsAttrGetNumElements(MlirAttribute attr) { @@ -520,9 +520,8 @@ static MlirAttribute getDenseAttribute(MlirType shapedType, intptr_t numElements, const T *elements) { - return wrap( - DenseElementsAttr::get(unwrap(shapedType).cast(), - llvm::makeArrayRef(elements, numElements))); + return wrap(DenseElementsAttr::get(unwrap(shapedType).cast(), + llvm::ArrayRef(elements, numElements))); } MlirAttribute mlirDenseElementsAttrUInt8Get(MlirType shapedType, @@ -710,7 +709,7 @@ intptr_t numElements, const T *elements) { return wrap(U::get(unwrap(shapedType).cast(), unwrap(name), UnmanagedAsmResourceBlob::allocateInferAlign( - llvm::makeArrayRef(elements, numElements)))); + llvm::ArrayRef(elements, numElements)))); } MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseBoolResourceElementsAttrGet( Index: mlir/lib/CAPI/IR/BuiltinTypes.cpp =================================================================== --- mlir/lib/CAPI/IR/BuiltinTypes.cpp +++ mlir/lib/CAPI/IR/BuiltinTypes.cpp @@ -187,15 +187,14 @@ MlirType mlirVectorTypeGet(intptr_t rank, const int64_t *shape, MlirType elementType) { - return wrap( - VectorType::get(llvm::makeArrayRef(shape, static_cast(rank)), - unwrap(elementType))); + return wrap(VectorType::get(llvm::ArrayRef(shape, static_cast(rank)), + unwrap(elementType))); } MlirType mlirVectorTypeGetChecked(MlirLocation loc, intptr_t rank, const int64_t *shape, MlirType elementType) { return wrap(VectorType::getChecked( - unwrap(loc), llvm::makeArrayRef(shape, static_cast(rank)), + unwrap(loc), llvm::ArrayRef(shape, static_cast(rank)), unwrap(elementType))); } @@ -215,9 +214,9 @@ MlirType mlirRankedTensorTypeGet(intptr_t rank, const int64_t *shape, MlirType elementType, MlirAttribute encoding) { - return wrap(RankedTensorType::get( - llvm::makeArrayRef(shape, static_cast(rank)), unwrap(elementType), - unwrap(encoding))); + return wrap( + RankedTensorType::get(llvm::ArrayRef(shape, static_cast(rank)), + unwrap(elementType), unwrap(encoding))); } MlirType mlirRankedTensorTypeGetChecked(MlirLocation loc, intptr_t rank, @@ -225,7 +224,7 @@ MlirType elementType, MlirAttribute encoding) { return wrap(RankedTensorType::getChecked( - unwrap(loc), llvm::makeArrayRef(shape, static_cast(rank)), + unwrap(loc), llvm::ArrayRef(shape, static_cast(rank)), unwrap(elementType), unwrap(encoding))); } @@ -252,7 +251,7 @@ const int64_t *shape, MlirAttribute layout, MlirAttribute memorySpace) { return wrap(MemRefType::get( - llvm::makeArrayRef(shape, static_cast(rank)), unwrap(elementType), + llvm::ArrayRef(shape, static_cast(rank)), unwrap(elementType), mlirAttributeIsNull(layout) ? MemRefLayoutAttrInterface() : unwrap(layout).cast(), @@ -264,7 +263,7 @@ MlirAttribute layout, MlirAttribute memorySpace) { return wrap(MemRefType::getChecked( - unwrap(loc), llvm::makeArrayRef(shape, static_cast(rank)), + unwrap(loc), llvm::ArrayRef(shape, static_cast(rank)), unwrap(elementType), mlirAttributeIsNull(layout) ? MemRefLayoutAttrInterface() @@ -275,9 +274,9 @@ MlirType mlirMemRefTypeContiguousGet(MlirType elementType, intptr_t rank, const int64_t *shape, MlirAttribute memorySpace) { - return wrap(MemRefType::get( - llvm::makeArrayRef(shape, static_cast(rank)), unwrap(elementType), - MemRefLayoutAttrInterface(), unwrap(memorySpace))); + return wrap(MemRefType::get(llvm::ArrayRef(shape, static_cast(rank)), + unwrap(elementType), MemRefLayoutAttrInterface(), + unwrap(memorySpace))); } MlirType mlirMemRefTypeContiguousGetChecked(MlirLocation loc, @@ -285,7 +284,7 @@ const int64_t *shape, MlirAttribute memorySpace) { return wrap(MemRefType::getChecked( - unwrap(loc), llvm::makeArrayRef(shape, static_cast(rank)), + unwrap(loc), llvm::ArrayRef(shape, static_cast(rank)), unwrap(elementType), MemRefLayoutAttrInterface(), unwrap(memorySpace))); } Index: mlir/lib/CAPI/IR/IntegerSet.cpp =================================================================== --- mlir/lib/CAPI/IR/IntegerSet.cpp +++ mlir/lib/CAPI/IR/IntegerSet.cpp @@ -49,7 +49,7 @@ return wrap(IntegerSet::get( static_cast(numDims), static_cast(numSymbols), mlirConstraints, - llvm::makeArrayRef(eqFlags, static_cast(numConstraints)))); + llvm::ArrayRef(eqFlags, static_cast(numConstraints)))); } MlirIntegerSet Index: mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp =================================================================== --- mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp +++ mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp @@ -275,7 +275,7 @@ auto integerSet = op.getIntegerSet(); Value zeroConstant = rewriter.create(loc, 0); SmallVector operands(op.getOperands()); - auto operandsRef = llvm::makeArrayRef(operands); + auto operandsRef = llvm::ArrayRef(operands); // Calculate cond as a conjunction without short-circuiting. Value cond = nullptr; @@ -419,7 +419,7 @@ LogicalResult matchAndRewrite(AffineDmaStartOp op, PatternRewriter &rewriter) const override { SmallVector operands(op.getOperands()); - auto operandsRef = llvm::makeArrayRef(operands); + auto operandsRef = llvm::ArrayRef(operands); // Expand affine map for DMA source memref. auto maybeExpandedSrcMap = expandAffineMap( Index: mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp =================================================================== --- mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp +++ mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp @@ -977,9 +977,9 @@ adaptor.getRhs()); Value sumResult = rewriter.create( - loc, result, llvm::makeArrayRef(0)); + loc, result, llvm::ArrayRef(0)); Value carryValue = rewriter.create( - loc, result, llvm::makeArrayRef(1)); + loc, result, llvm::ArrayRef(1)); // Convert the carry value to boolean. Value one = spirv::ConstantOp::getOne(dstElemTy, loc, rewriter); @@ -1002,9 +1002,9 @@ rewriter.create(loc, adaptor.getLhs(), adaptor.getRhs()); Value low = rewriter.create(loc, result, - llvm::makeArrayRef(0)); - Value high = rewriter.create( - loc, result, llvm::makeArrayRef(1)); + llvm::ArrayRef(0)); + Value high = rewriter.create(loc, result, + llvm::ArrayRef(1)); rewriter.replaceOp(op, {low, high}); return success(); Index: mlir/lib/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.cpp =================================================================== --- mlir/lib/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.cpp +++ mlir/lib/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.cpp @@ -57,7 +57,7 @@ auto dataAttrType = RankedTensorType::get( {static_cast(elementVals.size())}, builder.getI8Type()); auto dataAttr = - DenseElementsAttr::get(dataAttrType, llvm::makeArrayRef(elementVals)); + DenseElementsAttr::get(dataAttrType, llvm::ArrayRef(elementVals)); auto arrayTy = LLVM::LLVMArrayType::get(IntegerType::get(ctx, 8), elementVals.size()); std::string symbolName = generateGlobalMsgSymbolName(moduleOp); Index: mlir/lib/Conversion/LLVMCommon/MemRefBuilder.cpp =================================================================== --- mlir/lib/Conversion/LLVMCommon/MemRefBuilder.cpp +++ mlir/lib/Conversion/LLVMCommon/MemRefBuilder.cpp @@ -139,7 +139,7 @@ // Copy size values to stack-allocated memory. auto one = createIndexAttrConstant(builder, loc, indexType, 1); auto sizes = builder.create( - loc, value, llvm::makeArrayRef({kSizePosInMemRefDescriptor})); + loc, value, llvm::ArrayRef({kSizePosInMemRefDescriptor})); auto sizesPtr = builder.create(loc, arrayPtrTy, one, /*alignment=*/0); builder.create(loc, sizes, sizesPtr); Index: mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp =================================================================== --- mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp +++ mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp @@ -1534,7 +1534,7 @@ for (auto &en : llvm::enumerate(reassociation)) { rewriter.setInsertionPoint(op); auto dstIndex = en.index(); - ArrayRef ref = llvm::makeArrayRef(en.value()); + ArrayRef ref = llvm::ArrayRef(en.value()); while (srcShape[ref.back()] == 1 && ref.size() > 1) ref = ref.drop_back(); if (!ShapedType::isDynamic(srcShape[ref.back()]) || ref.size() == 1) { Index: mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp =================================================================== --- mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp +++ mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp @@ -335,7 +335,7 @@ // Reduce them. Value result = values.front(); - for (Value next : llvm::makeArrayRef(values).drop_front()) { + for (Value next : llvm::ArrayRef(values).drop_front()) { switch (reduceOp.getKind()) { #define INT_AND_FLOAT_CASE(kind, iop, fop) \ Index: mlir/lib/Dialect/Affine/IR/AffineOps.cpp =================================================================== --- mlir/lib/Dialect/Affine/IR/AffineOps.cpp +++ mlir/lib/Dialect/Affine/IR/AffineOps.cpp @@ -3868,7 +3868,7 @@ return failure(); result.attributes.erase(tmpAttrStrName); llvm::append_range(flatExprs, map.getValue().getResults()); - auto operandsRef = llvm::makeArrayRef(mapOperands); + auto operandsRef = llvm::ArrayRef(mapOperands); auto dimsRef = operandsRef.take_front(map.getValue().getNumDims()); SmallVector dims(dimsRef.begin(), dimsRef.end()); Index: mlir/lib/Dialect/Affine/Utils/Utils.cpp =================================================================== --- mlir/lib/Dialect/Affine/Utils/Utils.cpp +++ mlir/lib/Dialect/Affine/Utils/Utils.cpp @@ -362,9 +362,9 @@ parallelReductions, [](const LoopReduction &red) { return red.kind; })); AffineParallelOp newPloop = outsideBuilder.create( loc, ValueRange(reducedValues).getTypes(), reductionKinds, - llvm::makeArrayRef(lowerBoundMap), lowerBoundOperands, - llvm::makeArrayRef(upperBoundMap), upperBoundOperands, - llvm::makeArrayRef(forOp.getStep())); + llvm::ArrayRef(lowerBoundMap), lowerBoundOperands, + llvm::ArrayRef(upperBoundMap), upperBoundOperands, + llvm::ArrayRef(forOp.getStep())); // Steal the body of the old affine for op. newPloop.getRegion().takeBody(forOp.getRegion()); Operation *yieldOp = &newPloop.getBody()->back(); Index: mlir/lib/Dialect/Func/IR/FuncOps.cpp =================================================================== --- mlir/lib/Dialect/Func/IR/FuncOps.cpp +++ mlir/lib/Dialect/Func/IR/FuncOps.cpp @@ -229,7 +229,7 @@ FuncOp FuncOp::create(Location location, StringRef name, FunctionType type, Operation::dialect_attr_range attrs) { SmallVector attrRef(attrs); - return create(location, name, type, llvm::makeArrayRef(attrRef)); + return create(location, name, type, llvm::ArrayRef(attrRef)); } FuncOp FuncOp::create(Location location, StringRef name, FunctionType type, ArrayRef attrs, Index: mlir/lib/Dialect/GPU/Transforms/AllReduceLowering.cpp =================================================================== --- mlir/lib/Dialect/GPU/Transforms/AllReduceLowering.cpp +++ mlir/lib/Dialect/GPU/Transforms/AllReduceLowering.cpp @@ -347,7 +347,7 @@ return SmallVector{ accumFactory(value, shuffleOp.getResult(0))}; }, - [&] { return llvm::makeArrayRef(value); }); + [&] { return llvm::ArrayRef(value); }); value = rewriter.getInsertionBlock()->getArgument(0); } return SmallVector{value}; Index: mlir/lib/Dialect/GPU/Transforms/MemoryPromotion.cpp =================================================================== --- mlir/lib/Dialect/GPU/Transforms/MemoryPromotion.cpp +++ mlir/lib/Dialect/GPU/Transforms/MemoryPromotion.cpp @@ -70,14 +70,14 @@ b, b.getLoc(), lbs, ubs, steps, [&](OpBuilder &b, Location loc, ValueRange loopIvs) { ivs.assign(loopIvs.begin(), loopIvs.end()); - auto activeIvs = llvm::makeArrayRef(ivs).take_back(rank); + auto activeIvs = llvm::ArrayRef(ivs).take_back(rank); Value loaded = b.create(loc, from, activeIvs); b.create(loc, loaded, to, activeIvs); }); // Map the innermost loops to threads in reverse order. for (const auto &en : - llvm::enumerate(llvm::reverse(llvm::makeArrayRef(ivs).take_back( + llvm::enumerate(llvm::reverse(llvm::ArrayRef(ivs).take_back( GPUDialect::getNumWorkgroupDimensions())))) { Value v = en.value(); auto loop = cast(v.getParentRegion()->getParentOp()); Index: mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp =================================================================== --- mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp +++ mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp @@ -1017,7 +1017,7 @@ auto llvmFuncType = LLVM::LLVMFunctionType::get(llvmResultType, argTypes); auto wrappedFuncType = LLVM::LLVMPointerType::get(llvmFuncType); - auto funcArguments = llvm::makeArrayRef(operands).drop_front(); + auto funcArguments = llvm::ArrayRef(operands).drop_front(); // Make sure that the first operand (indirect callee) matches the wrapped // LLVM IR function type, and that the types of the other call operands Index: mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp =================================================================== --- mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -1056,7 +1056,7 @@ if (payloadOpName.has_value()) { addBodyWithPayloadOp(parser, result, payloadOpName.value(), payloadOpAttrs, - makeArrayRef(result.operands).drop_back()); + ArrayRef(result.operands).drop_back()); } else { SmallVector regionArgs; if (parser.parseArgumentList(regionArgs, OpAsmParser::Delimiter::Paren, @@ -1283,7 +1283,7 @@ if (payloadOpName.has_value()) { addBodyWithPayloadOp(parser, result, payloadOpName.value(), payloadOpAttrs, - makeArrayRef(result.operands)); + ArrayRef(result.operands)); } else { SmallVector regionArgs; if (parser.parseArgumentList(regionArgs, OpAsmParser::Delimiter::Paren, Index: mlir/lib/Dialect/Linalg/Utils/Utils.cpp =================================================================== --- mlir/lib/Dialect/Linalg/Utils/Utils.cpp +++ mlir/lib/Dialect/Linalg/Utils/Utils.cpp @@ -457,7 +457,7 @@ loc, /*inputs=*/from, /*outputs=*/to, - /*indexingMaps=*/llvm::makeArrayRef({id, id}), + /*indexingMaps=*/llvm::ArrayRef({id, id}), /*iteratorTypes=*/iteratorTypes, [](OpBuilder &b, Location loc, ValueRange args) { b.create(loc, args.front()); Index: mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp =================================================================== --- mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp +++ mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp @@ -97,7 +97,7 @@ // If input shape matches target vector width, we can just call the // user-provided compute function with the operands. - if (inputShape == llvm::makeArrayRef(vectorWidth)) + if (inputShape == llvm::ArrayRef(vectorWidth)) return compute(operands); // Check if the inner dimension has to be expanded, or we can directly iterate Index: mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp =================================================================== --- mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp +++ mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp @@ -2290,7 +2290,7 @@ SmallVector resultStrides; resultStrides.reserve(reassociation.size()); for (const ReassociationIndices &reassoc : reassociation) { - ArrayRef ref = llvm::makeArrayRef(reassoc); + ArrayRef ref = llvm::ArrayRef(reassoc); while (srcShape[ref.back()] == 1 && ref.size() > 1) ref = ref.drop_back(); if (!ShapedType::isDynamic(srcShape[ref.back()]) || ref.size() == 1) { Index: mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp =================================================================== --- mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp +++ mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp @@ -1129,7 +1129,7 @@ return failure(); auto resultType = getElementPtrType( - type, llvm::makeArrayRef(result.operands).drop_front(), result.location); + type, llvm::ArrayRef(result.operands).drop_front(), result.location); if (!resultType) { return failure(); } @@ -4677,7 +4677,7 @@ return failure(); auto resultType = getElementPtrType( - type, llvm::makeArrayRef(state.operands).drop_front(2), state.location); + type, llvm::ArrayRef(state.operands).drop_front(2), state.location); if (!resultType) return failure(); Index: mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp =================================================================== --- mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp +++ mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp @@ -711,7 +711,7 @@ loc, integerType, builder.getI32IntegerAttr(offset)); auto addrOp = builder.create(loc, varOp); auto acOp = builder.create( - loc, addrOp, llvm::makeArrayRef({zeroOp, offsetOp})); + loc, addrOp, llvm::ArrayRef({zeroOp, offsetOp})); return builder.create(loc, acOp); } Index: mlir/lib/Dialect/Shape/IR/Shape.cpp =================================================================== --- mlir/lib/Dialect/Shape/IR/Shape.cpp +++ mlir/lib/Dialect/Shape/IR/Shape.cpp @@ -1277,7 +1277,7 @@ FuncOp FuncOp::create(Location location, StringRef name, FunctionType type, Operation::dialect_attr_range attrs) { SmallVector attrRef(attrs); - return create(location, name, type, llvm::makeArrayRef(attrRef)); + return create(location, name, type, llvm::ArrayRef(attrRef)); } FuncOp FuncOp::create(Location location, StringRef name, FunctionType type, ArrayRef attrs, @@ -1853,7 +1853,7 @@ return failure(); auto shapeVec = llvm::to_vector<6>( operands[0].cast().getValues()); - auto shape = llvm::makeArrayRef(shapeVec); + auto shape = llvm::ArrayRef(shapeVec); auto splitPoint = operands[1].cast().getInt(); // Verify that the split point is in the correct range. // TODO: Constant fold to an "error". @@ -1975,7 +1975,7 @@ return failure(); // Resolve operands. - auto initVals = llvm::makeArrayRef(operands).drop_front(); + auto initVals = llvm::ArrayRef(operands).drop_front(); if (parser.resolveOperand(operands.front(), shapeOrExtentTensorType, result.operands) || parser.resolveOperands(initVals, result.types, parser.getNameLoc(), Index: mlir/lib/Dialect/Tensor/Transforms/SplitPaddingPatterns.cpp =================================================================== --- mlir/lib/Dialect/Tensor/Transforms/SplitPaddingPatterns.cpp +++ mlir/lib/Dialect/Tensor/Transforms/SplitPaddingPatterns.cpp @@ -69,7 +69,7 @@ cstZero)); } Value ifCond = eqZeroCmpVals.front(); - for (Value cmp : llvm::makeArrayRef(eqZeroCmpVals).drop_front()) + for (Value cmp : llvm::ArrayRef(eqZeroCmpVals).drop_front()) ifCond = rewriter.create(loc, ifCond, cmp); // Build the scf.if op itself. For the "then" branch, we can elide the Index: mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp =================================================================== --- mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp +++ mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp @@ -322,7 +322,7 @@ assert(segments[position].data() == nullptr && "results already set"); int64_t start = operations.size(); llvm::append_range(operations, ops); - segments[position] = makeArrayRef(operations).drop_front(start); + segments[position] = ArrayRef(operations).drop_front(start); } ArrayRef Index: mlir/lib/Dialect/Vector/IR/VectorOps.cpp =================================================================== --- mlir/lib/Dialect/Vector/IR/VectorOps.cpp +++ mlir/lib/Dialect/Vector/IR/VectorOps.cpp @@ -1204,8 +1204,7 @@ /// Folding is only possible in the absence of an internal permutation in the /// result vector. bool canFold() { - return (sentinels == - makeArrayRef(extractPosition).drop_front(extractedRank)); + return (sentinels == ArrayRef(extractPosition).drop_front(extractedRank)); } // Helper to get the next defining op of interest. @@ -1281,7 +1280,7 @@ auto permutation = extractVector(nextTransposeOp.getTransp()); AffineMap m = inversePermutation( AffineMap::getPermutationMap(permutation, extractOp.getContext())); - extractPosition = applyPermutationMap(m, makeArrayRef(extractPosition)); + extractPosition = applyPermutationMap(m, ArrayRef(extractPosition)); return success(); } @@ -1290,8 +1289,8 @@ ExtractFromInsertTransposeChainState::handleInsertOpWithMatchingPos( Value &res) { auto insertedPos = extractVector(nextInsertOp.getPosition()); - if (makeArrayRef(insertedPos) != - llvm::makeArrayRef(extractPosition).take_front(extractedRank)) + if (ArrayRef(insertedPos) != + llvm::ArrayRef(extractPosition).take_front(extractedRank)) return failure(); // Case 2.a. early-exit fold. res = nextInsertOp.getSource(); @@ -1332,8 +1331,7 @@ OpBuilder b(extractOp.getContext()); extractOp->setAttr( extractOp.getPositionAttrName(), - b.getI64ArrayAttr( - makeArrayRef(extractPosition).take_front(extractedRank))); + b.getI64ArrayAttr(ArrayRef(extractPosition).take_front(extractedRank))); extractOp.getVectorMutable().assign(source); return extractOp.getResult(); } Index: mlir/lib/ExecutionEngine/RocmRuntimeWrappers.cpp =================================================================== --- mlir/lib/ExecutionEngine/RocmRuntimeWrappers.cpp +++ mlir/lib/ExecutionEngine/RocmRuntimeWrappers.cpp @@ -146,7 +146,7 @@ std::rotate(denseStrides.begin(), denseStrides.begin() + 1, denseStrides.end()); denseStrides.back() = 1; - assert(strides == llvm::makeArrayRef(denseStrides)); + assert(strides == llvm::ArrayRef(denseStrides)); auto ptr = descriptor->data + descriptor->offset * elementSizeBytes; mgpuMemHostRegister(ptr, sizeBytes); Index: mlir/lib/Interfaces/DataLayoutInterfaces.cpp =================================================================== --- mlir/lib/Interfaces/DataLayoutInterfaces.cpp +++ mlir/lib/Interfaces/DataLayoutInterfaces.cpp @@ -305,7 +305,7 @@ if (nonNullSpecs.empty()) return {}; return nonNullSpecs.back().combineWith( - llvm::makeArrayRef(nonNullSpecs).drop_back()); + llvm::ArrayRef(nonNullSpecs).drop_back()); } LogicalResult mlir::detail::verifyDataLayoutOp(Operation *op) { Index: mlir/lib/TableGen/Format.cpp =================================================================== --- mlir/lib/TableGen/Format.cpp +++ mlir/lib/TableGen/Format.cpp @@ -185,7 +185,7 @@ s << repl.spec << kMarkerForNoSubst; continue; } - auto range = llvm::makeArrayRef(adapters); + auto range = llvm::ArrayRef(adapters); range = range.drop_front(repl.index); if (repl.end != FmtReplacement::kUnset) range = range.drop_back(adapters.size() - repl.end); Index: mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp =================================================================== --- mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp +++ mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp @@ -856,7 +856,7 @@ } ArrayRef returnTypes; if (!isVoidType(returnType)) { - returnTypes = llvm::makeArrayRef(returnType); + returnTypes = llvm::ArrayRef(returnType); } typeMap[operands[0]] = FunctionType::get(context, argTypes, returnTypes); return success(); Index: mlir/lib/Target/SPIRV/TranslateRegistration.cpp =================================================================== --- mlir/lib/Target/SPIRV/TranslateRegistration.cpp +++ mlir/lib/Target/SPIRV/TranslateRegistration.cpp @@ -49,8 +49,8 @@ return {}; } - auto binary = llvm::makeArrayRef(reinterpret_cast(start), - size / sizeof(uint32_t)); + auto binary = llvm::ArrayRef(reinterpret_cast(start), + size / sizeof(uint32_t)); return spirv::deserialize(binary, context); } Index: mlir/lib/Tools/PDLL/AST/NodePrinter.cpp =================================================================== --- mlir/lib/Tools/PDLL/AST/NodePrinter.cpp +++ mlir/lib/Tools/PDLL/AST/NodePrinter.cpp @@ -107,7 +107,7 @@ if (elementIndentStack.empty()) return; - for (bool isLastElt : llvm::makeArrayRef(elementIndentStack).drop_back()) + for (bool isLastElt : llvm::ArrayRef(elementIndentStack).drop_back()) os << (isLastElt ? " " : " |"); os << (elementIndentStack.back() ? " `" : " |"); } Index: mlir/lib/Tools/PDLL/AST/TypeDetail.h =================================================================== --- mlir/lib/Tools/PDLL/AST/TypeDetail.h +++ mlir/lib/Tools/PDLL/AST/TypeDetail.h @@ -115,9 +115,9 @@ std::pair, ArrayRef> key) { SmallVector names = llvm::to_vector(llvm::map_range( key.second, [&](StringRef name) { return alloc.copyInto(name); })); - return new (alloc.allocate()) TupleTypeStorage( - std::make_pair(alloc.copyInto(key.first), - alloc.copyInto(llvm::makeArrayRef(names)))); + return new (alloc.allocate()) + TupleTypeStorage(std::make_pair(alloc.copyInto(key.first), + alloc.copyInto(llvm::ArrayRef(names)))); } }; Index: mlir/lib/Transforms/Utils/DialectConversion.cpp =================================================================== --- mlir/lib/Transforms/Utils/DialectConversion.cpp +++ mlir/lib/Transforms/Utils/DialectConversion.cpp @@ -3364,7 +3364,7 @@ mlir::applyPartialConversion(Operation *op, ConversionTarget &target, const FrozenRewritePatternSet &patterns, DenseSet *unconvertedOps) { - return applyPartialConversion(llvm::makeArrayRef(op), target, patterns, + return applyPartialConversion(llvm::ArrayRef(op), target, patterns, unconvertedOps); } @@ -3380,7 +3380,7 @@ LogicalResult mlir::applyFullConversion(Operation *op, ConversionTarget &target, const FrozenRewritePatternSet &patterns) { - return applyFullConversion(llvm::makeArrayRef(op), target, patterns); + return applyFullConversion(llvm::ArrayRef(op), target, patterns); } //===----------------------------------------------------------------------===// @@ -3401,6 +3401,6 @@ const FrozenRewritePatternSet &patterns, DenseSet &convertedOps, function_ref notifyCallback) { - return applyAnalysisConversion(llvm::makeArrayRef(op), target, patterns, + return applyAnalysisConversion(llvm::ArrayRef(op), target, patterns, convertedOps, notifyCallback); } Index: mlir/test/lib/Dialect/Test/TestDialect.cpp =================================================================== --- mlir/test/lib/Dialect/Test/TestDialect.cpp +++ mlir/test/lib/Dialect/Test/TestDialect.cpp @@ -945,8 +945,8 @@ // test.pretty_printed_region start end : // Else fallback to parsing the "non pretty-printed" version. if (!succeeded(parser.parseOptionalKeyword("start"))) - return parser.parseGenericOperationAfterOpName( - result, llvm::makeArrayRef(operands)); + return parser.parseGenericOperationAfterOpName(result, + llvm::ArrayRef(operands)); FailureOr parseOpNameInfo = parser.parseCustomOperationName(); if (failed(parseOpNameInfo)) Index: mlir/test/lib/Dialect/Test/TestPatterns.cpp =================================================================== --- mlir/test/lib/Dialect/Test/TestPatterns.cpp +++ mlir/test/lib/Dialect/Test/TestPatterns.cpp @@ -233,7 +233,7 @@ // Check if these transformations introduce visiting of operations that // are not in the `ops` set (The new created ops are valid). An invalid // operation will trigger the assertion while processing. - (void)applyOpPatternsAndFold(makeArrayRef(ops), std::move(patterns), + (void)applyOpPatternsAndFold(ArrayRef(ops), std::move(patterns), /*strict=*/true); } @@ -354,7 +354,7 @@ for (auto &op : getOperation().getBody().front()) ops.push_back(&op); // Generate test patterns for each, but skip terminator. - for (auto *op : llvm::makeArrayRef(ops).drop_back()) { + for (auto *op : llvm::ArrayRef(ops).drop_back()) { // Test create method of each of the Op classes below. The resultant // output would be in reverse order underneath `op` from which // the attributes and regions are used. Index: mlir/test/mlir-tblgen/op-attribute.td =================================================================== --- mlir/test/mlir-tblgen/op-attribute.td +++ mlir/test/mlir-tblgen/op-attribute.td @@ -44,7 +44,7 @@ // DECL: static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() // DECL-NEXT: static ::llvm::StringRef attrNames[] = // DECL-SAME: {::llvm::StringRef("aAttr"), ::llvm::StringRef("bAttr"), ::llvm::StringRef("cAttr"), ::llvm::StringRef("dAttr")}; -// DECL-NEXT: return ::llvm::makeArrayRef(attrNames); +// DECL-NEXT: return ::llvm::ArrayRef(attrNames); // DECL: ::mlir::StringAttr getAAttrAttrName() // DECL-NEXT: return getAttributeNameForIndex(0); @@ -193,7 +193,7 @@ // DECL: static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() // DECL-NEXT: static ::llvm::StringRef attrNames[] = // DECL-SAME: {::llvm::StringRef("aAttr"), ::llvm::StringRef("bAttr"), ::llvm::StringRef("cAttr")}; -// DECL-NEXT: return ::llvm::makeArrayRef(attrNames); +// DECL-NEXT: return ::llvm::ArrayRef(attrNames); // DECL: ::mlir::StringAttr getAAttrAttrName() // DECL-NEXT: return getAttributeNameForIndex(0); Index: mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp =================================================================== --- mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp +++ mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp @@ -658,7 +658,7 @@ os << ") {\n"; } else if (auto *param = dyn_cast(first)) { genVariableParser(param, ctx, os); - guardOn(llvm::makeArrayRef(param)); + guardOn(llvm::ArrayRef(param)); } else if (auto *params = dyn_cast(first)) { genParamsParser(params, ctx, os); guardOn(params->getParams()); @@ -852,7 +852,7 @@ MethodBody &os) { FormatElement *anchor = el->getAnchor(); if (auto *param = dyn_cast(anchor)) { - guardOnAny(ctx, os, llvm::makeArrayRef(param), el->isInverted()); + guardOnAny(ctx, os, llvm::ArrayRef(param), el->isInverted()); } else if (auto *params = dyn_cast(anchor)) { guardOnAny(ctx, os, params->getParams(), el->isInverted()); } else if (auto *strct = dyn_cast(anchor)) { Index: mlir/tools/mlir-tblgen/FormatGen.h =================================================================== --- mlir/tools/mlir-tblgen/FormatGen.h +++ mlir/tools/mlir-tblgen/FormatGen.h @@ -387,14 +387,14 @@ /// Return the `then` elements of the optional group. Drops the first /// `thenParseStart` whitespace elements if `parseable` is true. ArrayRef getThenElements(bool parseable = false) const { - return llvm::makeArrayRef(thenElements) + return llvm::ArrayRef(thenElements) .drop_front(parseable ? thenParseStart : 0); } /// Return the `else` elements of the optional group. Drops the first /// `elseParseStart` whitespace elements if `parseable` is true. ArrayRef getElseElements(bool parseable = false) const { - return llvm::makeArrayRef(elseElements) + return llvm::ArrayRef(elseElements) .drop_front(parseable ? elseParseStart : 0); } Index: mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp =================================================================== --- mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp +++ mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp @@ -902,7 +902,7 @@ [&](StringRef attrName) { body << "::llvm::StringRef(\"" << attrName << "\")"; }); - body << "};\n return ::llvm::makeArrayRef(attrNames);"; + body << "};\n return ::llvm::ArrayRef(attrNames);"; } // Emit the getAttributeNameForIndex methods. Index: mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp =================================================================== --- mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp +++ mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp @@ -893,11 +893,9 @@ populateBuilderLinesOperand(op, operandArgNames, builderLines); populateBuilderLinesAttr( - op, llvm::makeArrayRef(builderArgs).drop_front(numResultArgs), - builderLines); + op, llvm::ArrayRef(builderArgs).drop_front(numResultArgs), builderLines); populateBuilderLinesResult( - op, llvm::makeArrayRef(builderArgs).take_front(numResultArgs), - builderLines); + op, llvm::ArrayRef(builderArgs).take_front(numResultArgs), builderLines); populateBuilderLinesSuccessors(op, successorArgNames, builderLines); populateBuilderRegions(op, builderArgs, builderLines); Index: mlir/unittests/IR/AttributeTest.cpp =================================================================== --- mlir/unittests/IR/AttributeTest.cpp +++ mlir/unittests/IR/AttributeTest.cpp @@ -28,7 +28,7 @@ EXPECT_TRUE(splat.isSplat()); auto detectedSplat = - DenseElementsAttr::get(shape, llvm::makeArrayRef({splatElt, splatElt})); + DenseElementsAttr::get(shape, llvm::ArrayRef({splatElt, splatElt})); EXPECT_EQ(detectedSplat, splat); for (auto newValue : detectedSplat.template getValues()) @@ -220,7 +220,7 @@ Attribute value = IntegerAttr::get(intTy, elementValue); RankedTensorType shape = RankedTensorType::get({}, intTy); - auto attr = DenseElementsAttr::get(shape, llvm::makeArrayRef({elementValue})); + auto attr = DenseElementsAttr::get(shape, llvm::ArrayRef({elementValue})); EXPECT_TRUE(attr.getValues()[0] == value); } @@ -232,7 +232,7 @@ RankedTensorType shape = RankedTensorType::get({4}, intTy); auto attr = - DenseElementsAttr::get(shape, llvm::makeArrayRef({elementValue})) + DenseElementsAttr::get(shape, llvm::ArrayRef({elementValue})) .mapValues(boolTy, [](const APInt &x) { return x.isZero() ? APInt::getZero(1) : APInt::getAllOnes(1); }); @@ -249,7 +249,7 @@ RankedTensorType shape = RankedTensorType::get({4}, intTy); auto attr = - DenseElementsAttr::get(shape, llvm::makeArrayRef({elementValue})) + DenseElementsAttr::get(shape, llvm::ArrayRef({elementValue})) .mapValues(boolTy, [](const APInt &x) { return x.isZero() ? APInt::getZero(1) : APInt::getAllOnes(1); }); @@ -282,7 +282,7 @@ template static void checkNativeIntAccess(Builder &builder, size_t intWidth) { T data[] = {0, 1, 2}; - checkNativeAccess(builder.getContext(), llvm::makeArrayRef(data), + checkNativeAccess(builder.getContext(), llvm::ArrayRef(data), builder.getIntegerType(intWidth)); } @@ -294,7 +294,7 @@ // Bool bool boolData[] = {true, false, true}; checkNativeAccess( - &context, llvm::makeArrayRef(boolData), builder.getI1Type()); + &context, llvm::ArrayRef(boolData), builder.getI1Type()); // Unsigned integers checkNativeIntAccess(builder, 8); @@ -311,12 +311,12 @@ // Float float floatData[] = {0, 1, 2}; checkNativeAccess( - &context, llvm::makeArrayRef(floatData), builder.getF32Type()); + &context, llvm::ArrayRef(floatData), builder.getF32Type()); // Double double doubleData[] = {0, 1, 2}; checkNativeAccess( - &context, llvm::makeArrayRef(doubleData), builder.getF64Type()); + &context, llvm::ArrayRef(doubleData), builder.getF64Type()); } TEST(DenseResourceElementsAttrTest, CheckNoCast) { Index: mlir/unittests/IR/SubElementInterfaceTest.cpp =================================================================== --- mlir/unittests/IR/SubElementInterfaceTest.cpp +++ mlir/unittests/IR/SubElementInterfaceTest.cpp @@ -29,7 +29,7 @@ SmallVector subAttrs; dictAttr.walkSubAttrs([&](Attribute attr) { subAttrs.push_back(attr); }); - EXPECT_EQ(llvm::makeArrayRef(subAttrs), + EXPECT_EQ(llvm::ArrayRef(subAttrs), ArrayRef({strAttr, trueAttr, falseAttr, boolArrayAttr})); }