Use deduction guides instead of helper functions.
The only non-automatic changes have been:
1. ArrayRef(some_uint8_pointer, 0) needs to be changed into ArrayRef(some_uint8_pointer, (size_t)0) to avoid an ambiguous call with ArrayRef((uint8_t*), (uint8_t*))
2. CVSymbol sym(makeArrayRef(symStorage)); needed to be rewritten as CVSymbol sym{ArrayRef(symStorage)}; otherwise the compiler is confused and thinks we have a (bad) function prototype. There was a few similar situation across the codebase.
3. ADL doesn't seem to work the same for deduction-guides and functions, so at some point the llvm namespace must be explicitly stated.
4. The "reference mode" of makeArrayRef(ArrayRef<T> &) that acts as no-op is not supported (a constructor cannot achieve that).
Per reviewers' comment, some useless makeArrayRef have been removed in the process.
This is a follow-up to https://reviews.llvm.org/D140896 that introduced
the deduction guides.
Differential Revision: https://reviews.llvm.org/D140955
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)
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)
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);
if (!isSmall())
return getPointer()->getData();
Store = getSmallBits();
- return makeArrayRef(Store);
+ return Store;
}
private:
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) {
bool addVariableRowFill(ArrayRef<int64_t> 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) {
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:
}
ArrayRef<const SCEV *> operands() const {
- return makeArrayRef(Operands, NumOperands);
+ return ArrayRef(Operands, NumOperands);
}
NoWrapFlags getNoWrapFlags(NoWrapFlags Mask = NoWrapMask) const {
/// in the buffer and should be handled separately by the caller.
template <typename BufferTy, typename... Data>
static void readRecord(BufferTy &buffer, Data &&...data) {
- return readRecord(llvm::makeArrayRef(buffer), std::forward<Data>(data)...);
+ return readRecord(llvm::ArrayRef(buffer), std::forward<Data>(data)...);
}
};
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);
}
if (!Abbrev) {
// If we don't have an abbrev to use, emit this in its fully unabbreviated
// form.
- auto Count = static_cast<uint32_t>(makeArrayRef(Vals).size());
+ auto Count = static_cast<uint32_t>(ArrayRef(Vals).size());
EmitCode(bitc::UNABBREV_RECORD);
EmitVBR(Code, 6);
EmitVBR(Count, 6);
return;
}
- EmitRecordWithAbbrevImpl(Abbrev, makeArrayRef(Vals), StringRef(), Code);
+ EmitRecordWithAbbrevImpl(Abbrev, ArrayRef(Vals), StringRef(), Code);
}
/// EmitRecordWithAbbrev - Emit a record with the specified abbreviation.
/// the first entry.
template <typename Container>
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
template <typename Container>
void EmitRecordWithBlob(unsigned Abbrev, const Container &Vals,
StringRef Blob) {
- EmitRecordWithAbbrevImpl(Abbrev, makeArrayRef(Vals), Blob, std::nullopt);
+ EmitRecordWithAbbrevImpl(Abbrev, ArrayRef(Vals), Blob, std::nullopt);
}
template <typename Container>
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);
}
template <typename Container>
void EmitRecordWithArray(unsigned Abbrev, const Container &Vals,
StringRef Array) {
- EmitRecordWithAbbrevImpl(Abbrev, makeArrayRef(Vals), Array, std::nullopt);
+ EmitRecordWithAbbrevImpl(Abbrev, ArrayRef(Vals), Array, std::nullopt);
}
template <typename Container>
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);
}
//===--------------------------------------------------------------------===//
inline const CostTblEntryT<CostType> *
CostTableLookup(const CostTblEntryT<CostType> (&Table)[N], int ISD, MVT Ty) {
// Wrapper to fix template argument deduction failures.
- return CostTableLookup<CostType>(makeArrayRef(Table), ISD, Ty);
+ return CostTableLookup<CostType>(Table, ISD, Ty);
}
/// Type Conversion Cost Table
ConvertCostTableLookup(const TypeConversionCostTblEntryT<CostType> (&Table)[N],
int ISD, MVT Dst, MVT Src) {
// Wrapper to fix template argument deduction failures.
- return ConvertCostTableLookup<CostType>(makeArrayRef(Table), ISD, Dst, Src);
+ return ConvertCostTableLookup<CostType>(Table, ISD, Dst, Src);
}
} // namespace llvm
/// we want to drop it from the NewRegs set.
void pop_back() { NewRegs.pop_back(); }
- ArrayRef<Register> regs() const {
- return makeArrayRef(NewRegs).slice(FirstNew);
- }
+ ArrayRef<Register> regs() const { return ArrayRef(NewRegs).slice(FirstNew); }
/// createFrom - Create a new virtual register based on OldReg.
Register createFrom(Register OldReg);
}
ArrayRef<MachineMemOperand *> getMMOs() const {
- return makeArrayRef(getTrailingObjects<MachineMemOperand *>(), NumMMOs);
+ return ArrayRef(getTrailingObjects<MachineMemOperand *>(), NumMMOs);
}
MCSymbol *getPreInstrSymbol() const {
return {};
if (Info.is<EIIK_MMO>())
- return makeArrayRef(Info.getAddrOfZeroTagPointer(), 1);
+ return ArrayRef(Info.getAddrOfZeroTagPointer(), 1);
if (ExtraInfo *EI = Info.get<EIIK_OutOfLine>())
return EI->getMMOs();
RCInfo() = default;
operator ArrayRef<MCPhysReg>() const {
- return makeArrayRef(Order.get(), NumRegs);
+ return ArrayRef(Order.get(), NumRegs);
}
};
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
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) {
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);
op_iterator op_begin() const { return OperandList; }
op_iterator op_end() const { return OperandList+NumOperands; }
- ArrayRef<SDUse> ops() const { return makeArrayRef(op_begin(), op_end()); }
+ ArrayRef<SDUse> ops() const { return ArrayRef(op_begin(), op_end()); }
/// Iterator for directly iterating over the operand SDValue's.
struct value_op_iterator
public:
ArrayRef<int> getMask() const {
EVT VT = getValueType(0);
- return makeArrayRef(Mask, VT.getVectorNumElements());
+ return ArrayRef(Mask, VT.getVectorNumElements());
}
int getMaskElt(unsigned Idx) const {
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<MachineMemOperand **>(), NumMemRefs);
+ return ArrayRef(MemRefs.get<MachineMemOperand **>(), NumMemRefs);
}
mmo_iterator memoperands_begin() const { return memoperands().begin(); }
mmo_iterator memoperands_end() const { return memoperands().end(); }
///
/// By default, this method returns all registers in the class.
ArrayRef<MCPhysReg> 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.
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.
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<StringRef> getMethodNames() const {
- return makeArrayRef(MethodNames).drop_front();
+ return ArrayRef(MethodNames).drop_front();
}
TypeIndex CompleteClass;
const Entry *getFromHash(uint64_t Offset) const;
ArrayRef<DWARFSectionKind> getColumnKinds() const {
- return makeArrayRef(ColumnKinds.get(), Header.NumColumns);
+ return ArrayRef(ColumnKinds.get(), Header.NumColumns);
}
ArrayRef<Entry> getRows() const {
- return makeArrayRef(Rows.get(), Header.NumBuckets);
+ return ArrayRef(Rows.get(), Header.NumBuckets);
}
};
unsigned getModuleIndex() const { return Layout.Mod; }
- ArrayRef<std::string> source_files() const {
- return makeArrayRef(SourceFiles);
- }
+ ArrayRef<std::string> source_files() const { return SourceFiles; }
uint32_t calculateSerializedLength() const;
/// ArrayRef<ElementTy>. Calls get(LLVMContext, ArrayRef<ElementTy>).
template <typename ArrayTy>
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
std::optional<unsigned> 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 *
}
ArrayRef<uint64_t> getMemberOffsets() const {
- return llvm::makeArrayRef(getTrailingObjects<uint64_t>(), NumElements);
+ return llvm::ArrayRef(getTrailingObjects<uint64_t>(), NumElements);
}
uint64_t getElementOffset(unsigned Idx) const {
param_iterator param_begin() const { return ContainedTys + 1; }
param_iterator param_end() const { return &ContainedTys[NumContainedTys]; }
ArrayRef<Type *> params() const {
- return makeArrayRef(param_begin(), param_end());
+ return ArrayRef(param_begin(), param_end());
}
/// Parameter type accessors.
element_iterator element_begin() const { return ContainedTys; }
element_iterator element_end() const { return &ContainedTys[NumContainedTys];}
ArrayRef<Type *> 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.
/// Return the type parameters for this particular target extension type. If
/// there are no parameters, an empty array is returned.
ArrayRef<Type *> 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;
/// Return the integer parameters for this particular target extension type.
/// If there are no parameters, an empty array is returned.
ArrayRef<unsigned> int_params() const {
- return makeArrayRef(IntParams, getNumIntParameters());
+ return ArrayRef(IntParams, getNumIntParameters());
}
unsigned getIntParameter(unsigned i) const { return IntParams[i]; }
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,
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,
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);
}
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};
ArrayRef<MDOperand> operands() const {
if (IsLarge)
return getLarge();
- return makeArrayRef(reinterpret_cast<const MDOperand *>(this) - SmallSize,
- SmallNumOps);
+ return ArrayRef(reinterpret_cast<const MDOperand *>(this) - SmallSize,
+ SmallNumOps);
}
unsigned getNumOperands() const {
public:
size_t size(BasicBlock *BB) const { return GetNumPreds(BB); }
ArrayRef<BasicBlock *> get(BasicBlock *BB) {
- return makeArrayRef(GetPreds(BB), GetNumPreds(BB));
+ return ArrayRef(GetPreds(BB), GetNumPreds(BB));
}
/// clear - Remove all information.
subtype_iterator subtype_begin() const { return ContainedTys; }
subtype_iterator subtype_end() const { return &ContainedTys[NumContainedTys];}
ArrayRef<Type*> subtypes() const {
- return makeArrayRef(subtype_begin(), subtype_end());
+ return ArrayRef(subtype_begin(), subtype_end());
}
using subtype_reverse_iterator = std::reverse_iterator<subtype_iterator>;
Expected<Elf_Sym_Range> symbols(const Elf_Shdr *Sec) const {
if (!Sec)
- return makeArrayRef<Elf_Sym>(nullptr, nullptr);
+ return ArrayRef<Elf_Sym>(nullptr, nullptr);
return getSectionContentsAsArray<Elf_Sym>(*Sec);
}
", e_phentsize = " + Twine(getHeader().e_phentsize));
auto *Begin = reinterpret_cast<const Elf_Phdr *>(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.
return createError("unaligned data");
const T *Start = reinterpret_cast<const T *>(base() + Offset);
- return makeArrayRef(Start, Size / sizeof(T));
+ return ArrayRef(Start, Size / sizeof(T));
}
template <class ELFT>
") + 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 <class ELFT>
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<Elf_Shdr>();
}
// 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 <class ELFT>
ELFObjectFile<ELFT>::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 <class ELFT>
ArrayRef<support::ulittle32_t> 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<uint8_t> UnwindByteCode() const {
+ (E() ? 0 : EpilogueCount());
const uint8_t *ByteCode =
reinterpret_cast<const uint8_t *>(&Data[Offset]);
- return makeArrayRef(ByteCode, CodeWords() * sizeof(uint32_t));
+ return ArrayRef(ByteCode, CodeWords() * sizeof(uint32_t));
}
uint32_t ExceptionHandlerRVA() const {
if (auto EC = checkOffsetForWrite(Offset, Buffer.size()))
return EC;
- Buffer = makeArrayRef(Data).slice(Offset, Size);
+ Buffer = ArrayRef(Data).slice(Offset, Size);
return Error::success();
}
if (auto EC = checkOffsetForWrite(Offset, 1))
return EC;
- Buffer = makeArrayRef(Data).slice(Offset);
+ Buffer = ArrayRef(Data).slice(Offset);
return Error::success();
}
/// Users of this function should pay attention to respect endianness
/// contraints.
void update(StringRef Data) {
- update(makeArrayRef(reinterpret_cast<const uint8_t *>(Data.data()),
- Data.size()));
+ update(
+ ArrayRef(reinterpret_cast<const uint8_t *>(Data.data()), Data.size()));
}
/// Forward to `HasherT::final()` if available.
add(Value.size());
if (hashbuilder_detail::IsHashableData<T>::value &&
Endianness == support::endian::system_endianness()) {
- this->update(
- makeArrayRef(reinterpret_cast<const uint8_t *>(Value.begin()),
- Value.size() * sizeof(T)));
+ this->update(ArrayRef(reinterpret_cast<const uint8_t *>(Value.begin()),
+ Value.size() * sizeof(T)));
} else {
for (auto &V : Value)
add(V);
// `StringRef::begin()` and `StringRef::end()`. Explicitly call `update` to
// guarantee the fast path.
add(Value.size());
- this->update(makeArrayRef(reinterpret_cast<const uint8_t *>(Value.begin()),
- Value.size()));
+ this->update(ArrayRef(reinterpret_cast<const uint8_t *>(Value.begin()),
+ Value.size()));
return *this;
}
/// friend void addHash(HashBuilderImpl<HasherT, Endianness> &HBuilder,
/// const StructWithFastHash &Value) {
/// if (Endianness == support::endian::system_endianness()) {
- /// HBuilder.update(makeArrayRef(
+ /// HBuilder.update(ArrayRef(
/// reinterpret_cast<const uint8_t *>(&Value), sizeof(Value)));
/// } else {
/// // Rely on existing `add` methods to handle endianness.
/// friend void addHash(HashBuilderImpl<HasherT, Endianness> &HBuilder,
/// const CustomContainer &Value) {
/// if (Endianness == support::endian::system_endianness()) {
- /// HBuilder.update(makeArrayRef(
+ /// HBuilder.update(ArrayRef(
/// reinterpret_cast<const uint8_t *>(&Value.Size),
/// sizeof(Value.Size) + Value.Size * sizeof(Value.Elements[0])));
/// } else {
std::enable_if_t<is_detected<HasByteSwapT, T>::value, HashBuilderImpl &>
adjustForEndiannessAndAdd(const T &Value) {
T SwappedValue = support::endian::byte_swap(Value, Endianness);
- this->update(makeArrayRef(reinterpret_cast<const uint8_t *>(&SwappedValue),
- sizeof(SwappedValue)));
+ this->update(ArrayRef(reinterpret_cast<const uint8_t *>(&SwappedValue),
+ sizeof(SwappedValue)));
return *this;
}
Endianness == support::endian::system_endianness(),
HashBuilderImpl &>
addRangeElementsImpl(T *First, T *Last, std::forward_iterator_tag) {
- this->update(makeArrayRef(reinterpret_cast<const uint8_t *>(First),
- (Last - First) * sizeof(T)));
+ this->update(ArrayRef(reinterpret_cast<const uint8_t *>(First),
+ (Last - First) * sizeof(T)));
return *this;
}
};
}
void printBinary(StringRef Label, StringRef Str, ArrayRef<char> Value) {
- auto V = makeArrayRef(reinterpret_cast<const uint8_t *>(Value.data()),
- Value.size());
+ auto V =
+ ArrayRef(reinterpret_cast<const uint8_t *>(Value.data()), Value.size());
printBinaryImpl(Label, Str, V, false);
}
}
void printBinary(StringRef Label, ArrayRef<char> Value) {
- auto V = makeArrayRef(reinterpret_cast<const uint8_t *>(Value.data()),
- Value.size());
+ auto V =
+ ArrayRef(reinterpret_cast<const uint8_t *>(Value.data()), Value.size());
printBinaryImpl(Label, StringRef(), V, false);
}
void printBinary(StringRef Label, StringRef Value) {
- auto V = makeArrayRef(reinterpret_cast<const uint8_t *>(Value.data()),
- Value.size());
+ auto V =
+ ArrayRef(reinterpret_cast<const uint8_t *>(Value.data()), Value.size());
printBinaryImpl(Label, StringRef(), V, false);
}
}
void printBinaryBlock(StringRef Label, StringRef Value) {
- auto V = makeArrayRef(reinterpret_cast<const uint8_t *>(Value.data()),
- Value.size());
+ auto V =
+ ArrayRef(reinterpret_cast<const uint8_t *>(Value.data()), Value.size());
printBinaryImpl(Label, StringRef(), V, true);
}
void Profile(FoldingSetNodeID &ID) const;
ArrayRef<Record *> getClasses() const {
- return makeArrayRef(getTrailingObjects<Record *>(), NumClasses);
+ return ArrayRef(getTrailingObjects<Record *>(), NumClasses);
}
using const_record_iterator = Record * const *;
std::string getAsString() const override;
ArrayRef<Init*> getValues() const {
- return makeArrayRef(getTrailingObjects<Init *>(), NumValues);
+ return ArrayRef(getTrailingObjects<Init *>(), NumValues);
}
const_iterator begin() const { return getTrailingObjects<Init *>(); }
}
ArrayRef<Init *> getConds() const {
- return makeArrayRef(getTrailingObjects<Init *>(), NumConds);
+ return ArrayRef(getTrailingObjects<Init *>(), NumConds);
}
ArrayRef<Init *> getVals() const {
- return makeArrayRef(getTrailingObjects<Init *>()+NumConds, NumConds);
+ return ArrayRef(getTrailingObjects<Init *>() + NumConds, NumConds);
}
Init *Fold(Record *CurRec) const;
size_t args_size () const { return NumArgs; }
bool args_empty() const { return NumArgs == 0; }
- ArrayRef<Init *> args() const { return makeArrayRef(args_begin(), NumArgs); }
+ ArrayRef<Init *> args() const { return ArrayRef(args_begin(), NumArgs); }
Init *getBit(unsigned Bit) const override {
llvm_unreachable("Illegal bit reference off anonymous def");
}
ArrayRef<Init *> getArgs() const {
- return makeArrayRef(getTrailingObjects<Init *>(), NumArgs);
+ return ArrayRef(getTrailingObjects<Init *>(), NumArgs);
}
ArrayRef<StringInit *> getArgNames() const {
- return makeArrayRef(getTrailingObjects<StringInit *>(), NumArgNames);
+ return ArrayRef(getTrailingObjects<StringInit *>(), NumArgNames);
}
Init *resolveReferences(Resolver &R) const override;
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.
bool ConstraintSystem::isConditionImplied(SmallVector<int64_t, 8> 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
if (auto *GEP = dyn_cast<GetElementPtrInst>(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<SelectInst>(I))
case Instruction::GetElementPtr: {
auto *GEPI = cast<GetElementPtrInst>(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<InsertValueInst>(I);
// 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.
}
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());
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
// %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);
}
// 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<ExtractValueInst>(V)) {
" 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;
static bool classof(const Value *V) { return V->getValueID() == SubclassID; }
ArrayRef<unsigned> getOperandIDs() const {
- return makeArrayRef(getTrailingObjects<unsigned>(), NumOperands);
+ return ArrayRef(getTrailingObjects<unsigned>(), NumOperands);
}
std::optional<unsigned> getInRangeIndex() const {
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]);
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<GetElementPtrInst>(I)->setIsInBounds();
break;
unsigned ActiveWords = 1;
if (ValueBitWidth > 64)
ActiveWords = Record[CurIdx++];
- Low = readWideAPInt(makeArrayRef(&Record[CurIdx], ActiveWords),
+ Low = readWideAPInt(ArrayRef(&Record[CurIdx], ActiveWords),
ValueBitWidth);
CurIdx += ActiveWords;
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
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);
/// Get the MDString metadata for this block.
ArrayRef<const Metadata *> getMDStrings() const {
- return makeArrayRef(MDs).slice(NumModuleMDs, NumMDStrings);
+ return ArrayRef(MDs).slice(NumModuleMDs, NumMDStrings);
}
/// Get the non-MDString metadata for this block.
ArrayRef<const Metadata *> getNonMDStrings() const {
- return makeArrayRef(MDs).slice(NumModuleMDs).slice(NumMDStrings);
+ return ArrayRef(MDs).slice(NumModuleMDs).slice(NumMDStrings);
}
const TypeList &getTypes() const { return Types; }
TypeIndex ReturnTypeIndex = TypeIndex::Void();
ArrayRef<TypeIndex> ArgTypeIndices = std::nullopt;
if (!ReturnAndArgTypeIndices.empty()) {
- auto ReturnAndArgTypesRef = makeArrayRef(ReturnAndArgTypeIndices);
+ auto ReturnAndArgTypesRef = ArrayRef(ReturnAndArgTypeIndices);
ReturnTypeIndex = ReturnAndArgTypesRef.front();
ArgTypeIndices = ReturnAndArgTypesRef.drop_front();
}
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
}
// 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
ArrayRef<Entry> 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<char> 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<std::string> 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:
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:
}
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
// 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 {
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.
if (VA.needsCustom()) {
std::function<void()> 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)
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;
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;
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);
}
instr2instrSC(InsInstrs, InsInstrsSC);
instr2instrSC(DelInstrs, DelInstrsSC);
- ArrayRef<const MCSchedClassDesc *> MSCInsArr = makeArrayRef(InsInstrsSC);
- ArrayRef<const MCSchedClassDesc *> MSCDelArr = makeArrayRef(DelInstrsSC);
+ ArrayRef<const MCSchedClassDesc *> MSCInsArr{InsInstrsSC};
+ ArrayRef<const MCSchedClassDesc *> MSCDelArr{DelInstrsSC};
// Compute new resource length.
unsigned ResLenAfterCombine =
"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);
}
//===----------------------------------------------------------------------===//
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
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);
}
//===----------------------------------------------------------------------===//
assert(T < GroupSize && "Array overflow");
TBS[T] = Number;
if (++T == GroupSize) {
- SpillPlacer->addLinks(makeArrayRef(TBS, T));
+ SpillPlacer->addLinks(ArrayRef(TBS, T));
T = 0;
}
continue;
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;
}
// 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;
PhysicalRegisterUsageInfo::getRegUsageInfo(const Function &FP) {
auto It = RegMasks.find(&FP);
if (It != RegMasks.end())
- return makeArrayRef<uint32_t>(It->second);
+ return ArrayRef<uint32_t>(It->second);
return ArrayRef<uint32_t>();
}
// Check if the bytes of the OR we are looking at match with either big or
// little endian value load
std::optional<bool> IsBigEndian = isBigEndian(
- makeArrayRef(ByteOffsets).drop_back(ZeroExtendedBytes), FirstOffset);
+ ArrayRef(ByteOffsets).drop_back(ZeroExtendedBytes), FirstOffset);
if (!IsBigEndian)
return SDValue();
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.
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;
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);
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);
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);
SmallVector<SDValue, 8> 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);
}
// input vectors to use as shuffle operands.
unsigned FirstMaskIdx = High * NewElts;
SmallVector<int> 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);
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) {
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 =
}
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());
"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.
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;
}
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
// 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;
}
}
SDValue StoreNode = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
- makeArrayRef(Chains.data(), ChainI));
+ ArrayRef(Chains.data(), ChainI));
setValue(&I, StoreNode);
DAG.setRoot(StoreNode);
}
if (StructType *StructResult = dyn_cast<StructType>(CallResultType))
ResultTypes = StructResult->elements();
else if (!CallResultType->isVoidTy())
- ResultTypes = makeArrayRef(CallResultType);
+ ResultTypes = ArrayRef(CallResultType);
auto CurResultType = ResultTypes.begin();
auto handleRegAssign = [&](SDValue V) {
dyn_cast<FrameIndexSDNode>(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);
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());
// 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;
// the general case.
uint32_t Offset = getCurrentOffset();
std::optional<uint32_t> Min = Limits.front().bytesRemaining(Offset);
- for (auto X : makeArrayRef(Limits).drop_front()) {
+ for (auto X : ArrayRef(Limits).drop_front()) {
std::optional<uint32_t> ThisMin = X.bytesRemaining(Offset);
if (ThisMin)
Min = Min ? std::min(*Min, *ThisMin) : *ThisMin;
std::vector<CVType> Types;
Types.reserve(SegmentOffsets.size());
- auto SO = makeArrayRef(SegmentOffsets);
+ ArrayRef SO = SegmentOffsets;
uint32_t End = SegmentWriter.getOffset();
if (!Bytes.empty()) {
uint8_t *Copy = Storage.Allocate<uint8_t>(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);
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;
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();
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();
}
if (auto EC = Writer.writeInteger<uint32_t>(E.ExtraFiles.size()))
return EC;
- if (auto EC = Writer.writeArray(makeArrayRef(E.ExtraFiles)))
+ if (auto EC = Writer.writeArray(ArrayRef(E.ExtraFiles)))
return EC;
}
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;
}
}
: DebugSubsection(DebugSubsectionKind::CoffSymbolRVA) {}
Error DebugSymbolRVASubsection::commit(BinaryStreamWriter &Writer) const {
- return Writer.writeArray(makeArrayRef(RVAs));
+ return Writer.writeArray(ArrayRef(RVAs));
}
uint32_t DebugSymbolRVASubsection::calculateSerializedSize() const {
namespace codeview {
ArrayRef<EnumEntry<SymbolKind>> getSymbolTypeNames() {
- return makeArrayRef(SymbolTypeNames);
+ return ArrayRef(SymbolTypeNames);
}
ArrayRef<EnumEntry<TypeLeafKind>> getTypeLeafNames() {
- return makeArrayRef(TypeLeafNames);
+ return ArrayRef(TypeLeafNames);
}
ArrayRef<EnumEntry<uint16_t>> 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<EnumEntry<uint32_t>> getPublicSymFlagNames() {
- return makeArrayRef(PublicSymFlagNames);
+ return ArrayRef(PublicSymFlagNames);
}
ArrayRef<EnumEntry<uint8_t>> getProcSymFlagNames() {
- return makeArrayRef(ProcSymFlagNames);
+ return ArrayRef(ProcSymFlagNames);
}
ArrayRef<EnumEntry<uint16_t>> getLocalFlagNames() {
- return makeArrayRef(LocalFlags);
+ return ArrayRef(LocalFlags);
}
ArrayRef<EnumEntry<uint8_t>> getFrameCookieKindNames() {
- return makeArrayRef(FrameCookieKinds);
+ return ArrayRef(FrameCookieKinds);
}
ArrayRef<EnumEntry<SourceLanguage>> getSourceLanguageNames() {
- return makeArrayRef(SourceLanguages);
+ return ArrayRef(SourceLanguages);
}
ArrayRef<EnumEntry<uint32_t>> getCompileSym2FlagNames() {
- return makeArrayRef(CompileSym2FlagNames);
+ return ArrayRef(CompileSym2FlagNames);
}
ArrayRef<EnumEntry<uint32_t>> getCompileSym3FlagNames() {
- return makeArrayRef(CompileSym3FlagNames);
+ return ArrayRef(CompileSym3FlagNames);
}
ArrayRef<EnumEntry<uint32_t>> getFileChecksumNames() {
- return makeArrayRef(FileChecksumNames);
+ return ArrayRef(FileChecksumNames);
}
ArrayRef<EnumEntry<unsigned>> getCPUTypeNames() {
- return makeArrayRef(CPUTypeNames);
+ return ArrayRef(CPUTypeNames);
}
ArrayRef<EnumEntry<uint32_t>> getFrameProcSymFlagNames() {
- return makeArrayRef(FrameProcSymFlagNames);
+ return ArrayRef(FrameProcSymFlagNames);
}
ArrayRef<EnumEntry<uint16_t>> getExportSymFlagNames() {
- return makeArrayRef(ExportSymFlagNames);
+ return ArrayRef(ExportSymFlagNames);
}
ArrayRef<EnumEntry<uint32_t>> getModuleSubstreamKindNames() {
- return makeArrayRef(ModuleSubstreamKindNames);
+ return ArrayRef(ModuleSubstreamKindNames);
}
ArrayRef<EnumEntry<uint8_t>> getThunkOrdinalNames() {
- return makeArrayRef(ThunkOrdinalNames);
+ return ArrayRef(ThunkOrdinalNames);
}
ArrayRef<EnumEntry<uint16_t>> getTrampolineNames() {
- return makeArrayRef(TrampolineNames);
+ return ArrayRef(TrampolineNames);
}
ArrayRef<EnumEntry<COFF::SectionCharacteristics>>
getImageSectionCharacteristicNames() {
- return makeArrayRef(ImageSectionCharacteristicNames);
+ return ArrayRef(ImageSectionCharacteristicNames);
}
ArrayRef<EnumEntry<uint16_t>> getClassOptionNames() {
- return makeArrayRef(ClassOptionNames);
+ return ArrayRef(ClassOptionNames);
}
ArrayRef<EnumEntry<uint8_t>> getMemberAccessNames() {
- return makeArrayRef(MemberAccessNames);
+ return ArrayRef(MemberAccessNames);
}
ArrayRef<EnumEntry<uint16_t>> getMethodOptionNames() {
- return makeArrayRef(MethodOptionNames);
+ return ArrayRef(MethodOptionNames);
}
ArrayRef<EnumEntry<uint16_t>> getMemberKindNames() {
- return makeArrayRef(MemberKindNames);
+ return ArrayRef(MemberKindNames);
}
ArrayRef<EnumEntry<uint8_t>> getPtrKindNames() {
- return makeArrayRef(PtrKindNames);
+ return ArrayRef(PtrKindNames);
}
ArrayRef<EnumEntry<uint8_t>> getPtrModeNames() {
- return makeArrayRef(PtrModeNames);
+ return ArrayRef(PtrModeNames);
}
ArrayRef<EnumEntry<uint16_t>> getPtrMemberRepNames() {
- return makeArrayRef(PtrMemberRepNames);
+ return ArrayRef(PtrMemberRepNames);
}
ArrayRef<EnumEntry<uint16_t>> getTypeModifierNames() {
- return makeArrayRef(TypeModifierNames);
+ return ArrayRef(TypeModifierNames);
}
ArrayRef<EnumEntry<uint8_t>> getCallingConventions() {
- return makeArrayRef(CallingConventions);
+ return ArrayRef(CallingConventions);
}
ArrayRef<EnumEntry<uint8_t>> getFunctionOptionEnum() {
- return makeArrayRef(FunctionOptionEnum);
+ return ArrayRef(FunctionOptionEnum);
}
ArrayRef<EnumEntry<uint16_t>> getLabelTypeEnum() {
- return makeArrayRef(LabelTypeEnum);
+ return ArrayRef(LabelTypeEnum);
}
} // end namespace codeview
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<uint8_t> Guid)
: FormatAdapter(std::move(Guid)) {}
ArrayRef<uint8_t> Data) {
uint8_t *Stable = Alloc.Allocate<uint8_t>(Data.size());
memcpy(Stable, Data.data(), Data.size());
- return makeArrayRef(Stable, Data.size());
+ return ArrayRef(Stable, Data.size());
}
TypeIndex GlobalTypeTableBuilder::insertRecordBytes(ArrayRef<uint8_t> Record) {
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)
ArrayRef<uint8_t> Data) {
uint8_t *Stable = Alloc.Allocate<uint8_t>(Data.size());
memcpy(Stable, Data.data(), Data.size());
- return makeArrayRef(Stable, Data.size());
+ return ArrayRef(Stable, Data.size());
}
TypeIndex MergingTypeTableBuilder::insertRecordAs(hash_code Hash,
W->getOStream() << " {\n";
W->indent();
W->printEnum("TypeLeafKind", unsigned(Record.kind()),
- makeArrayRef(LeafTypeNames));
+ ArrayRef(LeafTypeNames));
return Error::success();
}
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();
}
Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, ClassRecord &Class) {
uint16_t Props = static_cast<uint16_t>(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());
Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, UnionRecord &Union) {
uint16_t Props = static_cast<uint16_t>(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());
uint16_t Props = static_cast<uint16_t>(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());
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();
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());
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());
printTypeIndex("ClassType", MI.getContainingType());
W->printEnum("Representation", uint16_t(MI.getRepresentation()),
- makeArrayRef(PtrMemberRepNames));
+ ArrayRef(PtrMemberRepNames));
}
return Error::success();
Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, ModifierRecord &Mod) {
uint16_t Mods = static_cast<uint16_t>(Mod.getModifiers());
printTypeIndex("ModifiedType", Mod.getModifiedType());
- W->printFlags("Modifiers", Mods, makeArrayRef(TypeModifierNames));
+ W->printFlags("Modifiers", Mods, ArrayRef(TypeModifierNames));
return Error::success();
}
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));
}
}
}
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();
}
}
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();
}
ArrayRef<uint8_t> BytesToHash;
if (TI.isSimple() || TI.isNoneType()) {
const uint8_t *IndexBytes = reinterpret_cast<const uint8_t *>(&TI);
- BytesToHash = makeArrayRef(IndexBytes, sizeof(TypeIndex));
+ BytesToHash = ArrayRef(IndexBytes, sizeof(TypeIndex));
} else {
if (TI.toArrayIndex() >= Prev.size() ||
Prev[TI.toArrayIndex()].empty()) {
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;
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));
}
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));
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ModifierRecord &Record) {
std::string ModifierNames =
getFlagNames(IO, static_cast<uint16_t>(Record.Modifiers),
- makeArrayRef(getTypeModifierNames()));
+ ArrayRef(getTypeModifierNames()));
error(IO.mapInteger(Record.ModifiedType, "ModifiedType"));
error(IO.mapEnum(Record.Modifiers, "Modifiers" + ModifierNames));
return Error::success();
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<uint16_t>(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));
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<uint16_t>(Record.Options),
- makeArrayRef(getFunctionOptionEnum()));
+ ArrayRef(getFunctionOptionEnum()));
error(IO.mapInteger(Record.ReturnType, "ReturnType"));
error(IO.mapInteger(Record.ClassType, "ClassType"));
error(IO.mapInteger(Record.ThisType, "ThisType"));
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();
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));
}
std::string PropertiesNames =
getFlagNames(IO, static_cast<uint16_t>(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"));
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, UnionRecord &Record) {
std::string PropertiesNames =
getFlagNames(IO, static_cast<uint16_t>(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"));
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, EnumRecord &Record) {
std::string PropertiesNames =
getFlagNames(IO, static_cast<uint16_t>(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"));
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();
}
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.
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<uint64_t> DWARFFormValue::getAsCStringOffset() const {
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)
sizeof(object::FpoData) * OldFpoData.size();
DbgStreams[(int)DbgHeaderType::FPO]->WriteFn =
[this](BinaryStreamWriter &Writer) {
- return Writer.writeArray(makeArrayRef(OldFpoData));
+ return Writer.writeArray(ArrayRef(OldFpoData));
};
}
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;
}
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;
}
namespace llvm {
namespace pdb {
ArrayRef<EnumEntry<uint16_t>> getOMFSegMapDescFlagNames() {
- return makeArrayRef(OMFSegMapDescFlagNames);
+ return ArrayRef(OMFSegMapDescFlagNames);
}
}
}
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<uint8_t *>(Mem), Size));
+ return CVSymbol(ArrayRef(reinterpret_cast<uint8_t *>(Mem), Size));
}
uint32_t GSIHashStreamBuilder::calculateSerializedLength() const {
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();
}
std::vector<support::ulittle32_t> 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();
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) {
"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.
// 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;
StringRef VCLibs[] = {"libvcruntime.lib", "libcmt.lib", "libcpmt.lib"};
StringRef UCRTLibs[] = {"libucrt.lib"};
std::vector<std::string> 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;
}
StringRef VCLibs[] = {"vcruntime.lib", "msvcrt.lib", "msvcprt.lib"};
StringRef UCRTLibs[] = {"ucrt.lib"};
std::vector<std::string> 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;
}
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");
// Choose an insertion point for our new instruction.
size_t IP = uniform<size_t>(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<Value *, 2> Srcs;
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])) {
// Choose a point where we split the block.
uint64_t IP = uniform<uint64_t>(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
uint64_t Idx = uniform<uint64_t>(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))
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
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<Attribute> AttrList) {
}
void AttributeListImpl::Profile(FoldingSetNodeID &ID) const {
- Profile(ID, makeArrayRef(begin(), end()));
+ Profile(ID, ArrayRef(begin(), end()));
}
void AttributeListImpl::Profile(FoldingSetNodeID &ID,
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.
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.
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;
}
}
- 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);
}
// 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);
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<PoisonValue>(C))
return PoisonValue::get(GEPTy);
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<uint8_t, 64> ElementVals;
unsigned Count) {
LLVMContext &Context = *unwrap(C);
SmallVector<Metadata *, 8> MDs;
- for (auto *OV : makeArrayRef(Vals, Count)) {
+ for (auto *OV : ArrayRef(Vals, Count)) {
Value *V = unwrap(OV);
Metadata *MD;
if (!V)
unsigned NumWords,
const uint64_t Words[]) {
IntegerType *Ty = unwrap<IntegerType>(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[],
LLVMValueRef *ConstantVals,
unsigned Count, LLVMBool Packed) {
Constant **Elements = unwrap<Constant>(ConstantVals, Count);
- return wrap(ConstantStruct::getAnon(*unwrap(C), makeArrayRef(Elements, Count),
+ return wrap(ConstantStruct::getAnon(*unwrap(C), ArrayRef(Elements, Count),
Packed != 0));
}
Constant **Elements = unwrap<Constant>(ConstantVals, Count);
StructType *Ty = unwrap<StructType>(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<Constant>(ScalarConstantVals, Size), Size)));
+ return wrap(ConstantVector::get(
+ ArrayRef(unwrap<Constant>(ScalarConstantVals, Size), Size)));
}
/*-- Opcode mapping */
LLVMValueRef *Args, unsigned NumArgs,
LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
const char *Name) {
- return wrap(unwrap(B)->CreateInvoke(
- unwrap<FunctionType>(Ty), unwrap(Fn), unwrap(Then), unwrap(Catch),
- makeArrayRef(unwrap(Args), NumArgs), Name));
+ return wrap(unwrap(B)->CreateInvoke(unwrap<FunctionType>(Ty), unwrap(Fn),
+ unwrap(Then), unwrap(Catch),
+ ArrayRef(unwrap(Args), NumArgs), Name));
}
LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty,
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,
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) {
const char *Name) {
FunctionType *FTy = unwrap<FunctionType>(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,
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;
}
// 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
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",
};
ArrayRef<const char*> LTO::getRuntimeLibcallSymbols() {
- return makeArrayRef(libcallRoutineNames);
+ return ArrayRef(libcallRoutineNames);
}
/// This class defines the interface to the ThinLTO backend.
cast<PointerType>(Ty)->getAddressSpace());
case Type::FunctionTyID:
return *Entry = FunctionType::get(ElementTypes[0],
- makeArrayRef(ElementTypes).slice(1),
+ ArrayRef(ElementTypes).slice(1),
cast<FunctionType>(Ty)->isVarArg());
case Type::StructTyID: {
auto *STy = cast<StructType>(Ty);
raw_svector_ostream VecOS(UncompressedData);
Asm.writeSectionData(VecOS, &Section, Layout);
ArrayRef<uint8_t> Uncompressed =
- makeArrayRef(reinterpret_cast<uint8_t *>(UncompressedData.data()),
- UncompressedData.size());
+ ArrayRef(reinterpret_cast<uint8_t *>(UncompressedData.data()),
+ UncompressedData.size());
SmallVector<uint8_t, 128> Compressed;
uint32_t ChType;
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,
};
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) {
// 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<uint8_t*>(Buf.data()), Buf.size()));
+ JC.update(ArrayRef(reinterpret_cast<uint8_t *>(Buf.data()), Buf.size()));
return JC.getCRC();
}
Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_ALIGN_1BYTES;
addSection(Obj, NewSection.SectionName,
- makeArrayRef(reinterpret_cast<const uint8_t *>(
- NewSection.SectionData->getBufferStart()),
- NewSection.SectionData->getBufferSize()),
+ ArrayRef(reinterpret_cast<const uint8_t *>(
+ NewSection.SectionData->getBufferStart()),
+ NewSection.SectionData->getBufferSize()),
Characteristics);
}
NewSection.SectionData->getBufferSize());
std::unique_ptr<MemoryBuffer> BufferCopy = MemoryBuffer::getMemBufferCopy(
InputData, NewSection.SectionData->getBufferIdentifier());
- Sec.Contents = makeArrayRef<uint8_t>(
+ Sec.Contents = ArrayRef<uint8_t>(
reinterpret_cast<const uint8_t *>(BufferCopy->getBufferStart()),
BufferCopy->getBufferSize());
"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 {
uint32_t SectionSize = getSectionSize(Sec);
if (Error E = checkOffset(Data, ConStart, SectionSize))
return E;
- Res = makeArrayRef(reinterpret_cast<const uint8_t *>(ConStart), SectionSize);
+ Res = ArrayRef(reinterpret_cast<const uint8_t *>(ConStart), SectionSize);
return Error::success();
}
for (const Elf_Phdr &Phdr : *ProgramHeadersOrError) {
if (Phdr.p_type == ELF::PT_DYNAMIC) {
- Dyn = makeArrayRef(
- reinterpret_cast<const Elf_Dyn *>(base() + Phdr.p_offset),
- Phdr.p_filesz / sizeof(Elf_Dyn));
+ Dyn = ArrayRef(reinterpret_cast<const Elf_Dyn *>(base() + Phdr.p_offset),
+ Phdr.p_filesz / sizeof(Elf_Dyn));
break;
}
}
assert(Sec.d.a < Sections.size() && "Should have detected this earlier");
const section_base *Base =
reinterpret_cast<const section_base *>(Sections[Sec.d.a]);
- return makeArrayRef(Base->sectname);
+ return ArrayRef(Base->sectname);
}
ArrayRef<char>
assert(Sec.d.a < Sections.size() && "Should have detected this earlier");
const section_base *Base =
reinterpret_cast<const section_base *>(Sections[Sec.d.a]);
- return makeArrayRef(Base->segname);
+ return ArrayRef(Base->segname);
}
bool
MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.rebase_off));
- return makeArrayRef(Ptr, DyldInfo.rebase_size);
+ return ArrayRef(Ptr, DyldInfo.rebase_size);
}
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoBindOpcodes() const {
MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.bind_off));
- return makeArrayRef(Ptr, DyldInfo.bind_size);
+ return ArrayRef(Ptr, DyldInfo.bind_size);
}
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoWeakBindOpcodes() const {
MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.weak_bind_off));
- return makeArrayRef(Ptr, DyldInfo.weak_bind_size);
+ return ArrayRef(Ptr, DyldInfo.weak_bind_size);
}
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoLazyBindOpcodes() const {
MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.lazy_bind_off));
- return makeArrayRef(Ptr, DyldInfo.lazy_bind_size);
+ return ArrayRef(Ptr, DyldInfo.lazy_bind_size);
}
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoExportsTrie() const {
MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.export_off));
- return makeArrayRef(Ptr, DyldInfo.export_size);
+ return ArrayRef(Ptr, DyldInfo.export_size);
}
Expected<std::optional<MachO::linkedit_data_command>>
MachO::linkedit_data_command DyldExportsTrie = DyldExportsTrieOrError.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldExportsTrie.dataoff));
- return makeArrayRef(Ptr, DyldExportsTrie.datasize);
+ return ArrayRef(Ptr, DyldExportsTrie.datasize);
}
SmallVector<uint64_t> MachOObjectFile::getFunctionStarts() const {
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<const uint8_t *>(Ptr), 16);
+ return ArrayRef(reinterpret_cast<const uint8_t *>(Ptr), 16);
}
StringRef MachOObjectFile::getStringTableData() const {
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(
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 {
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))
allocateNewArray(const iterator_range<RangeType> &Range);
template <typename T> size_t allocateObject(const T &Data) {
- return allocateArray(makeArrayRef(Data));
+ return allocateArray(ArrayRef(Data));
}
template <typename T, typename... Types>
File.allocateNewObject<minidump::MemoryInfoListHeader>(
sizeof(minidump::MemoryInfoListHeader), sizeof(minidump::MemoryInfo),
InfoList.Infos.size());
- File.allocateArray(makeArrayRef(InfoList.Infos));
+ File.allocateArray(ArrayRef(InfoList.Infos));
break;
}
case Stream::StreamKind::MemoryList:
File.allocateObject(Obj.Header);
std::vector<Directory> 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))
namespace yaml {
template <std::size_t N> struct ScalarTraits<FixedSizeHex<N>> {
static void output(const FixedSizeHex<N> &Fixed, void *, raw_ostream &OS) {
- OS << toHex(makeArrayRef(Fixed.Storage));
+ OS << toHex(ArrayRef(Fixed.Storage));
}
static StringRef input(StringRef Scalar, void *, FixedSizeHex<N> &Fixed) {
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());
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())
if (!llvm::compression::zlib::isAvailable())
return make_error<InstrProfError>(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<InstrProfError>(instrprof_error::uncompress_failed);
}
uint8_t *Buffer = Allocator.Allocate<uint8_t>(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<const uint8_t *>(Buffer);
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)) {
// 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.
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)
// 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);
"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) {
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) {
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) {
"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) {
"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) {
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) {
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,
: BinaryStreamRefBase(std::make_shared<ArrayRefImpl>(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<uint8_t> &Buffer) const {
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) {
return cursor.takeError();
if (sw) {
- sw->printEnum("Tag", tag, makeArrayRef(tagNames));
+ sw->printEnum("Tag", tag, ArrayRef(tagNames));
sw->printNumber("Size", size);
}
if (size < 5)
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;
}
if (free < 8) {
memset(&InternalState.buffer[used], 0, free);
- body(makeArrayRef(InternalState.buffer, 64));
+ body(ArrayRef(InternalState.buffer, 64));
used = 0;
free = 64;
}
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);
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) {
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;
}
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)
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) {
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()) {
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));
// 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)
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);
}
}
void BitsInit::Profile(FoldingSetNodeID &ID) const {
- ProfileBitsInit(ID, makeArrayRef(getTrailingObjects<Init *>(), NumBits));
+ ProfileBitsInit(ID, ArrayRef(getTrailingObjects<Init *>(), NumBits));
}
Init *BitsInit::convertInitializerTo(RecTy *Ty) const {
}
void CondOpInit::Profile(FoldingSetNodeID &ID) const {
- ProfileCondOpInit(ID,
- makeArrayRef(getTrailingObjects<Init *>(), NumConds),
- makeArrayRef(getTrailingObjects<Init *>() + NumConds, NumConds),
- ValType);
+ ProfileCondOpInit(ID, ArrayRef(getTrailingObjects<Init *>(), NumConds),
+ ArrayRef(getTrailingObjects<Init *>() + NumConds, NumConds),
+ ValType);
}
CondOpInit *CondOpInit::get(ArrayRef<Init *> CondRange,
}
void DagInit::Profile(FoldingSetNodeID &ID) const {
- ProfileDagInit(ID, Val, ValName, makeArrayRef(getTrailingObjects<Init *>(), NumArgs), makeArrayRef(getTrailingObjects<StringInit *>(), NumArgNames));
+ ProfileDagInit(ID, Val, ValName,
+ ArrayRef(getTrailingObjects<Init *>(), NumArgs),
+ ArrayRef(getTrailingObjects<StringInit *>(), NumArgNames));
}
Record *DagInit::getOperatorAsDef(ArrayRef<SMLoc> Loc) const {
// 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;
}
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
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);
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<MemIntrinsicSDNode>(N);
SDValue UpdN = DAG.getMemIntrinsicNode(NewOpc, SDLoc(N), SDTys, Ops,
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)) {
{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<std::pair<unsigned, const char *>>
{MO_DLLIMPORTAUX, "aarch64-dllimportaux"},
{MO_PREL, "aarch64-prel"},
{MO_TAGGED, "aarch64-tagged"}};
- return makeArrayRef(TargetFlags);
+ return ArrayRef(TargetFlags);
}
ArrayRef<std::pair<MachineMemOperand::Flags, const char *>>
static const std::pair<MachineMemOperand::Flags, const char *> TargetFlags[] =
{{MOSuppressPair, "aarch64-suppress-pair"},
{MOStridedAccess, "aarch64-strided-access"}};
- return makeArrayRef(TargetFlags);
+ return ArrayRef(TargetFlags);
}
/// Constants defining how certain sequences should be outlined.
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;
}
Intrinsic::ID TrigIntrin = MI.getOpcode() == AMDGPU::G_FSIN ?
Intrinsic::amdgcn_sin : Intrinsic::amdgcn_cos;
- B.buildIntrinsic(TrigIntrin, makeArrayRef<Register>(DstReg), false)
- .addUse(TrigVal)
- .setMIFlags(Flags);
+ B.buildIntrinsic(TrigIntrin, ArrayRef<Register>(DstReg), false)
+ .addUse(TrigVal)
+ .setMIFlags(Flags);
MI.eraseFromParent();
return true;
}
.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;
};
const std::array<unsigned, 3> 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] = {
// rsrc, voffset, offset
const std::array<unsigned, 4> 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);
// rsrc, offset
const std::array<unsigned, 2> 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: {
};
const std::array<unsigned, 3> 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: {
};
const std::array<unsigned, 1> RegSrcOpIdx = { { 2 } };
- return addMappingFromTable<1>(MI, MRI, RegSrcOpIdx, makeArrayRef(Table));
+ return addMappingFromTable<1>(MI, MRI, RegSrcOpIdx, Table);
}
default:
return RegisterBankInfo::getInstrAlternativeMappings(MI);
AMDGPUAsmVariants::DPP, AMDGPUAsmVariants::VOP3_DPP
};
- return makeArrayRef(Variants);
+ return ArrayRef(Variants);
}
// What asm variants we should check
ArrayRef<unsigned> 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();
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));
if (Arg.isSet())
return ArgDescriptor::createArg(Arg, Mask);
- ArrayRef<MCPhysReg> ArgVGPRs
- = makeArrayRef(AMDGPU::VGPR_32RegClass.begin(), 32);
+ ArrayRef<MCPhysReg> ArgVGPRs = ArrayRef(AMDGPU::VGPR_32RegClass.begin(), 32);
unsigned RegIdx = CCInfo.getFirstUnallocated(ArgVGPRs);
if (RegIdx == ArgVGPRs.size()) {
// Spill to stack required.
static ArgDescriptor allocateSGPR32InputImpl(CCState &CCInfo,
const TargetRegisterClass *RC,
unsigned NumArgRegs) {
- ArrayRef<MCPhysReg> ArgSGPRs = makeArrayRef(RC->begin(), 32);
+ ArrayRef<MCPhysReg> ArgSGPRs = ArrayRef(RC->begin(), 32);
unsigned RegIdx = CCInfo.getFirstUnallocated(ArgSGPRs);
if (RegIdx == ArgSGPRs.size())
report_fatal_error("ran out of SGPRs for arguments");
Ops[1] = BufferStoreExt;
unsigned Opc = (VDataType == MVT::i8) ? AMDGPUISD::BUFFER_STORE_BYTE :
AMDGPUISD::BUFFER_STORE_SHORT;
- ArrayRef<SDValue> OpsRef = makeArrayRef(&Ops[0], 9);
+ ArrayRef<SDValue> OpsRef = ArrayRef(&Ops[0], 9);
return DAG.getMemIntrinsicNode(Opc, DL, M->getVTList(), OpsRef, VDataType,
M->getMemOperand());
}
{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
{ MO_ABS32_HI, "amdgpu-abs32-hi" },
};
- return makeArrayRef(TargetFlags);
+ return ArrayRef(TargetFlags);
}
ArrayRef<std::pair<MachineMemOperand::Flags, const char *>>
{MONoClobber, "amdgpu-noclobber"},
};
- return makeArrayRef(TargetFlags);
+ return ArrayRef(TargetFlags);
}
bool SIInstrInfo::isBasicBlockPrologue(const MachineInstr &MI) const {
auto I = SGPRSpillToVGPRLanes.find(FrameIndex);
return (I == SGPRSpillToVGPRLanes.end())
? ArrayRef<SIRegisterInfo::SpilledReg>()
- : makeArrayRef(I->second);
+ : ArrayRef(I->second);
}
ArrayRef<Register> getSGPRSpillVGPRs() const { return SpillVGPRs; }
auto I = PrologEpilogSGPRSpillToVGPRLanes.find(FrameIndex);
return (I == PrologEpilogSGPRSpillToVGPRLanes.end())
? ArrayRef<SIRegisterInfo::SpilledReg>()
- : makeArrayRef(I->second);
+ : ArrayRef(I->second);
}
void allocateWWMSpill(MachineFunction &MF, Register VGPR, uint64_t Size = 4,
const std::vector<int16_t> &Parts = RegSplitParts[EltDWORDs - 1];
const unsigned NumParts = RegDWORDs / EltDWORDs;
- return makeArrayRef(Parts.data(), NumParts);
+ return ArrayRef(Parts.data(), NumParts);
}
const TargetRegisterClass*
ArrayRef<MCPhysReg>
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<MCPhysReg>
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<MCPhysReg>
SIRegisterInfo::getAllSGPR32(const MachineFunction &MF) const {
- return makeArrayRef(AMDGPU::SGPR_32RegClass.begin(), ST.getMaxNumSGPRs(MF));
+ return ArrayRef(AMDGPU::SGPR_32RegClass.begin(), ST.getMaxNumSGPRs(MF));
}
#include "AMDKernelCodeTInfo.h"
#undef RECORD
};
- return makeArrayRef(Table);
+ return ArrayRef(Table);
}
static ArrayRef<StringRef> get_amd_kernel_code_t_FldAltNames() {
#include "AMDKernelCodeTInfo.h"
#undef RECORD
};
- return makeArrayRef(Table);
+ return ArrayRef(Table);
}
static StringMap<int> createIndexMap(const ArrayRef<StringRef> &names,
#include "AMDKernelCodeTInfo.h"
#undef RECORD
};
- return makeArrayRef(Table);
+ return ArrayRef(Table);
}
void llvm::printAmdKernelCodeField(const amd_kernel_code_t &C,
#include "AMDKernelCodeTInfo.h"
#undef RECORD
};
- return makeArrayRef(Table);
+ return ArrayRef(Table);
}
bool llvm::parseAmdKernelCodeField(StringRef ID,
static const std::pair<unsigned, const char *> TargetFlags[] = {
{MO_LO16, "arm-lo16"}, {MO_HI16, "arm-hi16"}};
- return makeArrayRef(TargetFlags);
+ return ArrayRef(TargetFlags);
}
ArrayRef<std::pair<unsigned, const char *>>
{MO_DLLIMPORT, "arm-dllimport"},
{MO_SECREL, "arm-secrel"},
{MO_NONLAZY, "arm-nonlazy"}};
- return makeArrayRef(TargetFlags);
+ return ArrayRef(TargetFlags);
}
std::optional<RegImmPair>
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,
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) {
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) {
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,
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,
SmallVector<SDValue, 64> 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)
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<SDValue, 8> Ops;
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<SDValue, 8> Ops;
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<MemIntrinsicSDNode>(VLD);
SDValue VLDDup = DAG.getMemIntrinsicNode(NewOpc, SDLoc(VLD), SDTys,
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;
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(
ArrayRef<MCPhysReg> RegList8;
ArrayRef<MCPhysReg> 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();
ArrayRef<MCPhysReg> RegList8;
ArrayRef<MCPhysReg> 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,
const unsigned XLenInBytes = 4;
const MVT XLenVT = MVT::i32;
- ArrayRef<MCPhysReg> ArgRegs = makeArrayRef(GPRArgRegs);
+ ArrayRef<MCPhysReg> ArgRegs = ArrayRef(GPRArgRegs);
unsigned Idx = CCInfo.getFirstUnallocated(ArgRegs);
const TargetRegisterClass *RC = &CSKY::GPRRegClass;
MachineFrameInfo &MFI = MF.getFrameInfo();
/// Get the MDString metadata for this block.
ArrayRef<const Metadata *> getMDStrings() const {
- return makeArrayRef(MDs).slice(NumModuleMDs, NumMDStrings);
+ return ArrayRef(MDs).slice(NumModuleMDs, NumMDStrings);
}
/// Get the non-MDString metadata for this block.
ArrayRef<const Metadata *> getNonMDStrings() const {
- return makeArrayRef(MDs).slice(NumModuleMDs).slice(NumMDStrings);
+ return ArrayRef(MDs).slice(NumModuleMDs).slice(NumMDStrings);
}
const TypeList &getTypes() const { return Types; }
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;
{MO_IEGOT, "hexagon-iegot"},
{MO_TPREL, "hexagon-tprel"}
};
- return makeArrayRef(Flags);
+ return ArrayRef(Flags);
}
ArrayRef<std::pair<unsigned, const char*>>
static const std::pair<unsigned, const char*> Flags[] = {
{HMOTF_ConstExtended, "hexagon-ext"}
};
- return makeArrayRef(Flags);
+ return ArrayRef(Flags);
}
Register HexagonInstrInfo::createVR(MachineFunction *MF, MVT VT) const {
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;
}
llvm::ArrayRef<MCPhysReg> Hexagon_MC::GetVectRegRev() {
- return makeArrayRef(VectRegRev);
+ return ArrayRef(VectRegRev);
}
namespace {
{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,
}
if (IsVarArg) {
- ArrayRef<MCPhysReg> ArgRegs = makeArrayRef(ArgGPRs);
+ ArrayRef<MCPhysReg> ArgRegs = ArrayRef(ArgGPRs);
unsigned Idx = CCInfo.getFirstUnallocated(ArgRegs);
const TargetRegisterClass *RC = &LoongArch::GPRRegClass;
MachineFrameInfo &MFI = MF.getFrameInfo();
{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);
}
{MO_GOTOFF, "m68k-gotoff"},
{MO_GOTPCREL, "m68k-gotpcrel"},
{MO_PLT, "m68k-plt"}};
- return makeArrayRef(TargetFlags);
+ return ArrayRef(TargetFlags);
}
namespace {
ArrayRef<MCPhysReg> 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<MCPhysReg> MipsABIInfo::GetVarArgRegs() const {
if (IsO32())
- return makeArrayRef(O32IntRegs);
+ return ArrayRef(O32IntRegs);
if (IsN32() || IsN64())
- return makeArrayRef(Mips64IntRegs);
+ return ArrayRef(Mips64IntRegs);
llvm_unreachable("Unhandled ABI");
}
{MO_CALL_LO16, "mips-call-lo16"},
{MO_JALR, "mips-jalr"}
};
- return makeArrayRef(Flags);
+ return ArrayRef(Flags);
}
std::optional<ParamLoadedValue>
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()));
}
}
Op0Op0->getOperand(2) };
return DAG.getNode(MipsISD::VEXTRACT_SEXT_ELT, SDLoc(Op0Op0),
Op0Op0->getVTList(),
- makeArrayRef(Ops, Op0Op0->getNumOperands()));
+ ArrayRef(Ops, Op0Op0->getNumOperands()));
}
}
}
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);
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);
} else {
for (unsigned i = 0; i < NumOperands; ++i) {
NewValue =
- Builder.CreateInsertValue(NewValue, NewOperands[i], makeArrayRef(i));
+ Builder.CreateInsertValue(NewValue, NewOperands[i], ArrayRef(i));
}
}
// GetElementPtrConstantExpr
return Builder.CreateGEP(cast<GEPOperator>(C)->getSourceElementType(),
NewOperands[0],
- makeArrayRef(&NewOperands[1], NumOperands - 1), "",
+ ArrayRef(&NewOperands[1], NumOperands - 1), "",
cast<GEPOperator>(C)->isInBounds());
case Instruction::Select:
// SelectConstantExpr
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);
}
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);
}
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<SDValue, 4> RetOps;
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);
{MO_TLSLD_LO, "ppc-tlsld-lo"},
{MO_TOC_LO, "ppc-toc-lo"},
{MO_TLS, "ppc-tls"}};
- return makeArrayRef(TargetFlags);
+ return ArrayRef(TargetFlags);
}
ArrayRef<std::pair<unsigned, const char *>>
{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.
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());
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(
MF.getInfo<RISCVMachineFunctionInfo>()->setIsVectorCall();
if (IsVarArg) {
- ArrayRef<MCPhysReg> ArgRegs = makeArrayRef(ArgGPRs);
+ ArrayRef<MCPhysReg> ArgRegs = ArrayRef(ArgGPRs);
unsigned Idx = CCInfo.getFirstUnallocated(ArgRegs);
const TargetRegisterClass *RC = &RISCV::GPRRegClass;
MachineFrameInfo &MFI = MF.getFrameInfo();
{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 {
}
// 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));
}
}
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;
{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 &
// node.
const Edge *edges_end() const { return (this + 1)->Edges; }
ArrayRef<Edge> edges() const {
- return makeArrayRef(edges_begin(), edges_end());
+ return ArrayRef(edges_begin(), edges_end());
}
};
ImmutableGraph &operator=(ImmutableGraph &&) = delete;
public:
- ArrayRef<Node> nodes() const { return makeArrayRef(Nodes.get(), NodesSize); }
+ ArrayRef<Node> nodes() const { return ArrayRef(Nodes.get(), NodesSize); }
const Node *nodes_begin() const { return nodes().begin(); }
const Node *nodes_end() const { return nodes().end(); }
- ArrayRef<Edge> edges() const { return makeArrayRef(Edges.get(), EdgesSize); }
+ ArrayRef<Edge> edges() const { return ArrayRef(Edges.get(), EdgesSize); }
const Edge *edges_begin() const { return edges().begin(); }
const Edge *edges_end() const { return edges().end(); }
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<MCPhysReg> 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,
// Use the VEX.L bit to select the 128 or 256-bit table.
ArrayRef<X86EvexToVexCompressTableEntry> 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())
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.
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
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];
const int Mask[] = {1, -1, 3, -1, 5, -1, 7, -1,
9, -1, 11, -1, 13, -1, 15, -1};
// <a|b|c|d> => <b|undef|d|undef>
- SDValue Odd0 = DAG.getVectorShuffle(VT, dl, A, A,
- makeArrayRef(&Mask[0], NumElts));
+ SDValue Odd0 =
+ DAG.getVectorShuffle(VT, dl, A, A, ArrayRef(&Mask[0], NumElts));
// <e|f|g|h> => <f|undef|h|undef>
- 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.
// 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;
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
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.
}
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.
}
auto V1 = II.getArgOperand(0);
- return Builder.CreateShuffleVector(V1, makeArrayRef(Indexes, Size));
+ return Builder.CreateShuffleVector(V1, ArrayRef(Indexes, Size));
}
std::optional<Instruction *>
ArrayRef<X86InstrFMA3Group> 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
llvm::lookupFoldTable(unsigned RegOp, unsigned OpNum) {
ArrayRef<X86MemoryFoldTableEntry> 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;
{MO_TLVP_PIC_BASE, "x86-tlvp-pic-base"},
{MO_SECREL, "x86-secrel"},
{MO_COFFSTUB, "x86-coffstub"}};
- return makeArrayRef(TargetFlags);
+ return ArrayRef(TargetFlags);
}
namespace {
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.
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;
// dst = src1[0,1],src2[0,1]
static constexpr int IntMask1[] = {0, 1, 4, 5};
- ArrayRef<int> Mask = makeArrayRef(IntMask1, 4);
+ ArrayRef<int> 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);
}
for (unsigned i = 0; i < Factor; i++)
Indices.push_back(Mask[i]);
- ArrayRef<ShuffleVectorInst *> Shuffles = makeArrayRef(SVI);
+ ArrayRef<ShuffleVectorInst *> Shuffles = ArrayRef(SVI);
// Create an interleaved access group.
IRBuilder<> Builder(SI);
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(
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,
}
ArrayRef<MDNode *> types() const {
- return makeArrayRef(getTrailingObjects<MDNode *>(), NTypes);
+ return ArrayRef(getTrailingObjects<MDNode *>(), NTypes);
}
};
CallInst *CI;
ArrayRef<GlobalTypeMember *> targets() const {
- return makeArrayRef(getTrailingObjects<GlobalTypeMember *>(), NTargets);
+ return ArrayRef(getTrailingObjects<GlobalTypeMember *>(), NTargets);
}
unsigned UniqueId;
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;
}
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
// 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);
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,
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),
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);
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);
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;
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
// with
// %E extractvalue { i32 } { i32 42 }, 0
return ExtractValueInst::Create(IV->getInsertedValueOperand(),
- makeArrayRef(exti, exte));
+ ArrayRef(exti, exte));
}
if (Instruction *R = foldExtractOfOverflowIntrinsic(EV))
return AttributeList::get(Ctx, CallSiteAttrs.getFnAttrs(),
CallSiteAttrs.getRetAttrs(),
- llvm::makeArrayRef(ArgumentAttributes));
+ llvm::ArrayRef(ArgumentAttributes));
}
class DataFlowSanitizer {
(int)AtomicOrderingCABI::seq_cst;
return ConstantDataVector::get(IRB.getContext(),
- makeArrayRef(OrderingTable, NumOrderings));
+ ArrayRef(OrderingTable, NumOrderings));
}
void DFSanVisitor::visitLibAtomicLoad(CallBase &CB) {
(int)AtomicOrderingCABI::seq_cst;
return ConstantDataVector::get(IRB.getContext(),
- makeArrayRef(OrderingTable, NumOrderings));
+ ArrayRef(OrderingTable, NumOrderings));
}
void DFSanVisitor::visitLibAtomicStore(CallBase &CB) {
#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();
#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)
#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(
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);
(int)AtomicOrderingCABI::seq_cst;
return ConstantDataVector::get(IRB.getContext(),
- makeArrayRef(OrderingTable, NumOrderings));
+ ArrayRef(OrderingTable, NumOrderings));
}
AtomicOrdering addAcquireOrdering(AtomicOrdering a) {
(int)AtomicOrderingCABI::seq_cst;
return ConstantDataVector::get(IRB.getContext(),
- makeArrayRef(OrderingTable, NumOrderings));
+ ArrayRef(OrderingTable, NumOrderings));
}
// ------------------- Visitors.
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));
}
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);
// 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);
});
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!");
if (auto Simplified = checkExprResults(E, I, V))
return Simplified;
} else if (auto *GEPI = dyn_cast<GetElementPtrInst>(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) {
// 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.
// 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<BasicBlock *const>(
- makeArrayRef(ClonedPH), ClonedLoopBlocks, ClonedExitsInLoops))
+ ArrayRef(ClonedPH), ClonedLoopBlocks, ClonedExitsInLoops))
if (Loop *OuterL = ExitLoopMap.lookup(BB))
OuterL->addBasicBlockToLoop(BB, LI);
// some *other* successor with a single data structure. We use this to
// significantly reduce cloning.
SmallDenseMap<BasicBlock *, BasicBlock *, 16> DominatingSucc;
- for (auto *SuccBB : llvm::concat<BasicBlock *const>(
- makeArrayRef(RetainedSuccBB), UnswitchedSuccBBs))
+ for (auto *SuccBB : llvm::concat<BasicBlock *const>(ArrayRef(RetainedSuccBB),
+ UnswitchedSuccBBs))
if (SuccBB->getUniquePredecessor() ||
llvm::all_of(predecessors(SuccBB), [&](BasicBlock *PredBB) {
return PredBB == ParentBB || DT.dominates(SuccBB, PredBB);
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);
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");
}
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);
AppendingInits.resize(PrefixSize);
mapAppendingVariable(*E.Data.AppendingGV.GV,
E.Data.AppendingGV.InitPrefix,
- E.AppendingGVIsOldCtorDtor, makeArrayRef(NewInits));
+ E.AppendingGVIsOldCtorDtor, ArrayRef(NewInits));
break;
}
case WorklistEntry::MapAliasOrIFunc: {
auto *It = ResOrder.begin();
for (unsigned K = 0; K < VF; K += Sz) {
OrdersType CurrentOrder(TE.ReorderIndices);
- SmallVector<int> SubMask(makeArrayRef(ReusedMask).slice(K, Sz));
+ SmallVector<int> SubMask{ArrayRef(ReusedMask).slice(K, Sz)};
if (SubMask.front() == UndefMaskElem)
std::iota(SubMask.begin(), SubMask.end(), 0);
reorderOrder(CurrentOrder, SubMask);
// 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();
if (E->State != TreeEntry::NeedToGather &&
E->getOpcode() == Instruction::Store) {
ArrayRef<int> Mask =
- makeArrayRef(reinterpret_cast<const int *>(E->ReorderIndices.begin()),
- E->ReorderIndices.size());
+ ArrayRef(reinterpret_cast<const int *>(E->ReorderIndices.begin()),
+ E->ReorderIndices.size());
ShuffleBuilder.add(V, Mask);
} else {
ShuffleBuilder.addOrdered(V, E->ReorderIndices);
unsigned StartIdx = 0;
for (unsigned Size = MaxVF; Size >= MinVF; Size /= 2) {
for (unsigned Cnt = StartIdx, E = Operands.size(); Cnt + Size <= E;) {
- ArrayRef<Value *> Slice = makeArrayRef(Operands).slice(Cnt, Size);
+ ArrayRef<Value *> Slice = ArrayRef(Operands).slice(Cnt, Size);
if (!VectorizedStores.count(Slice.front()) &&
!VectorizedStores.count(Slice.back()) &&
vectorizeStoreChain(Slice, R, Cnt, MinVF)) {
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);
}
// 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) &&
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;
}
}
static bool runLipo(StringRef SDKPath, SmallVectorImpl<StringRef> &Args) {
- auto Path = sys::findProgramByName("lipo", makeArrayRef(SDKPath));
+ auto Path = sys::findProgramByName("lipo", ArrayRef(SDKPath));
if (!Path)
Path = sys::findProgramByName("lipo");
DsymutilOptTable T;
unsigned MAI;
unsigned MAC;
- ArrayRef<const char *> ArgsArr = makeArrayRef(argv + 1, argc - 1);
+ ArrayRef<const char *> ArgsArr = ArrayRef(argv + 1, argc - 1);
opt::InputArgList Args = T.ParseArgs(ArgsArr, MAI, MAC);
void *P = (void *)(intptr_t)getOutputFileName;
SmallVector<const char *, 0> 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.
};
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);
CvtResOptTable T;
unsigned MAI, MAC;
- ArrayRef<const char *> ArgsArr = makeArrayRef(Argv + 1, Argc - 1);
+ ArrayRef<const char *> ArgsArr = ArrayRef(Argv + 1, Argc - 1);
opt::InputArgList InputArgs = T.ParseArgs(ArgsArr, MAI, MAC);
if (InputArgs.hasArg(OPT_HELP)) {
// Complete object locators in the MS-ABI start with '??_R4'
else if (SymName.startswith("??_R4")) {
CompleteObjectLocator COL;
- COL.Data = makeArrayRef(
- reinterpret_cast<const little32_t *>(SymContents.data()), 3);
+ COL.Data =
+ ArrayRef(reinterpret_cast<const little32_t *>(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;
// Class hierarchy descriptors in the MS-ABI start with '??_R3'
else if (SymName.startswith("??_R3")) {
ClassHierarchyDescriptor CHD;
- CHD.Data = makeArrayRef(
- reinterpret_cast<const little32_t *>(SymContents.data()), 3);
+ CHD.Data =
+ ArrayRef(reinterpret_cast<const little32_t *>(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;
// 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<const little32_t *>(SymContents.data()) + 1, 5);
StringRef *I = std::begin(BCD.Symbols), *E = std::end(BCD.Symbols);
collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I, E);
DwarfutilOptTable T;
unsigned MAI;
unsigned MAC;
- ArrayRef<const char *> ArgsArr = makeArrayRef(Argv + 1, Argc - 1);
+ ArrayRef<const char *> ArgsArr = ArrayRef(Argv + 1, Argc - 1);
opt::InputArgList Args = T.ParseArgs(ArgsArr, MAI, MAC);
if (Args.hasArg(OPT_help) || Args.size() == 0) {
ExecutionMode::ALWAYS_PARALLEL_MISSING_USE_OR_DEF,
ExecutionMode::PARALLEL_VIA_EXPLICIT_REGS,
};
- return makeArrayRef(kAllExecutionModeBits);
+ return ArrayRef(kAllExecutionModeBits);
}
SmallVector<ExecutionMode, 4> getExecutionModeBits(ExecutionMode Execution) {
ArrayRef<unsigned> 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 {
llvm::InitializeAllTargetMCs();
llvm::InitializeAllAsmParsers();
- Config C = parseLipoOptions(makeArrayRef(argv + 1, argc - 1));
+ Config C = parseLipoOptions(ArrayRef(argv + 1, argc - 1));
LLVMContext LLVMCtx;
SmallVector<OwningBinary<Binary>, 1> InputBinaries =
readInputBinaries(LLVMCtx, C.InputFiles);
MLOptTable T;
unsigned MissingArgIndex, MissingArgCount;
- ArrayRef<const char *> ArgsArr = makeArrayRef(Argv + 1, Argc - 1);
+ ArrayRef<const char *> ArgsArr = ArrayRef(Argv + 1, Argc - 1);
opt::InputArgList InputArgs =
T.ParseArgs(ArgsArr, MissingArgIndex, MissingArgCount);
CvtResOptTable T;
unsigned MAI, MAC;
- ArrayRef<const char *> ArgsArr = makeArrayRef(Argv + 1, Argc - 1);
+ ArrayRef<const char *> ArgsArr = ArrayRef(Argv + 1, Argc - 1);
opt::InputArgList InputArgs = T.ParseArgs(ArgsArr, MAI, MAC);
for (auto *Arg : InputArgs.filtered(OPT_INPUT)) {
};
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;
if (NameAndFlags.size() > 1) {
Expected<SectionFlag> ParsedFlagSet =
- parseSectionFlagSet(makeArrayRef(NameAndFlags).drop_front());
+ parseSectionFlagSet(ArrayRef(NameAndFlags).drop_front());
if (!ParsedFlagSet)
return ParsedFlagSet.takeError();
SR.NewFlags = *ParsedFlagSet;
const char *const *DashDash =
llvm::find_if(RawArgsArr, [](StringRef Str) { return Str == "--"; });
- ArrayRef<const char *> ArgsArr = makeArrayRef(RawArgsArr.begin(), DashDash);
+ ArrayRef<const char *> ArgsArr = ArrayRef(RawArgsArr.begin(), DashDash);
if (DashDash != RawArgsArr.end())
DashDash = std::next(DashDash);
function_ref<Error(Error)> ErrorCallback) {
const char *const *DashDash =
llvm::find_if(RawArgsArr, [](StringRef Str) { return Str == "--"; });
- ArrayRef<const char *> ArgsArr = makeArrayRef(RawArgsArr.begin(), DashDash);
+ ArrayRef<const char *> ArgsArr = ArrayRef(RawArgsArr.begin(), DashDash);
if (DashDash != RawArgsArr.end())
DashDash = std::next(DashDash);
: cl::TokenizeGNUCommandLine,
NewArgv);
- auto Args = makeArrayRef(NewArgv).drop_front();
+ auto Args = ArrayRef(NewArgv).drop_front();
Expected<DriverConfig> DriverConfig = getDriverConfig(Args);
if (!DriverConfig) {
};
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);
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");
<< " remaining in buffer";
return ;
}
- printUnwindCode(makeArrayRef(I, E));
+ printUnwindCode(ArrayRef(I, E));
I += UsedSlots;
}
}
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();
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;
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";
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)
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();
}
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());
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<const support::little32_t *>(Bytes.data()),
- Bytes.size() / 4))
- OS << format(" %08" PRIX32, D);
+ for (uint32_t D :
+ ArrayRef(reinterpret_cast<const support::little32_t *>(Bytes.data()),
+ Bytes.size() / 4))
+ OS << format(" %08" PRIX32, D);
} else {
for (unsigned char B : Bytes)
OS << format(" %02" PRIX8, B);
char **DashDash = std::find_if(Argv + 1, Argv + Argc,
[](StringRef Str) { return Str == "--"; });
- ArrayRef<const char *> ArgsArr = makeArrayRef(Argv + 1, DashDash);
+ ArrayRef<const char *> ArgsArr = ArrayRef(Argv + 1, DashDash);
ArrayRef<const char *> FileArgsArr;
if (DashDash != Argv + Argc)
- FileArgsArr = makeArrayRef(DashDash + 1, Argv + Argc);
+ FileArgsArr = ArrayRef(DashDash + 1, Argv + Argc);
RcOptions Opts = getOptions(Argv[0], ArgsArr, FileArgsArr);
{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,
{
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
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);
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);
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);
}
// but that might change in the future
uint16_t Characteristics = RawData[0];
W.printFlags("ExtendedCharacteristics", Characteristics,
- makeArrayRef(PEExtendedDLLCharacteristics));
+ ArrayRef(PEExtendedDLLCharacteristics));
}
W.printBinaryBlock("RawData", RawData);
}
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;
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.
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
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);
}
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");
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) {
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;
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) {
}
default:
W.printEnum("unsupported Image Machine", Obj->getMachine(),
- makeArrayRef(ImageFileMachineType));
+ ArrayRef(ImageFileMachineType));
break;
}
}
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))
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));
}
case DT_MIPS_XHASH:
return FormatHexValue(Value);
case DT_MIPS_FLAGS:
- return FormatFlags(Value, makeArrayRef(ElfDynamicDTMipsFlags));
+ return FormatFlags(Value, ArrayRef(ElfDynamicDTMipsFlags));
default:
break;
}
.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);
}
auto It = llvm::find_if(ElfObjectFileType, [&](const EnumEntry<unsigned> &E) {
return E.Value == Type;
});
- if (It != makeArrayRef(ElfObjectFileType).end())
+ if (It != ArrayRef(ElfObjectFileType).end())
return It;
return nullptr;
}
for (int i = 0; i < ELF::EI_NIDENT; i++)
OS << format(" %02x", static_cast<int>(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:";
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]));
}
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);
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())
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) {
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);
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"
support::endian::read32<ELFT::TargetEndianness>(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
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);
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);
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";
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;
}
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) {
[[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);
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);
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.
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);
}
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);
}
}
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());
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());
}
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<Elf_Word> ShndxTable(
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);
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);
}
template<class MachHeader>
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); }
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())
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<uint16_t>(MOSymbol.Flags & 0x7),
- makeArrayRef(MachOSymbolRefTypes));
+ ArrayRef(MachOSymbolRefTypes));
W.printFlags("Flags", static_cast<uint16_t>(MOSymbol.Flags & ~0x7),
- makeArrayRef(MachOSymbolFlags));
+ ArrayRef(MachOSymbolFlags));
W.printHex("Value", MOSymbol.Value);
}
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<uint64_t>(WasmSec.Content.size()));
W.printNumber("Offset", WasmSec.Offset);
switch (WasmSec.Type) {
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) {
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("-"));
return;
}
- printUnwindCode(UI, makeArrayRef(UCI, UCE));
+ printUnwindCode(UI, ArrayRef(UCI, UCE));
UCI = UCI + UsedSlots - 1;
}
}
W.printHex("SymbolType", LoadSecSymEntPtr->SymbolType);
W.printEnum("StorageClass",
static_cast<uint8_t>(LoadSecSymEntPtr->StorageClass),
- makeArrayRef(SymStorageClass));
+ ArrayRef(SymStorageClass));
W.printHex("ImportFileID", LoadSecSymEntPtr->ImportFileID);
W.printNumber("ParameterTypeCheck", LoadSecSymEntPtr->ParameterTypeCheck);
}
W.printNumber("FixupBitValue", IsFixupIndicated(Info) ? 1 : 0);
W.printNumber("Length", GetRelocatedLength(Info));
W.printEnum("Type", static_cast<uint8_t>(Type),
- makeArrayRef(RelocationTypeNameclass));
+ ArrayRef(RelocationTypeNameclass));
W.printNumber("SectionNumber", LoaderSecRelEntPtr->SectionNum);
} else {
W.startLine() << format_hex(LoaderSecRelEntPtr->VirtualAddr,
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
Obj.getSymbolIndex(reinterpret_cast<uintptr_t>(AuxEntPtr)));
W.printString("Name", FileName);
W.printEnum("Type", static_cast<uint8_t>(AuxEntPtr->Type),
- makeArrayRef(FileStringType));
+ ArrayRef(FileStringType));
if (Obj.is64Bit()) {
W.printEnum("Auxiliary Type", static_cast<uint8_t>(AuxEntPtr->AuxType),
- makeArrayRef(SymAuxType));
+ ArrayRef(SymAuxType));
}
}
// 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<uint8_t>(AuxEntRef.getStorageMappingClass()),
- makeArrayRef(CsectStorageMappingClass));
+ ArrayRef(CsectStorageMappingClass));
if (Obj.is64Bit()) {
W.printEnum("Auxiliary Type", static_cast<uint8_t>(XCOFF::AUX_CSECT),
- makeArrayRef(SymAuxType));
+ ArrayRef(SymAuxType));
} else {
W.printHex("StabInfoIndex", AuxEntRef.getStabInfoIndex32());
W.printHex("StabSectNum", AuxEntRef.getStabSectNum32());
W.printHex("SizeOfFunction", AuxEntPtr->SizeOfFunction);
W.printNumber("SymbolIndexOfNextBeyond", AuxEntPtr->SymIdxOfNextBeyond);
W.printEnum("Auxiliary Type", static_cast<uint8_t>(AuxEntPtr->AuxType),
- makeArrayRef(SymAuxType));
+ ArrayRef(SymAuxType));
}
void XCOFFDumper::printFunctionAuxEnt(const XCOFFFunctionAuxEnt32 *AuxEntPtr) {
W.printHex("PointerToLineNum", AuxEntPtr->PtrToLineNum);
W.printNumber("SymbolIndexOfNextBeyond", AuxEntPtr->SymIdxOfNextBeyond);
W.printEnum("Auxiliary Type", static_cast<uint8_t>(AuxEntPtr->AuxType),
- makeArrayRef(SymAuxType));
+ ArrayRef(SymAuxType));
}
void XCOFFDumper::printBlockAuxEnt(const XCOFFBlockAuxEnt32 *AuxEntPtr) {
Obj.getSymbolIndex(reinterpret_cast<uintptr_t>(AuxEntPtr)));
W.printHex("LineNumber", AuxEntPtr->LineNum);
W.printEnum("Auxiliary Type", static_cast<uint8_t>(AuxEntPtr->AuxType),
- makeArrayRef(SymAuxType));
+ ArrayRef(SymAuxType));
}
template <typename T>
W.printNumber("NumberOfRelocEntries", AuxEntPtr->NumberOfRelocEnt);
if (Obj.is64Bit())
W.printEnum("Auxiliary Type", static_cast<uint8_t>(XCOFF::AUX_SECT),
- makeArrayRef(SymAuxType));
+ ArrayRef(SymAuxType));
}
static StringRef GetSymbolValueName(XCOFF::StorageClass SC) {
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<uint8_t>(SymbolClass),
- makeArrayRef(SymStorageClass));
+ ArrayRef(SymStorageClass));
W.printNumber("NumberOfAuxEntries", NumberOfAuxEntries);
if (NumberOfAuxEntries == 0)
if (NumberOfAuxEntries > 1)
reportUniqueWarning("the " +
enumToString(static_cast<uint8_t>(SymbolClass),
- makeArrayRef(SymStorageClass)) +
+ ArrayRef(SymStorageClass)) +
" symbol at index " + Twine(SymbolIdx) +
" should not have more than 1 "
"auxiliary entry");
if (Sec.isReservedSectionType())
W.printHex("Flags", "Reserved", SectionType);
else
- W.printEnum("Type", SectionType, makeArrayRef(SectionTypeFlagsNames));
+ W.printEnum("Type", SectionType, ArrayRef(SectionTypeFlagsNames));
}
if (opts::SectionRelocations)
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)
SmallVector<StringRef, 4> 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; }
else
ExpectedOffset = sizeof(typename ELFT::Ehdr);
- for (const std::unique_ptr<ELFYAML::Chunk> &C :
- makeArrayRef(V).drop_front()) {
+ for (const std::unique_ptr<ELFYAML::Chunk> &C : ArrayRef(V).drop_front()) {
ELFYAML::Section &Sec = *cast<ELFYAML::Section>(C.get());
const typename ELFT::Shdr &SecHdr = S[Sec.OriginalSecNdx];
std::vector<ELFYAML::Section *> OriginalOrder;
if (!Chunks.empty())
for (const std::unique_ptr<ELFYAML::Chunk> &C :
- makeArrayRef(Chunks).drop_front())
+ ArrayRef(Chunks).drop_front())
OriginalOrder.push_back(cast<ELFYAML::Section>(C.get()));
// Sometimes the order of sections in the section header table does not match
TEST(ArrayRefTest, AllocatorCopy) {
BumpPtrAllocator Alloc;
static const uint16_t Words1[] = { 1, 4, 200, 37 };
- ArrayRef<uint16_t> Array1 = makeArrayRef(Words1, 4);
+ ArrayRef<uint16_t> Array1 = ArrayRef(Words1, 4);
static const uint16_t Words2[] = { 11, 4003, 67, 64000, 13 };
- ArrayRef<uint16_t> Array2 = makeArrayRef(Words2, 5);
+ ArrayRef<uint16_t> Array2 = ArrayRef(Words2, 5);
ArrayRef<uint16_t> Array1c = Array1.copy(Alloc);
ArrayRef<uint16_t> Array2c = Array2.copy(Alloc);
EXPECT_TRUE(Array1.equals(Array1c));
void operator=(const NonAssignable &RHS) { assert(RHS.Ptr != nullptr); }
bool operator==(const NonAssignable &RHS) const { return Ptr == RHS.Ptr; }
} Array3Src[] = {"hello", "world"};
- ArrayRef<NonAssignable> Array3Copy = makeArrayRef(Array3Src).copy(Alloc);
- EXPECT_EQ(makeArrayRef(Array3Src), Array3Copy);
- EXPECT_NE(makeArrayRef(Array3Src).data(), Array3Copy.data());
+ ArrayRef<NonAssignable> 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.
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<int> AR1(A1);
- ArrayRef<int> &AR1Ref = makeArrayRef(AR1);
- EXPECT_EQ(&AR1, &AR1Ref);
+ const ArrayRef<int> &AR1Ref = ArrayRef(AR1);
+ EXPECT_NE(&AR1, &AR1Ref);
+ EXPECT_TRUE(AR1.equals(AR1Ref));
// A copy is expected for non-const ArrayRef (thin copy)
const ArrayRef<int> AR2(A1);
- const ArrayRef<int> &AR2Ref = makeArrayRef(AR2);
+ const ArrayRef<int> &AR2Ref = ArrayRef(AR2);
EXPECT_NE(&AR2Ref, &AR2);
EXPECT_TRUE(AR2.equals(AR2Ref));
}
TEST(ArrayRefTest, OwningArrayRef) {
static const int A1[] = {0, 1};
- OwningArrayRef<int> A(makeArrayRef(A1));
+ OwningArrayRef<int> A{ArrayRef(A1)};
OwningArrayRef<int> B(std::move(A));
EXPECT_EQ(A.data(), nullptr);
}
-TEST(ArrayRefTest, makeArrayRefFromStdArray) {
+TEST(ArrayRefTest, ArrayRefFromStdArray) {
std::array<int, 5> A1{{42, -5, 0, 1000000, -1000000}};
- ArrayRef<int> A2 = makeArrayRef(A1);
+ ArrayRef<int> A2 = ArrayRef(A1);
EXPECT_EQ(A1.size(), A2.size());
for (std::size_t i = 0; i < A1.size(); ++i) {
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};
}
SmallVector<int, 2> 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<int, 2> 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) {
PtrT makePtr(ValueT *V) { return PtrT(V); }
- ArrayRef<PtrT> testArray(size_t N) {
- return makeArrayRef(&TestPtrs[0], N);
- }
+ ArrayRef<PtrT> testArray(size_t N) { return ArrayRef(&TestPtrs[0], N); }
void appendValues(VectorT &V, ArrayRef<PtrT> Values) {
for (size_t i = 0, e = Values.size(); i != e; ++i)
StackIds.push_back(*ContextIter);
if (First) {
std::vector<uint64_t> Expected = {2, 3, 4};
- EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected));
+ EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected));
} else {
std::vector<uint64_t> Expected = {2, 3, 5};
- EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected));
+ EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected));
}
First = false;
}
StackIds.push_back(Index->getStackIdAtIndex(StackIdIndex));
if (First) {
std::vector<uint64_t> Expected = {3, 4};
- EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected));
+ EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected));
} else {
std::vector<uint64_t> Expected = {3, 5};
- EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected));
+ EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected));
}
First = false;
}
StackIds.push_back(Index->getStackIdAtIndex(StackIdIndex));
if (First) {
std::vector<uint64_t> Expected = {1, 2, 3, 4};
- EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected));
+ EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected));
} else {
std::vector<uint64_t> Expected = {1, 2, 3, 5};
- EXPECT_EQ(makeArrayRef(StackIds), makeArrayRef(Expected));
+ EXPECT_EQ(ArrayRef(StackIds), ArrayRef(Expected));
}
First = false;
}
TEST_F(BasicTest, narrowShuffleMaskElts) {
SmallVector<int, 16> 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) {
// 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));
// 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));
// 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) {
// 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) {
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();
}
MATCHER_P3(BlockIsFilledWith, Layout, BlockIndex, Byte, "succeeded") {
uint64_t Offset = msf::blockToOffset(BlockIndex, Layout.SB->BlockSize);
- ArrayRef<uint8_t> BufferRef = makeArrayRef(arg);
+ ArrayRef<uint8_t> BufferRef = ArrayRef(arg);
BufferRef = BufferRef.slice(Offset, Layout.SB->BlockSize);
return llvm::all_of(BufferRef, [this](uint8_t B) { return B == Byte; });
}
// Choose an instruction and connect to later operations.
size_t IP = uniform<size_t>(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()));
}
{
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));
{ \
SmallVector<DINode::DIFlags, 8> 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);
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());
TEST(ELFTypesTest, NoteTest) {
static const uint8_t Random[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
- ArrayRef<uint8_t> RandomData = makeArrayRef(Random);
+ ArrayRef<uint8_t> RandomData = ArrayRef(Random);
NoteTestData<ELF64LE> TestData;
auto Note1 = TestData.getElfNote(StringRef("AMD"), ELF::NT_AMDGPU_METADATA,
EXPECT_EQ(OSPlatform::Linux, SysInfo.PlatformId);
EXPECT_EQ(
(ArrayRef<uint8_t>{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.
Filenames.resize(Files.size() + 1);
for (const auto &E : Files)
Filenames[E.getValue()] = E.getKey().str();
- ArrayRef<std::string> FilenameRefs = llvm::makeArrayRef(Filenames);
+ ArrayRef<std::string> FilenameRefs = llvm::ArrayRef(Filenames);
RawCoverageMappingReader Reader(Coverage, FilenameRefs, Data.Filenames,
Data.Expressions, Data.Regions);
EXPECT_THAT_ERROR(Reader.read(), Succeeded());
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);
// 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);
StringRef ExpectedR, StringRef ExpectedMeta,
std::optional<remarks::StringTable> StrTab = std::nullopt) {
return check(SerializerFormat, remarks::SerializerMode::Separate,
- makeArrayRef(&R, &R + 1), ExpectedR, ExpectedMeta,
+ ArrayRef(&R, &R + 1), ExpectedR, ExpectedMeta,
std::move(StrTab));
}
StringRef ExpectedR,
std::optional<remarks::StringTable> 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));
}
uint8_t *Ptr = Allocator.Allocate<uint8_t>(Size);
::memcpy(Ptr, Ref.data(), Ref.size());
::memcpy(Ptr + Ref.size(), Data.data(), BytesLeft);
- Buffer = makeArrayRef<uint8_t>(Ptr, Size);
+ Buffer = ArrayRef<uint8_t>(Ptr, Size);
return Error::success();
}
// 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());
// 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());
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());
// 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);
}
}
TEST_F(BinaryStreamTest, DropOperations) {
std::vector<uint8_t> InputData = {1, 2, 3, 4, 5, 4, 3, 2, 1};
- auto RefData = makeArrayRef(InputData);
+ auto RefData = ArrayRef(InputData);
initializeInput(InputData, 1);
ArrayRef<uint8_t> Result;
ArrayRef<uint8_t> 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<uint8_t> BigData = {0, 1, 2, 3, 4};
EXPECT_EQ(0U, Stream.getLength());
std::vector<uint8_t> 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());
ArrayRef<int> 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<int> FixedIntsRef;
const uint8_t *Bytes = reinterpret_cast<const uint8_t *>(&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.
ASSERT_THAT_ERROR(ReaderBacker.readArray(Ints2, SourceInts.size()),
Succeeded());
- EXPECT_EQ(makeArrayRef(SourceInts), Ints2);
+ EXPECT_EQ(ArrayRef(SourceInts), Ints2);
}
}
ASSERT_THAT_ERROR(Reader.readCString(S), Succeeded());
InStrings.push_back(S);
}
- EXPECT_EQ(makeArrayRef(Strings), makeArrayRef(InStrings));
+ EXPECT_EQ(ArrayRef(Strings), ArrayRef(InStrings));
}
}
// 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);
}
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.";
TEST(ConvertUTFTest, OddLengthInput) {
std::string Result;
- bool Success = convertUTF16ToUTF8String(makeArrayRef("xxxxx", 5), Result);
+ bool Success = convertUTF16ToUTF8String(ArrayRef("xxxxx", 5), Result);
EXPECT_FALSE(Success);
}
}
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<UTF16> SrcRef = makeArrayRef((const UTF16 *)Src, 4);
+ ArrayRef<UTF16> SrcRef = ArrayRef((const UTF16 *)Src, 4);
std::string Result;
bool Success = convertUTF16ToUTF8String(SrcRef, Result);
EXPECT_TRUE(Success);
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<const uint8_t *>(&SwappedData), sizeof(Data)));
return Hasher.final();
};
friend void addHash(llvm::HashBuilderImpl<HasherT, Endianness> &HBuilder,
const StructWithFastHash &Value) {
if (Endianness == llvm::support::endian::system_endianness()) {
- HBuilder.update(llvm::makeArrayRef(
- reinterpret_cast<const uint8_t *>(&Value), sizeof(Value)));
+ HBuilder.update(llvm::ArrayRef(reinterpret_cast<const uint8_t *>(&Value),
+ sizeof(Value)));
} else {
// Rely on existing `add` methods to handle endianness.
HBuilder.add(Value.I);
friend void addHash(llvm::HashBuilderImpl<HasherT, Endianness> &HBuilder,
const CustomContainer &Value) {
if (Endianness == llvm::support::endian::system_endianness()) {
- HBuilder.update(llvm::makeArrayRef(
+ HBuilder.update(llvm::ArrayRef(
reinterpret_cast<const uint8_t *>(&Value.Size),
sizeof(Value.Size) + Value.Size * sizeof(Value.Elements[0])));
} else {
namespace {
TEST(AccessorRange, SliceTest) {
int rawData[] = {0, 1, 2, 3, 4};
- ArrayRef<int> data = llvm::makeArrayRef(rawData);
+ ArrayRef<int> data = llvm::ArrayRef(rawData);
ArrayIndexedAccessorRange<int> range(rawData, /*start=*/0, /*numElements=*/5);
compareData(range, data);
}
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");
}
{"Name3", "AltName3", 3},
{"Name4", "AltName4", 2}};
EnumEntry<int> 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)
{"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);
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);
};
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);
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"
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"
#include "AutomataAutomata.inc"
TEST(Automata, SimpleAutomatonAcceptsFromInitialState) {
- Automaton<SymKind> A(makeArrayRef(SimpleAutomatonTransitions));
+ Automaton<SymKind> A{ArrayRef(SimpleAutomatonTransitions)};
EXPECT_TRUE(A.add(SK_a));
A.reset();
EXPECT_TRUE(A.add(SK_b));
}
TEST(Automata, SimpleAutomatonAcceptsSequences) {
- Automaton<SymKind> A(makeArrayRef(SimpleAutomatonTransitions));
+ Automaton<SymKind> A{ArrayRef(SimpleAutomatonTransitions)};
// Test sequence <a b>
A.reset();
EXPECT_TRUE(A.add(SK_a));
}
TEST(Automata, TupleAutomatonAccepts) {
- Automaton<TupleAutomatonAction> A(makeArrayRef(TupleAutomatonTransitions));
+ Automaton<TupleAutomatonAction> A{ArrayRef(TupleAutomatonTransitions)};
A.reset();
EXPECT_TRUE(
A.add(TupleAutomatonAction{SK_a, SK_b, "yeet"}));
}
TEST(Automata, NfaAutomatonAccepts) {
- Automaton<SymKind> A(makeArrayRef(NfaAutomatonTransitions));
+ Automaton<SymKind> A{ArrayRef(NfaAutomatonTransitions)};
// Test sequences <a a>, <a b>, <b a>, <b b>. All should be accepted.
A.reset();
}
TEST(Automata, BinPackerAutomatonAccepts) {
- Automaton<BinPackerAutomatonAction> A(makeArrayRef(BinPackerAutomatonTransitions));
+ Automaton<BinPackerAutomatonAction> A{
+ ArrayRef(BinPackerAutomatonTransitions)};
// Expect that we can pack two double-bins in 0-4, then no more in 0-4.
A.reset();
((a << 5) | (b << 4) | (c << 3) | (d << 2) | (e << 1) | (f << 0))
TEST(Automata, BinPackerAutomatonExplains) {
- Automaton<BinPackerAutomatonAction> A(makeArrayRef(BinPackerAutomatonTransitions),
- makeArrayRef(BinPackerAutomatonTransitionInfo));
+ Automaton<BinPackerAutomatonAction> 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));
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;
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";
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";
const RegUnitList &getRegUnits() const { return RegUnits; }
ArrayRef<LaneBitmask> 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().
ArrayRef<const CodeGenRegister*> getRoots() const {
assert(!(Roots[1] && !Roots[0]) && "Invalid roots array");
- return makeArrayRef(Roots, !!Roots[0] + !!Roots[1]);
+ return ArrayRef(Roots, !!Roots[0] + !!Roots[1]);
}
};
std::vector<CodeGenSchedRW> &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);
bool isKeyEqual(Record *IC, ArrayRef<unsigned> W,
ArrayRef<unsigned> 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
// Treat G_BUILD_VECTOR as the canonical opcode, and G_BUILD_VECTOR_TRUNC
// as an alternative.
InsnOperand.getInsnMatcher().addPredicate<InstructionOpcodeMatcher>(
- 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
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";
}
void PseudoLoweringEmitter::run(raw_ostream &o) {
StringRef Classes[] = {"PseudoInstExpansion", "Instruction"};
- std::vector<Record *> Insts =
- Records.getAllDerivedDefinitions(makeArrayRef(Classes));
+ std::vector<Record *> Insts = Records.getAllDerivedDefinitions(Classes);
// Process the pseudo expansion definitions, validating them as we do so.
Records.startTimer("Process definitions");
OS << " const MCRegisterClass &MCR = " << Target.getName()
<< "MCRegisterClasses[" << RC.getQualifiedName() + "RegClassID];\n"
<< " const ArrayRef<MCPhysReg> 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<MCPhysReg>(";
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";
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";
}
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";
}
}
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)
}
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";
<< "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);