jloser created this revision. jloser added reviewers: MaskRay, serge-sans-paille, dblaikie. Herald added subscribers: Moerafaat, zero9178, bzcheeseman, kosarev, ayermolo, sdasgup3, wenzhicui, wrengr, foad, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, kerbowa, liufengdb, aartbik, mgester, arpith-jacob, csigg, antiagainst, shauheen, rriddle, mehdi_amini, kadircet, arphaman, hiraditya, arichardson, jvesely, emaste, arsenm. Herald added a reviewer: aartbik. Herald added a reviewer: bondhugula. Herald added a reviewer: rafauler. Herald added a reviewer: Amir. Herald added a reviewer: maksfb. Herald added a project: All. jloser requested review of this revision. Herald added a reviewer: nicolasvasilache. Herald added subscribers: cfe-commits, llvm-commits, lldb-commits, pcwang-thead, yota9, stephenneuendorffer, nicolasvasilache. Herald added a reviewer: dcaballe. Herald added projects: clang, LLDB, MLIR, LLVM, clang-tools-extra.
Similar to how `makeArrayRef` is deprecated in favor of deduction guides, do the same for `makeMutableArrayRef`. Once all of the places in-tree are using the deduction guides for `MutableArrayRef`, we can mark `makeMutableArrayRef` as deprecated. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D141814 Files: bolt/lib/Profile/DataAggregator.cpp clang-tools-extra/clangd/FuzzyMatch.cpp clang-tools-extra/clangd/SemanticSelection.cpp clang-tools-extra/clangd/index/dex/Trigram.cpp clang-tools-extra/pseudo/include/clang-pseudo/Forest.h clang/include/clang/AST/DeclOpenMP.h clang/include/clang/AST/OpenMPClause.h clang/include/clang/AST/StmtOpenMP.h clang/include/clang/Lex/MacroInfo.h clang/lib/AST/StmtOpenMP.cpp lld/COFF/Chunks.cpp lld/COFF/DebugTypes.cpp lld/COFF/Writer.cpp lld/ELF/InputFiles.h lld/ELF/SyntheticSections.cpp lldb/source/Host/common/NativeProcessProtocol.cpp llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h llvm/include/llvm/IR/DataLayout.h llvm/include/llvm/IR/Metadata.h llvm/include/llvm/ProfileData/InstrProf.h llvm/include/llvm/Support/Parallel.h llvm/lib/Analysis/ConstantFolding.cpp llvm/lib/ExecutionEngine/ExecutionEngine.cpp llvm/lib/Support/Path.cpp llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp llvm/lib/Transforms/Scalar/IndVarSimplify.cpp llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp llvm/unittests/Support/Path.cpp mlir/lib/Bytecode/Writer/IRNumbering.cpp mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp mlir/test/mlir-tblgen/constraint-unique.td mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
Index: mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp =================================================================== --- mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp +++ mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp @@ -2746,7 +2746,7 @@ /// /// {0}: The region's index. const char *const getSingleRegion = - "::llvm::makeMutableArrayRef((*this)->getRegion({0}))"; + "::llvm::MutableArrayRef((*this)->getRegion({0}))"; // If we have no regions, there is nothing more to do. const auto canSkip = [](const NamedRegion ®ion) { @@ -2781,7 +2781,7 @@ /// Get a single successor. /// /// {0}: The successor's name. - const char *const getSingleSuccessor = "::llvm::makeMutableArrayRef({0}())"; + const char *const getSingleSuccessor = "::llvm::MutableArrayRef({0}())"; // If we have no successors, there is nothing more to do. const auto canSkip = [](const NamedSuccessor &successor) { Index: mlir/test/mlir-tblgen/constraint-unique.td =================================================================== --- mlir/test/mlir-tblgen/constraint-unique.td +++ mlir/test/mlir-tblgen/constraint-unique.td @@ -127,10 +127,10 @@ // CHECK: for (auto [[$RET_VALUE:.*]] : [[$RET_VALUE_GROUP]]) // CHECK-NEXT: if (::mlir::failed([[$A_TYPE_CONSTRAINT]](*this, [[$RET_VALUE]].getType(), "result", index++))) // CHECK-NEXT: return ::mlir::failure(); -// CHECK: for (auto ®ion : ::llvm::makeMutableArrayRef((*this)->getRegion(0))) +// CHECK: for (auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0))) // CHECK-NEXT: if (::mlir::failed([[$A_REGION_CONSTRAINT]](*this, region, "d", index++))) // CHECK-NEXT: return ::mlir::failure(); -// CHECK: for (auto *successor : ::llvm::makeMutableArrayRef(c())) +// CHECK: for (auto *successor : ::llvm::MutableArrayRef(c())) // CHECK-NEXT: if (::mlir::failed([[$A_SUCCESSOR_CONSTRAINT]](*this, successor, "c", index++))) // CHECK-NEXT: return ::mlir::failure(); @@ -148,9 +148,9 @@ // CHECK: for (auto [[$RET_VALUE:.*]] : [[$RET_VALUE_GROUP]]) // CHECK-NEXT: if (::mlir::failed([[$O_TYPE_CONSTRAINT]](*this, [[$RET_VALUE]].getType(), "result", index++))) // CHECK-NEXT: return ::mlir::failure(); -// CHECK: for (auto ®ion : ::llvm::makeMutableArrayRef((*this)->getRegion(0))) +// CHECK: for (auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0))) // CHECK-NEXT: if (::mlir::failed([[$O_REGION_CONSTRAINT]](*this, region, "d", index++))) // CHECK-NEXT: return ::mlir::failure(); -// CHECK: for (auto *successor : ::llvm::makeMutableArrayRef(c())) +// CHECK: for (auto *successor : ::llvm::MutableArrayRef(c())) // CHECK-NEXT: if (::mlir::failed([[$O_SUCCESSOR_CONSTRAINT]](*this, successor, "c", index++))) // CHECK-NEXT: return ::mlir::failure(); Index: mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp =================================================================== --- mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp +++ mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp @@ -80,8 +80,7 @@ LLVM_DEBUG(llvm::dbgs() << " found coalesceable band from " << start << " to " << end << '\n'); - auto band = - llvm::makeMutableArrayRef(loops.data() + start, end - start); + auto band = llvm::MutableArrayRef(loops.data() + start, end - start); (void)coalesceLoops(band); break; } Index: mlir/lib/Bytecode/Writer/IRNumbering.cpp =================================================================== --- mlir/lib/Bytecode/Writer/IRNumbering.cpp +++ mlir/lib/Bytecode/Writer/IRNumbering.cpp @@ -150,9 +150,9 @@ // bytes it takes to encode a varint index to that sub-section. This allows // for more efficiently encoding components of the same dialect (e.g. we only // have to encode the dialect reference once). - groupByDialectPerByte(llvm::makeMutableArrayRef(orderedAttrs)); - groupByDialectPerByte(llvm::makeMutableArrayRef(orderedOpNames)); - groupByDialectPerByte(llvm::makeMutableArrayRef(orderedTypes)); + groupByDialectPerByte(llvm::MutableArrayRef(orderedAttrs)); + groupByDialectPerByte(llvm::MutableArrayRef(orderedOpNames)); + groupByDialectPerByte(llvm::MutableArrayRef(orderedTypes)); // Finalize the numbering of the dialect resources. finalizeDialectResourceNumberings(op); Index: llvm/unittests/Support/Path.cpp =================================================================== --- llvm/unittests/Support/Path.cpp +++ llvm/unittests/Support/Path.cpp @@ -1960,7 +1960,7 @@ return FD.takeError(); auto Close = make_scope_exit([&] { fs::closeFile(*FD); }); if (Expected<size_t> BytesRead = fs::readNativeFile( - *FD, makeMutableArrayRef(&*Buf.begin(), Buf.size()))) + *FD, MutableArrayRef(&*Buf.begin(), Buf.size()))) return Buf.substr(0, *BytesRead); else return BytesRead.takeError(); @@ -2027,7 +2027,7 @@ size_t ToRead) -> Expected<std::string> { std::string Buf(ToRead, '?'); if (Expected<size_t> BytesRead = fs::readNativeFileSlice( - *FD, makeMutableArrayRef(&*Buf.begin(), Buf.size()), Offset)) + *FD, MutableArrayRef(&*Buf.begin(), Buf.size()), Offset)) return Buf.substr(0, *BytesRead); else return BytesRead.takeError(); Index: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp =================================================================== --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -8045,7 +8045,7 @@ return TEs.back(); }; (void)performExtractsShuffleAction<const TreeEntry>( - makeMutableArrayRef(Vector.data(), Vector.size()), Base, + MutableArrayRef(Vector.data(), Vector.size()), Base, [](const TreeEntry *E) { return E->getVectorFactor(); }, ResizeToVF, EstimateShufflesCost); InstructionCost InsertCost = TTI->getScalarizationOverhead( @@ -9898,7 +9898,7 @@ Builder.SetInsertPoint(LastInsert); auto Vector = ShuffledInserts[I].ValueMasks.takeVector(); Value *NewInst = performExtractsShuffleAction<Value>( - makeMutableArrayRef(Vector.data(), Vector.size()), + MutableArrayRef(Vector.data(), Vector.size()), FirstInsert->getOperand(0), [](Value *Vec) { return cast<VectorType>(Vec->getType()) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp =================================================================== --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -195,7 +195,7 @@ bool isExact = false; // See if we can convert this to an int64_t uint64_t UIntVal; - if (APF.convertToInteger(makeMutableArrayRef(UIntVal), 64, true, + if (APF.convertToInteger(MutableArrayRef(UIntVal), 64, true, APFloat::rmTowardZero, &isExact) != APFloat::opOK || !isExact) return false; Index: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp =================================================================== --- llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp +++ llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp @@ -3081,7 +3081,7 @@ } else { bool IsHighest = 2 * i >= Accum.size(); Register SeparateOddOut[2]; - auto LocalAccum = makeMutableArrayRef(SeparateOddOut) + auto LocalAccum = MutableArrayRef(SeparateOddOut) .take_front(IsHighest ? 1 : 2); OddCarry = buildMadChain(LocalAccum, 2 * i - 1, OddCarryIn); Index: llvm/lib/Support/Path.cpp =================================================================== --- llvm/lib/Support/Path.cpp +++ llvm/lib/Support/Path.cpp @@ -1181,7 +1181,7 @@ for (;;) { Buffer.resize_for_overwrite(Size + ChunkSize); Expected<size_t> ReadBytes = readNativeFile( - FileHandle, makeMutableArrayRef(Buffer.begin() + Size, ChunkSize)); + FileHandle, MutableArrayRef(Buffer.begin() + Size, ChunkSize)); if (!ReadBytes) return ReadBytes.takeError(); if (*ReadBytes == 0) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp =================================================================== --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -719,7 +719,7 @@ APFloat apf = APFloat(APFloat::x87DoubleExtended(), GV.IntVal); uint64_t v; bool ignored; - (void)apf.convertToInteger(makeMutableArrayRef(v), BitWidth, + (void)apf.convertToInteger(MutableArrayRef(v), BitWidth, CE->getOpcode()==Instruction::FPToSI, APFloat::rmTowardZero, &ignored); GV.IntVal = v; // endian? Index: llvm/lib/Analysis/ConstantFolding.cpp =================================================================== --- llvm/lib/Analysis/ConstantFolding.cpp +++ llvm/lib/Analysis/ConstantFolding.cpp @@ -1867,7 +1867,7 @@ APFloat::roundingMode mode = roundTowardZero? APFloat::rmTowardZero : APFloat::rmNearestTiesToEven; APFloat::opStatus status = - Val.convertToInteger(makeMutableArrayRef(UIntVal), ResultWidth, + Val.convertToInteger(MutableArrayRef(UIntVal), ResultWidth, IsSigned, mode, &isExact); if (status != APFloat::opOK && (!roundTowardZero || status != APFloat::opInexact)) Index: llvm/include/llvm/Support/Parallel.h =================================================================== --- llvm/include/llvm/Support/Parallel.h +++ llvm/include/llvm/Support/Parallel.h @@ -203,7 +203,7 @@ // reductions are cheaper than the transformation. ResultTy FinalResult = std::move(Results.front()); for (ResultTy &PartialResult : - makeMutableArrayRef(Results.data() + 1, Results.size() - 1)) + MutableArrayRef(Results.data() + 1, Results.size() - 1)) FinalResult = Reduce(FinalResult, std::move(PartialResult)); return std::move(FinalResult); } Index: llvm/include/llvm/ProfileData/InstrProf.h =================================================================== --- llvm/include/llvm/ProfileData/InstrProf.h +++ llvm/include/llvm/ProfileData/InstrProf.h @@ -862,7 +862,7 @@ // cast away the constness from the result. auto AR = const_cast<const InstrProfRecord *>(this)->getValueSitesForKind( ValueKind); - return makeMutableArrayRef( + return MutableArrayRef( const_cast<InstrProfValueSiteRecord *>(AR.data()), AR.size()); } ArrayRef<InstrProfValueSiteRecord> Index: llvm/include/llvm/IR/Metadata.h =================================================================== --- llvm/include/llvm/IR/Metadata.h +++ llvm/include/llvm/IR/Metadata.h @@ -1027,7 +1027,7 @@ MutableArrayRef<MDOperand> operands() { if (IsLarge) return getLarge(); - return makeMutableArrayRef( + return MutableArrayRef( reinterpret_cast<MDOperand *>(this) - SmallSize, SmallNumOps); } Index: llvm/include/llvm/IR/DataLayout.h =================================================================== --- llvm/include/llvm/IR/DataLayout.h +++ llvm/include/llvm/IR/DataLayout.h @@ -643,7 +643,7 @@ unsigned getElementContainingOffset(uint64_t Offset) const; MutableArrayRef<uint64_t> getMemberOffsets() { - return llvm::makeMutableArrayRef(getTrailingObjects<uint64_t>(), + return llvm::MutableArrayRef(getTrailingObjects<uint64_t>(), NumElements); } Index: llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h =================================================================== --- llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h +++ llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h @@ -187,7 +187,7 @@ } MutableArrayRef<Entry> getMutableRows() { - return makeMutableArrayRef(Rows.get(), Header.NumBuckets); + return MutableArrayRef(Rows.get(), Header.NumBuckets); } }; Index: lldb/source/Host/common/NativeProcessProtocol.cpp =================================================================== --- lldb/source/Host/common/NativeProcessProtocol.cpp +++ lldb/source/Host/common/NativeProcessProtocol.cpp @@ -650,7 +650,7 @@ return error; auto data = - llvm::makeMutableArrayRef(static_cast<uint8_t *>(buf), bytes_read); + llvm::MutableArrayRef(static_cast<uint8_t *>(buf), bytes_read); for (const auto &pair : m_software_breakpoints) { lldb::addr_t bp_addr = pair.first; auto saved_opcodes = llvm::ArrayRef(pair.second.saved_opcodes); Index: lld/ELF/SyntheticSections.cpp =================================================================== --- lld/ELF/SyntheticSections.cpp +++ lld/ELF/SyntheticSections.cpp @@ -2818,7 +2818,7 @@ SmallVector<GdbSymbol, 0> ret; ret.reserve(numSymbols); for (SmallVector<GdbSymbol, 0> &vec : - makeMutableArrayRef(symbols.get(), numShards)) + MutableArrayRef(symbols.get(), numShards)) for (GdbSymbol &sym : vec) ret.push_back(std::move(sym)); Index: lld/ELF/InputFiles.h =================================================================== --- lld/ELF/InputFiles.h +++ lld/ELF/InputFiles.h @@ -181,7 +181,7 @@ numSymbols - firstGlobal); } MutableArrayRef<Symbol *> getMutableGlobalSymbols() { - return llvm::makeMutableArrayRef(symbols.get() + firstGlobal, + return llvm::MutableArrayRef(symbols.get() + firstGlobal, numSymbols - firstGlobal); } Index: lld/COFF/Writer.cpp =================================================================== --- lld/COFF/Writer.cpp +++ lld/COFF/Writer.cpp @@ -498,11 +498,11 @@ ArrayRef<coff_relocation> curRelocs = sc->getRelocs(); MutableArrayRef<coff_relocation> newRelocs; if (originalRelocs.data() == curRelocs.data()) { - newRelocs = makeMutableArrayRef( + newRelocs = MutableArrayRef( bAlloc().Allocate<coff_relocation>(originalRelocs.size()), originalRelocs.size()); } else { - newRelocs = makeMutableArrayRef( + newRelocs = MutableArrayRef( const_cast<coff_relocation *>(curRelocs.data()), curRelocs.size()); } Index: lld/COFF/DebugTypes.cpp =================================================================== --- lld/COFF/DebugTypes.cpp +++ lld/COFF/DebugTypes.cpp @@ -642,7 +642,7 @@ size_t offset = merged.recs.size(); size_t newSize = alignTo(ty.length(), 4); merged.recs.resize(offset + newSize); - auto newRec = makeMutableArrayRef(&merged.recs[offset], newSize); + auto newRec = MutableArrayRef(&merged.recs[offset], newSize); memcpy(newRec.data(), ty.data().data(), newSize); // Fix up the record prefix and padding bytes if it required resizing. Index: lld/COFF/Chunks.cpp =================================================================== --- lld/COFF/Chunks.cpp +++ lld/COFF/Chunks.cpp @@ -870,7 +870,7 @@ uint8_t flag; }; auto flags = - makeMutableArrayRef(reinterpret_cast<RVAFlag *>(buf), syms.size()); + MutableArrayRef(reinterpret_cast<RVAFlag *>(buf), syms.size()); for (auto t : zip(syms, flags)) { const auto &sym = std::get<0>(t); auto &flag = std::get<1>(t); Index: clang/lib/AST/StmtOpenMP.cpp =================================================================== --- clang/lib/AST/StmtOpenMP.cpp +++ clang/lib/AST/StmtOpenMP.cpp @@ -31,7 +31,7 @@ } MutableArrayRef<Stmt *> OMPChildren::getChildren() { - return llvm::makeMutableArrayRef(getTrailingObjects<Stmt *>(), NumChildren); + return llvm::MutableArrayRef(getTrailingObjects<Stmt *>(), NumChildren); } OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses) { Index: clang/include/clang/Lex/MacroInfo.h =================================================================== --- clang/include/clang/Lex/MacroInfo.h +++ clang/include/clang/Lex/MacroInfo.h @@ -257,7 +257,7 @@ NumReplacementTokens = NumTokens; Token *NewReplacementTokens = PPAllocator.Allocate<Token>(NumTokens); ReplacementTokens = NewReplacementTokens; - return llvm::makeMutableArrayRef(NewReplacementTokens, NumTokens); + return llvm::MutableArrayRef(NewReplacementTokens, NumTokens); } void setTokens(ArrayRef<Token> Tokens, llvm::BumpPtrAllocator &PPAllocator) { Index: clang/include/clang/AST/StmtOpenMP.h =================================================================== --- clang/include/clang/AST/StmtOpenMP.h +++ clang/include/clang/AST/StmtOpenMP.h @@ -1067,7 +1067,7 @@ MutableArrayRef<Expr *> getCounters() { auto **Storage = reinterpret_cast<Expr **>( &Data->getChildren()[getArraysOffset(getDirectiveKind())]); - return llvm::makeMutableArrayRef(Storage, getLoopsNumber()); + return llvm::MutableArrayRef(Storage, getLoopsNumber()); } /// Get the private counters storage. @@ -1075,7 +1075,7 @@ auto **Storage = reinterpret_cast<Expr **>( &Data->getChildren()[getArraysOffset(getDirectiveKind()) + getLoopsNumber()]); - return llvm::makeMutableArrayRef(Storage, getLoopsNumber()); + return llvm::MutableArrayRef(Storage, getLoopsNumber()); } /// Get the updates storage. @@ -1083,7 +1083,7 @@ auto **Storage = reinterpret_cast<Expr **>( &Data->getChildren()[getArraysOffset(getDirectiveKind()) + 2 * getLoopsNumber()]); - return llvm::makeMutableArrayRef(Storage, getLoopsNumber()); + return llvm::MutableArrayRef(Storage, getLoopsNumber()); } /// Get the updates storage. @@ -1091,7 +1091,7 @@ auto **Storage = reinterpret_cast<Expr **>( &Data->getChildren()[getArraysOffset(getDirectiveKind()) + 3 * getLoopsNumber()]); - return llvm::makeMutableArrayRef(Storage, getLoopsNumber()); + return llvm::MutableArrayRef(Storage, getLoopsNumber()); } /// Get the final counter updates storage. @@ -1099,7 +1099,7 @@ auto **Storage = reinterpret_cast<Expr **>( &Data->getChildren()[getArraysOffset(getDirectiveKind()) + 4 * getLoopsNumber()]); - return llvm::makeMutableArrayRef(Storage, getLoopsNumber()); + return llvm::MutableArrayRef(Storage, getLoopsNumber()); } /// Get the dependent counters storage. @@ -1107,7 +1107,7 @@ auto **Storage = reinterpret_cast<Expr **>( &Data->getChildren()[getArraysOffset(getDirectiveKind()) + 5 * getLoopsNumber()]); - return llvm::makeMutableArrayRef(Storage, getLoopsNumber()); + return llvm::MutableArrayRef(Storage, getLoopsNumber()); } /// Get the dependent inits storage. @@ -1115,7 +1115,7 @@ auto **Storage = reinterpret_cast<Expr **>( &Data->getChildren()[getArraysOffset(getDirectiveKind()) + 6 * getLoopsNumber()]); - return llvm::makeMutableArrayRef(Storage, getLoopsNumber()); + return llvm::MutableArrayRef(Storage, getLoopsNumber()); } /// Get the finals conditions storage. @@ -1123,7 +1123,7 @@ auto **Storage = reinterpret_cast<Expr **>( &Data->getChildren()[getArraysOffset(getDirectiveKind()) + 7 * getLoopsNumber()]); - return llvm::makeMutableArrayRef(Storage, getLoopsNumber()); + return llvm::MutableArrayRef(Storage, getLoopsNumber()); } protected: Index: clang/include/clang/AST/OpenMPClause.h =================================================================== --- clang/include/clang/AST/OpenMPClause.h +++ clang/include/clang/AST/OpenMPClause.h @@ -5425,7 +5425,7 @@ MutableArrayRef<Expr *> getUDMapperRefs() { assert(SupportsMapper && "Must be a clause that is possible to have user-defined mappers"); - return llvm::makeMutableArrayRef<Expr *>( + return llvm::MutableArrayRef<Expr *>( static_cast<T *>(this)->template getTrailingObjects<Expr *>() + OMPVarListClause<T>::varlist_size(), OMPVarListClause<T>::varlist_size()); @@ -8920,7 +8920,7 @@ /// Get the clauses storage. MutableArrayRef<OMPClause *> getClauses() { - return llvm::makeMutableArrayRef(getTrailingObjects<OMPClause *>(), + return llvm::MutableArrayRef(getTrailingObjects<OMPClause *>(), NumClauses); } ArrayRef<OMPClause *> getClauses() const { Index: clang/include/clang/AST/DeclOpenMP.h =================================================================== --- clang/include/clang/AST/DeclOpenMP.h +++ clang/include/clang/AST/DeclOpenMP.h @@ -123,7 +123,7 @@ MutableArrayRef<Expr *> getVars() { auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data()); - return llvm::makeMutableArrayRef(Storage, Data->getNumChildren()); + return llvm::MutableArrayRef(Storage, Data->getNumChildren()); } void setVars(ArrayRef<Expr *> VL); @@ -486,7 +486,7 @@ MutableArrayRef<Expr *> getVars() { auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data()); - return llvm::makeMutableArrayRef(Storage, Data->getNumChildren()); + return llvm::MutableArrayRef(Storage, Data->getNumChildren()); } void setVars(ArrayRef<Expr *> VL); 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 @@ -142,8 +142,8 @@ return llvm::ArrayRef(reinterpret_cast<ForestNode *const *>(this + 1), Num); } llvm::MutableArrayRef<ForestNode *> children(uint16_t Num) { - return llvm::makeMutableArrayRef(reinterpret_cast<ForestNode **>(this + 1), - Num); + return llvm::MutableArrayRef(reinterpret_cast<ForestNode **>(this + 1), + Num); } Token::Index StartIndex; Index: clang-tools-extra/clangd/index/dex/Trigram.cpp =================================================================== --- clang-tools-extra/clangd/index/dex/Trigram.cpp +++ clang-tools-extra/clangd/index/dex/Trigram.cpp @@ -32,7 +32,7 @@ // Apply fuzzy matching text segmentation. llvm::SmallVector<CharRole> Roles(Identifier.size()); calculateRoles(Identifier, - llvm::makeMutableArrayRef(Roles.data(), Identifier.size())); + llvm::MutableArrayRef(Roles.data(), Identifier.size())); std::string LowercaseIdentifier = Identifier.lower(); @@ -126,7 +126,7 @@ // Apply fuzzy matching text segmentation. llvm::SmallVector<CharRole> Roles(Query.size()); - calculateRoles(Query, llvm::makeMutableArrayRef(Roles.data(), Query.size())); + calculateRoles(Query, llvm::MutableArrayRef(Roles.data(), Query.size())); std::string LowercaseQuery = Query.lower(); Index: clang-tools-extra/clangd/SemanticSelection.cpp =================================================================== --- clang-tools-extra/clangd/SemanticSelection.cpp +++ clang-tools-extra/clangd/SemanticSelection.cpp @@ -154,7 +154,7 @@ Head.range = std::move(Ranges.front()); SelectionRange *Tail = &Head; for (auto &Range : - llvm::makeMutableArrayRef(Ranges.data(), Ranges.size()).drop_front()) { + llvm::MutableArrayRef(Ranges.data(), Ranges.size()).drop_front()) { Tail->parent = std::make_unique<SelectionRange>(); Tail = Tail->parent.get(); Tail->range = std::move(Range); Index: clang-tools-extra/clangd/FuzzyMatch.cpp =================================================================== --- clang-tools-extra/clangd/FuzzyMatch.cpp +++ clang-tools-extra/clangd/FuzzyMatch.cpp @@ -86,7 +86,7 @@ for (Action A : {Miss, Match}) Scores[P][W][A] = {AwfulScore, Miss}; PatTypeSet = calculateRoles(llvm::StringRef(Pat, PatN), - llvm::makeMutableArrayRef(PatRole, PatN)); + llvm::MutableArrayRef(PatRole, PatN)); } std::optional<float> FuzzyMatcher::match(llvm::StringRef Word) { @@ -200,7 +200,7 @@ // e.g. vsprintf is V S Print F, and should match [pri] but not [int]. // We could add a tokenization dictionary for common stdlib names. WordTypeSet = calculateRoles(llvm::StringRef(Word, WordN), - llvm::makeMutableArrayRef(WordRole, WordN)); + llvm::MutableArrayRef(WordRole, WordN)); return true; } Index: bolt/lib/Profile/DataAggregator.cpp =================================================================== --- bolt/lib/Profile/DataAggregator.cpp +++ bolt/lib/Profile/DataAggregator.cpp @@ -336,7 +336,7 @@ auto Close = make_scope_exit([&] { sys::fs::closeFile(*FD); }); Expected<size_t> BytesRead = sys::fs::readNativeFileSlice( - *FD, makeMutableArrayRef(Buf, sizeof(Buf)), 0); + *FD, MutableArrayRef(Buf, sizeof(Buf)), 0); if (!BytesRead) { consumeError(BytesRead.takeError()); return false;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits