Skip to content

Commit

Permalink
[llvm][ADT] Replace uses of makeMutableArrayRef with deduction guides
Browse files Browse the repository at this point in the history
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.

Differential Revision: https://reviews.llvm.org/D141814
  • Loading branch information
JoeLoser committed Jan 16, 2023
1 parent ffd3a19 commit a288d7f
Show file tree
Hide file tree
Showing 32 changed files with 53 additions and 55 deletions.
2 changes: 1 addition & 1 deletion bolt/lib/Profile/DataAggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ bool DataAggregator::checkPerfDataMagic(StringRef FileName) {

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;
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/clangd/FuzzyMatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ FuzzyMatcher::FuzzyMatcher(llvm::StringRef Pattern)
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) {
Expand Down Expand Up @@ -200,7 +200,7 @@ bool FuzzyMatcher::init(llvm::StringRef NewWord) {
// 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;
}

Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/SemanticSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ llvm::Expected<SelectionRange> getSemanticRanges(ParsedAST &AST, Position Pos) {
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);
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/clangd/index/dex/Trigram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static void identifierTrigrams(llvm::StringRef Identifier, Func Out) {
// 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();

Expand Down Expand Up @@ -126,7 +126,7 @@ std::vector<Token> generateQueryTrigrams(llvm::StringRef Query) {

// 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();

Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/pseudo/include/clang-pseudo/Forest.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ class alignas(class ForestNode *) ForestNode {
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;
Expand Down
4 changes: 2 additions & 2 deletions clang/include/clang/AST/DeclOpenMP.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class OMPThreadPrivateDecl final : public OMPDeclarativeDirective<Decl> {

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);
Expand Down Expand Up @@ -486,7 +486,7 @@ class OMPAllocateDecl final : public OMPDeclarativeDirective<Decl> {

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);
Expand Down
4 changes: 2 additions & 2 deletions clang/include/clang/AST/OpenMPClause.h
Original file line number Diff line number Diff line change
Expand Up @@ -5425,7 +5425,7 @@ class OMPMappableExprListClause : public OMPVarListClause<T>,
MutableArrayRef<Expr *> getUDMapperRefs() {
assert(SupportsMapper &&
"Must be a clause that is possible to have user-defined mappers");
return llvm::makeMutableArrayRef<Expr *>(
return llvm::MutableArrayRef<Expr *>(
static_cast<T *>(this)->template getTrailingObjects<Expr *>() +
OMPVarListClause<T>::varlist_size(),
OMPVarListClause<T>::varlist_size());
Expand Down Expand Up @@ -8920,7 +8920,7 @@ class OMPChildren final

/// Get the clauses storage.
MutableArrayRef<OMPClause *> getClauses() {
return llvm::makeMutableArrayRef(getTrailingObjects<OMPClause *>(),
return llvm::MutableArrayRef(getTrailingObjects<OMPClause *>(),
NumClauses);
}
ArrayRef<OMPClause *> getClauses() const {
Expand Down
16 changes: 8 additions & 8 deletions clang/include/clang/AST/StmtOpenMP.h
Original file line number Diff line number Diff line change
Expand Up @@ -1067,63 +1067,63 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
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.
MutableArrayRef<Expr *> getPrivateCounters() {
auto **Storage = reinterpret_cast<Expr **>(
&Data->getChildren()[getArraysOffset(getDirectiveKind()) +
getLoopsNumber()]);
return llvm::makeMutableArrayRef(Storage, getLoopsNumber());
return llvm::MutableArrayRef(Storage, getLoopsNumber());
}

/// Get the updates storage.
MutableArrayRef<Expr *> getInits() {
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.
MutableArrayRef<Expr *> getUpdates() {
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.
MutableArrayRef<Expr *> getFinals() {
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.
MutableArrayRef<Expr *> getDependentCounters() {
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.
MutableArrayRef<Expr *> getDependentInits() {
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.
MutableArrayRef<Expr *> getFinalsConditions() {
auto **Storage = reinterpret_cast<Expr **>(
&Data->getChildren()[getArraysOffset(getDirectiveKind()) +
7 * getLoopsNumber()]);
return llvm::makeMutableArrayRef(Storage, getLoopsNumber());
return llvm::MutableArrayRef(Storage, getLoopsNumber());
}

protected:
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Lex/MacroInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class MacroInfo {
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) {
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/StmtOpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void OMPChildren::setClauses(ArrayRef<OMPClause *> Clauses) {
}

MutableArrayRef<Stmt *> OMPChildren::getChildren() {
return llvm::makeMutableArrayRef(getTrailingObjects<Stmt *>(), NumChildren);
return llvm::MutableArrayRef(getTrailingObjects<Stmt *>(), NumChildren);
}

OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses) {
Expand Down
2 changes: 1 addition & 1 deletion lld/COFF/Chunks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ void RVAFlagTableChunk::writeTo(uint8_t *buf) const {
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);
Expand Down
2 changes: 1 addition & 1 deletion lld/COFF/DebugTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ void TpiSource::mergeTypeRecord(TypeIndex curIndex, CVType ty) {
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.
Expand Down
4 changes: 2 additions & 2 deletions lld/COFF/Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,11 @@ bool Writer::createThunks(OutputSection *os, int margin) {
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());
}

Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/InputFiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class ELFFileBase : public InputFile {
numSymbols - firstGlobal);
}
MutableArrayRef<Symbol *> getMutableGlobalSymbols() {
return llvm::makeMutableArrayRef(symbols.get() + firstGlobal,
return llvm::MutableArrayRef(symbols.get() + firstGlobal,
numSymbols - firstGlobal);
}

Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/SyntheticSections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2818,7 +2818,7 @@ createSymbols(
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));

Expand Down
3 changes: 1 addition & 2 deletions lldb/source/Host/common/NativeProcessProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,7 @@ Status NativeProcessProtocol::ReadMemoryWithoutTrap(lldb::addr_t addr,
if (error.Fail())
return error;

auto data =
llvm::makeMutableArrayRef(static_cast<uint8_t *>(buf), bytes_read);
llvm::MutableArrayRef data(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);
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class DWARFUnitIndex {
}

MutableArrayRef<Entry> getMutableRows() {
return makeMutableArrayRef(Rows.get(), Header.NumBuckets);
return MutableArrayRef(Rows.get(), Header.NumBuckets);
}
};

Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/DataLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ class StructLayout final : public TrailingObjects<StructLayout, uint64_t> {
unsigned getElementContainingOffset(uint64_t Offset) const;

MutableArrayRef<uint64_t> getMemberOffsets() {
return llvm::makeMutableArrayRef(getTrailingObjects<uint64_t>(),
return llvm::MutableArrayRef(getTrailingObjects<uint64_t>(),
NumElements);
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ class MDNode : public Metadata {
MutableArrayRef<MDOperand> operands() {
if (IsLarge)
return getLarge();
return makeMutableArrayRef(
return MutableArrayRef(
reinterpret_cast<MDOperand *>(this) - SmallSize, SmallNumOps);
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/ProfileData/InstrProf.h
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ struct InstrProfRecord {
// 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>
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Support/Parallel.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ ResultTy parallel_transform_reduce(IterTy Begin, IterTy End, ResultTy Init,
// 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);
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/ConstantFolding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,7 @@ Constant *ConstantFoldSSEConvertToInt(const APFloat &Val, bool roundTowardZero,
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))
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/ExecutionEngine/ExecutionEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
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?
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Support/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ Error readNativeFileToEOF(file_t FileHandle, SmallVectorImpl<char> &Buffer,
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)
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3081,7 +3081,7 @@ void AMDGPULegalizerInfo::buildMultiply(
} 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);

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static bool ConvertToSInt(const APFloat &APF, int64_t &IntVal) {
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;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8045,7 +8045,7 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
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(
Expand Down Expand Up @@ -9898,7 +9898,7 @@ Value *BoUpSLP::vectorizeTree(ExtraValueToDebugLocsMap &ExternallyUsedValues,
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())
Expand Down
4 changes: 2 additions & 2 deletions llvm/unittests/Support/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1960,7 +1960,7 @@ TEST_F(FileSystemTest, readNativeFile) {
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();
Expand Down Expand Up @@ -2027,7 +2027,7 @@ TEST_F(FileSystemTest, readNativeFileSlice) {
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();
Expand Down
6 changes: 3 additions & 3 deletions mlir/lib/Bytecode/Writer/IRNumbering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ IRNumberingState::IRNumberingState(Operation *op) {
// 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);
Expand Down
3 changes: 1 addition & 2 deletions mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ struct LoopCoalescingPass
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;
}
Expand Down
Loading

0 comments on commit a288d7f

Please sign in to comment.