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/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 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(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(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 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, WL); } 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 @@ -4139,8 +4139,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 @@ -4212,7 +4212,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); } @@ -4227,8 +4227,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 @@ -463,8 +463,8 @@ instr2instrSC(InsInstrs, InsInstrsSC); instr2instrSC(DelInstrs, DelInstrsSC); - ArrayRef MSCInsArr = makeArrayRef(InsInstrsSC); - ArrayRef MSCDelArr = makeArrayRef(DelInstrsSC); + ArrayRef MSCInsArr{InsInstrsSC}; + ArrayRef MSCDelArr{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 @@ -8464,7 +8464,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 @@ -2649,7 +2649,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); @@ -4265,7 +4265,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) { @@ -6862,7 +6862,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 @@ -1423,7 +1423,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); } @@ -9290,7 +9290,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) { @@ -10804,7 +10804,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); + ArrayRef SO = 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, 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, 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, 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, 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, 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 @@ -2218,7 +2218,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 @@ -12369,7 +12369,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 @@ -9633,7 +9633,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 @@ -404,7 +404,7 @@ return AttributeList::get(Ctx, CallSiteAttrs.getFnAttrs(), CallSiteAttrs.getRetAttrs(), - llvm::makeArrayRef(ArgumentAttributes)); + llvm::ArrayRef(ArgumentAttributes)); } class DataFlowSanitizer { @@ -3190,7 +3190,7 @@ (int)AtomicOrderingCABI::seq_cst; return ConstantDataVector::get(IRB.getContext(), - makeArrayRef(OrderingTable, NumOrderings)); + ArrayRef(OrderingTable, NumOrderings)); } void DFSanVisitor::visitLibAtomicLoad(CallBase &CB) { @@ -3235,7 +3235,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(); @@ -8888,8 +8888,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); @@ -11273,7 +11273,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)) { @@ -12546,7 +12546,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); } @@ -13044,7 +13044,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) && @@ -13066,8 +13066,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, (size_t)0), + ArrayRef((SubtargetSubTypeKV *)NULL, (size_t)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 @@ -300,8 +300,7 @@ void PseudoLoweringEmitter::run(raw_ostream &o) { StringRef Classes[] = {"PseudoInstExpansion", "Instruction"}; - std::vector Insts = - Records.getAllDerivedDefinitions(makeArrayRef(Classes)); + std::vector Insts = Records.getAllDerivedDefinitions(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);