mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created.
llvm-svn: 216525
This commit is contained in:
parent
d133367f2d
commit
43cee2f5fc
@ -99,7 +99,7 @@ public:
|
||||
// implicit conversion operator to ArrayRef.
|
||||
operator ArrayRef<EltTy>() const {
|
||||
if (Val.isNull())
|
||||
return ArrayRef<EltTy>();
|
||||
return None;
|
||||
if (Val.template is<EltTy>())
|
||||
return *Val.getAddrOfPtr1();
|
||||
return *Val.template get<VecTy*>();
|
||||
|
@ -105,7 +105,7 @@ template <typename ResultT, typename ArgT,
|
||||
ResultT (*Func)(ArrayRef<const ArgT *>)>
|
||||
struct VariadicFunction {
|
||||
ResultT operator()() const {
|
||||
return Func(ArrayRef<const ArgT *>());
|
||||
return Func(None);
|
||||
}
|
||||
|
||||
#define LLVM_DEFINE_OVERLOAD(N) \
|
||||
@ -152,7 +152,7 @@ template <typename ResultT, typename Param0T, typename ArgT,
|
||||
ResultT (*Func)(Param0T, ArrayRef<const ArgT *>)>
|
||||
struct VariadicFunction1 {
|
||||
ResultT operator()(Param0T P0) const {
|
||||
return Func(P0, ArrayRef<const ArgT *>());
|
||||
return Func(P0, None);
|
||||
}
|
||||
|
||||
#define LLVM_DEFINE_OVERLOAD(N) \
|
||||
@ -199,7 +199,7 @@ template <typename ResultT, typename Param0T, typename Param1T, typename ArgT,
|
||||
ResultT (*Func)(Param0T, Param1T, ArrayRef<const ArgT *>)>
|
||||
struct VariadicFunction2 {
|
||||
ResultT operator()(Param0T P0, Param1T P1) const {
|
||||
return Func(P0, P1, ArrayRef<const ArgT *>());
|
||||
return Func(P0, P1, None);
|
||||
}
|
||||
|
||||
#define LLVM_DEFINE_OVERLOAD(N) \
|
||||
@ -248,7 +248,7 @@ template <typename ResultT, typename Param0T, typename Param1T,
|
||||
ResultT (*Func)(Param0T, Param1T, Param2T, ArrayRef<const ArgT *>)>
|
||||
struct VariadicFunction3 {
|
||||
ResultT operator()(Param0T P0, Param1T P1, Param2T P2) const {
|
||||
return Func(P0, P1, P2, ArrayRef<const ArgT *>());
|
||||
return Func(P0, P1, P2, None);
|
||||
}
|
||||
|
||||
#define LLVM_DEFINE_OVERLOAD(N) \
|
||||
|
@ -587,8 +587,7 @@ public:
|
||||
|
||||
InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,
|
||||
BasicBlock *UnwindDest, const Twine &Name = "") {
|
||||
return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest,
|
||||
ArrayRef<Value *>()),
|
||||
return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest, None),
|
||||
Name);
|
||||
}
|
||||
InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,
|
||||
|
@ -185,7 +185,7 @@ public:
|
||||
/// convenience method for passes to do so.
|
||||
void dropUnknownMetadata(ArrayRef<unsigned> KnownIDs);
|
||||
void dropUnknownMetadata() {
|
||||
return dropUnknownMetadata(ArrayRef<unsigned>());
|
||||
return dropUnknownMetadata(None);
|
||||
}
|
||||
void dropUnknownMetadata(unsigned ID1) {
|
||||
return dropUnknownMetadata(makeArrayRef(ID1));
|
||||
|
@ -540,7 +540,7 @@ ELFFile<ELFT>::getSectionContents(const Elf_Shdr *Sec) const {
|
||||
if (Sec->sh_offset + Sec->sh_size > Buf.size())
|
||||
return object_error::parse_failed;
|
||||
const uint8_t *Start = base() + Sec->sh_offset;
|
||||
return ArrayRef<uint8_t>(Start, Sec->sh_size);
|
||||
return makeArrayRef(Start, Sec->sh_size);
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
|
@ -350,7 +350,7 @@ struct ExceptionDataRecord {
|
||||
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 ArrayRef<support::ulittle32_t>(&Data[Offset], EpilogueCount());
|
||||
return makeArrayRef(&Data[Offset], EpilogueCount());
|
||||
}
|
||||
|
||||
ArrayRef<support::ulittle8_t> UnwindByteCode() const {
|
||||
@ -358,8 +358,7 @@ struct ExceptionDataRecord {
|
||||
+ (E() ? 0 : EpilogueCount());
|
||||
const support::ulittle8_t *ByteCode =
|
||||
reinterpret_cast<const support::ulittle8_t *>(&Data[Offset]);
|
||||
return ArrayRef<support::ulittle8_t>(ByteCode,
|
||||
CodeWords() * sizeof(uint32_t));
|
||||
return makeArrayRef(ByteCode, CodeWords() * sizeof(uint32_t));
|
||||
}
|
||||
|
||||
uint32_t ExceptionHandlerRVA() const {
|
||||
|
@ -135,8 +135,7 @@ MachineTraceMetrics::getProcResourceCycles(unsigned MBBNum) const {
|
||||
"getResources() must be called before getProcResourceCycles()");
|
||||
unsigned PRKinds = SchedModel.getNumProcResourceKinds();
|
||||
assert((MBBNum+1) * PRKinds <= ProcResourceCycles.size());
|
||||
return ArrayRef<unsigned>(ProcResourceCycles.data() + MBBNum * PRKinds,
|
||||
PRKinds);
|
||||
return makeArrayRef(ProcResourceCycles.data() + MBBNum * PRKinds, PRKinds);
|
||||
}
|
||||
|
||||
|
||||
@ -256,8 +255,7 @@ MachineTraceMetrics::Ensemble::
|
||||
getProcResourceDepths(unsigned MBBNum) const {
|
||||
unsigned PRKinds = MTM.SchedModel.getNumProcResourceKinds();
|
||||
assert((MBBNum+1) * PRKinds <= ProcResourceDepths.size());
|
||||
return ArrayRef<unsigned>(ProcResourceDepths.data() + MBBNum * PRKinds,
|
||||
PRKinds);
|
||||
return makeArrayRef(ProcResourceDepths.data() + MBBNum * PRKinds, PRKinds);
|
||||
}
|
||||
|
||||
/// Get an array of processor resource heights for MBB. Indexed by processor
|
||||
@ -270,8 +268,7 @@ MachineTraceMetrics::Ensemble::
|
||||
getProcResourceHeights(unsigned MBBNum) const {
|
||||
unsigned PRKinds = MTM.SchedModel.getNumProcResourceKinds();
|
||||
assert((MBBNum+1) * PRKinds <= ProcResourceHeights.size());
|
||||
return ArrayRef<unsigned>(ProcResourceHeights.data() + MBBNum * PRKinds,
|
||||
PRKinds);
|
||||
return makeArrayRef(ProcResourceHeights.data() + MBBNum * PRKinds, PRKinds);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -967,14 +967,12 @@ void RAGreedy::addThroughConstraints(InterferenceCache::Cursor Intf,
|
||||
BCS[B].Exit = SpillPlacement::PrefSpill;
|
||||
|
||||
if (++B == GroupSize) {
|
||||
ArrayRef<SpillPlacement::BlockConstraint> Array(BCS, B);
|
||||
SpillPlacer->addConstraints(Array);
|
||||
SpillPlacer->addConstraints(makeArrayRef(BCS, B));
|
||||
B = 0;
|
||||
}
|
||||
}
|
||||
|
||||
ArrayRef<SpillPlacement::BlockConstraint> Array(BCS, B);
|
||||
SpillPlacer->addConstraints(Array);
|
||||
SpillPlacer->addConstraints(makeArrayRef(BCS, B));
|
||||
SpillPlacer->addLinks(makeArrayRef(TBS, T));
|
||||
}
|
||||
|
||||
@ -1013,7 +1011,7 @@ void RAGreedy::growRegion(GlobalSplitCandidate &Cand) {
|
||||
|
||||
// Compute through constraints from the interference, or assume that all
|
||||
// through blocks prefer spilling when forming compact regions.
|
||||
ArrayRef<unsigned> NewBlocks = makeArrayRef(ActiveBlocks).slice(AddedTo);
|
||||
auto NewBlocks = makeArrayRef(ActiveBlocks).slice(AddedTo);
|
||||
if (Cand.PhysReg)
|
||||
addThroughConstraints(Cand.Intf, NewBlocks);
|
||||
else
|
||||
|
@ -2368,8 +2368,7 @@ SDValue DAGCombiner::SimplifyNodeWithTwoResults(SDNode *N, unsigned LoOp,
|
||||
if (!HiExists &&
|
||||
(!LegalOperations ||
|
||||
TLI.isOperationLegalOrCustom(LoOp, N->getValueType(0)))) {
|
||||
SDValue Res = DAG.getNode(LoOp, SDLoc(N), N->getValueType(0),
|
||||
ArrayRef<SDUse>(N->op_begin(), N->op_end()));
|
||||
SDValue Res = DAG.getNode(LoOp, SDLoc(N), N->getValueType(0), N->ops());
|
||||
return CombineTo(N, Res, Res);
|
||||
}
|
||||
|
||||
@ -2378,8 +2377,7 @@ SDValue DAGCombiner::SimplifyNodeWithTwoResults(SDNode *N, unsigned LoOp,
|
||||
if (!LoExists &&
|
||||
(!LegalOperations ||
|
||||
TLI.isOperationLegal(HiOp, N->getValueType(1)))) {
|
||||
SDValue Res = DAG.getNode(HiOp, SDLoc(N), N->getValueType(1),
|
||||
ArrayRef<SDUse>(N->op_begin(), N->op_end()));
|
||||
SDValue Res = DAG.getNode(HiOp, SDLoc(N), N->getValueType(1), N->ops());
|
||||
return CombineTo(N, Res, Res);
|
||||
}
|
||||
|
||||
@ -2389,8 +2387,7 @@ SDValue DAGCombiner::SimplifyNodeWithTwoResults(SDNode *N, unsigned LoOp,
|
||||
|
||||
// If the two computed results can be simplified separately, separate them.
|
||||
if (LoExists) {
|
||||
SDValue Lo = DAG.getNode(LoOp, SDLoc(N), N->getValueType(0),
|
||||
ArrayRef<SDUse>(N->op_begin(), N->op_end()));
|
||||
SDValue Lo = DAG.getNode(LoOp, SDLoc(N), N->getValueType(0), N->ops());
|
||||
AddToWorklist(Lo.getNode());
|
||||
SDValue LoOpt = combine(Lo.getNode());
|
||||
if (LoOpt.getNode() && LoOpt.getNode() != Lo.getNode() &&
|
||||
@ -2400,8 +2397,7 @@ SDValue DAGCombiner::SimplifyNodeWithTwoResults(SDNode *N, unsigned LoOp,
|
||||
}
|
||||
|
||||
if (HiExists) {
|
||||
SDValue Hi = DAG.getNode(HiOp, SDLoc(N), N->getValueType(1),
|
||||
ArrayRef<SDUse>(N->op_begin(), N->op_end()));
|
||||
SDValue Hi = DAG.getNode(HiOp, SDLoc(N), N->getValueType(1), N->ops());
|
||||
AddToWorklist(Hi.getNode());
|
||||
SDValue HiOpt = combine(Hi.getNode());
|
||||
if (HiOpt.getNode() && HiOpt != Hi &&
|
||||
|
@ -5102,7 +5102,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, SDVTList VTList,
|
||||
}
|
||||
|
||||
SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, SDVTList VTList) {
|
||||
return getNode(Opcode, DL, VTList, ArrayRef<SDValue>());
|
||||
return getNode(Opcode, DL, VTList, None);
|
||||
}
|
||||
|
||||
SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, SDVTList VTList,
|
||||
|
@ -2541,7 +2541,7 @@ Constant *ConstantDataArray::getString(LLVMContext &Context,
|
||||
StringRef Str, bool AddNull) {
|
||||
if (!AddNull) {
|
||||
const uint8_t *Data = reinterpret_cast<const uint8_t *>(Str.data());
|
||||
return get(Context, ArrayRef<uint8_t>(const_cast<uint8_t *>(Data),
|
||||
return get(Context, makeArrayRef(const_cast<uint8_t *>(Data),
|
||||
Str.size()));
|
||||
}
|
||||
|
||||
|
@ -692,7 +692,7 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
|
||||
assert(D.Struct_NumElements <= 5 && "Can't handle this yet");
|
||||
for (unsigned i = 0, e = D.Struct_NumElements; i != e; ++i)
|
||||
Elts[i] = DecodeFixedType(Infos, Tys, Context);
|
||||
return StructType::get(Context, ArrayRef<Type*>(Elts,D.Struct_NumElements));
|
||||
return StructType::get(Context, makeArrayRef(Elts,D.Struct_NumElements));
|
||||
}
|
||||
|
||||
case IITDescriptor::Argument:
|
||||
|
@ -150,7 +150,7 @@ struct FunctionTypeKeyInfo {
|
||||
ReturnType(R), Params(P), isVarArg(V) {}
|
||||
KeyTy(const FunctionType* FT) :
|
||||
ReturnType(FT->getReturnType()),
|
||||
Params(ArrayRef<Type*>(FT->param_begin(), FT->param_end())),
|
||||
Params(makeArrayRef(FT->param_begin(), FT->param_end())),
|
||||
isVarArg(FT->isVarArg()) {}
|
||||
bool operator==(const KeyTy& that) const {
|
||||
if (ReturnType != that.ReturnType)
|
||||
|
@ -62,7 +62,7 @@ MDNode *MDBuilder::createRange(const APInt &Lo, const APInt &Hi) {
|
||||
|
||||
MDNode *MDBuilder::createAnonymousAARoot(StringRef Name, MDNode *Extra) {
|
||||
// To ensure uniqueness the root node is self-referential.
|
||||
MDNode *Dummy = MDNode::getTemporary(Context, ArrayRef<Value*>());
|
||||
MDNode *Dummy = MDNode::getTemporary(Context, None);
|
||||
|
||||
SmallVector<Value *, 3> Args(1, Dummy);
|
||||
if (Extra)
|
||||
|
@ -52,11 +52,11 @@ uint64_t MCObjectDisassembler::getEntrypoint() {
|
||||
}
|
||||
|
||||
ArrayRef<uint64_t> MCObjectDisassembler::getStaticInitFunctions() {
|
||||
return ArrayRef<uint64_t>();
|
||||
return None;
|
||||
}
|
||||
|
||||
ArrayRef<uint64_t> MCObjectDisassembler::getStaticExitFunctions() {
|
||||
return ArrayRef<uint64_t>();
|
||||
return None;
|
||||
}
|
||||
|
||||
MemoryObject *MCObjectDisassembler::getRegionFor(uint64_t Addr) {
|
||||
@ -559,7 +559,7 @@ ArrayRef<uint64_t> MCMachOObjectDisassembler::getStaticInitFunctions() {
|
||||
|
||||
size_t EntrySize = 8;
|
||||
size_t EntryCount = ModInitContents.size() / EntrySize;
|
||||
return ArrayRef<uint64_t>(
|
||||
return makeArrayRef(
|
||||
reinterpret_cast<const uint64_t *>(ModInitContents.data()), EntryCount);
|
||||
}
|
||||
|
||||
@ -569,6 +569,6 @@ ArrayRef<uint64_t> MCMachOObjectDisassembler::getStaticExitFunctions() {
|
||||
|
||||
size_t EntrySize = 8;
|
||||
size_t EntryCount = ModExitContents.size() / EntrySize;
|
||||
return ArrayRef<uint64_t>(
|
||||
return makeArrayRef(
|
||||
reinterpret_cast<const uint64_t *>(ModExitContents.data()), EntryCount);
|
||||
}
|
||||
|
@ -783,8 +783,7 @@ ArrayRef<uint8_t> COFFObjectFile::getSymbolAuxData(
|
||||
== 0 && "Aux Symbol data did not point to the beginning of a symbol");
|
||||
# endif
|
||||
}
|
||||
return ArrayRef<uint8_t>(Aux,
|
||||
Symbol->NumberOfAuxSymbols * sizeof(coff_symbol));
|
||||
return makeArrayRef(Aux, Symbol->NumberOfAuxSymbols * sizeof(coff_symbol));
|
||||
}
|
||||
|
||||
std::error_code COFFObjectFile::getSectionName(const coff_section *Sec,
|
||||
@ -825,8 +824,8 @@ COFFObjectFile::getSectionContents(const coff_section *Sec,
|
||||
uintptr_t ConEnd = ConStart + Sec->SizeOfRawData;
|
||||
if (ConEnd > uintptr_t(Data.getBufferEnd()))
|
||||
return object_error::parse_failed;
|
||||
Res = ArrayRef<uint8_t>(reinterpret_cast<const unsigned char*>(ConStart),
|
||||
Sec->SizeOfRawData);
|
||||
Res = makeArrayRef(reinterpret_cast<const uint8_t*>(ConStart),
|
||||
Sec->SizeOfRawData);
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
|
@ -1515,14 +1515,14 @@ ArrayRef<char>
|
||||
MachOObjectFile::getSectionRawName(DataRefImpl Sec) const {
|
||||
const section_base *Base =
|
||||
reinterpret_cast<const section_base *>(Sections[Sec.d.a]);
|
||||
return ArrayRef<char>(Base->sectname);
|
||||
return makeArrayRef(Base->sectname);
|
||||
}
|
||||
|
||||
ArrayRef<char>
|
||||
MachOObjectFile::getSectionRawFinalSegmentName(DataRefImpl Sec) const {
|
||||
const section_base *Base =
|
||||
reinterpret_cast<const section_base *>(Sections[Sec.d.a]);
|
||||
return ArrayRef<char>(Base->segname);
|
||||
return makeArrayRef(Base->segname);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -208,11 +208,11 @@ void MD5::update(ArrayRef<uint8_t> Data) {
|
||||
memcpy(&buffer[used], Ptr, free);
|
||||
Ptr = Ptr + free;
|
||||
Size -= free;
|
||||
body(ArrayRef<uint8_t>(buffer, 64));
|
||||
body(makeArrayRef(buffer, 64));
|
||||
}
|
||||
|
||||
if (Size >= 64) {
|
||||
Ptr = body(ArrayRef<uint8_t>(Ptr, Size & ~(unsigned long) 0x3f));
|
||||
Ptr = body(makeArrayRef(Ptr, Size & ~(unsigned long) 0x3f));
|
||||
Size &= 0x3f;
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ void MD5::final(MD5Result &result) {
|
||||
|
||||
if (free < 8) {
|
||||
memset(&buffer[used], 0, free);
|
||||
body(ArrayRef<uint8_t>(buffer, 64));
|
||||
body(makeArrayRef(buffer, 64));
|
||||
used = 0;
|
||||
free = 64;
|
||||
}
|
||||
@ -257,7 +257,7 @@ void MD5::final(MD5Result &result) {
|
||||
buffer[62] = hi >> 16;
|
||||
buffer[63] = hi >> 24;
|
||||
|
||||
body(ArrayRef<uint8_t>(buffer, 64));
|
||||
body(makeArrayRef(buffer, 64));
|
||||
|
||||
result[0] = a;
|
||||
result[1] = a >> 8;
|
||||
|
@ -105,8 +105,8 @@ unsigned StringRef::edit_distance(llvm::StringRef Other,
|
||||
bool AllowReplacements,
|
||||
unsigned MaxEditDistance) const {
|
||||
return llvm::ComputeEditDistance(
|
||||
llvm::ArrayRef<char>(data(), size()),
|
||||
llvm::ArrayRef<char>(Other.data(), Other.size()),
|
||||
makeArrayRef(data(), size()),
|
||||
makeArrayRef(Other.data(), Other.size()),
|
||||
AllowReplacements, MaxEditDistance);
|
||||
}
|
||||
|
||||
|
@ -7626,7 +7626,7 @@ static SDValue performPostLD1Combine(SDNode *N,
|
||||
Ops.push_back(Inc);
|
||||
|
||||
EVT Tys[3] = { VT, MVT::i64, MVT::Other };
|
||||
SDVTList SDTys = DAG.getVTList(ArrayRef<EVT>(Tys, 3));
|
||||
SDVTList SDTys = DAG.getVTList(Tys);
|
||||
unsigned NewOp = IsLaneOp ? AArch64ISD::LD1LANEpost : AArch64ISD::LD1DUPpost;
|
||||
SDValue UpdN = DAG.getMemIntrinsicNode(NewOp, SDLoc(N), SDTys, Ops,
|
||||
MemVT,
|
||||
@ -7756,7 +7756,7 @@ static SDValue performNEONPostLDSTCombine(SDNode *N,
|
||||
Tys[n] = VecTy;
|
||||
Tys[n++] = MVT::i64; // Type of write back register
|
||||
Tys[n] = MVT::Other; // Type of the chain
|
||||
SDVTList SDTys = DAG.getVTList(ArrayRef<EVT>(Tys, NumResultVecs + 2));
|
||||
SDVTList SDTys = DAG.getVTList(makeArrayRef(Tys, NumResultVecs + 2));
|
||||
|
||||
MemIntrinsicSDNode *MemInt = cast<MemIntrinsicSDNode>(N);
|
||||
SDValue UpdN = DAG.getMemIntrinsicNode(NewOpc, SDLoc(N), SDTys, Ops,
|
||||
|
@ -85,8 +85,7 @@ bool AArch64StorePairSuppress::shouldAddSTPToBlock(const MachineBasicBlock *BB)
|
||||
|
||||
// If a subtarget does not define resources for STPQi, bail here.
|
||||
if (SCDesc->isValid() && !SCDesc->isVariant()) {
|
||||
unsigned ResLenWithSTP = BBTrace.getResourceLength(
|
||||
ArrayRef<const MachineBasicBlock *>(), SCDesc);
|
||||
unsigned ResLenWithSTP = BBTrace.getResourceLength(None, SCDesc);
|
||||
if (ResLenWithSTP > ResLength) {
|
||||
DEBUG(dbgs() << " Suppress STP in BB: " << BB->getNumber()
|
||||
<< " resources " << ResLength << " -> " << ResLenWithSTP
|
||||
|
@ -9100,7 +9100,7 @@ static SDValue CombineBaseUpdate(SDNode *N,
|
||||
Tys[n] = VecTy;
|
||||
Tys[n++] = MVT::i32;
|
||||
Tys[n] = MVT::Other;
|
||||
SDVTList SDTys = DAG.getVTList(ArrayRef<EVT>(Tys, NumResultVecs+2));
|
||||
SDVTList SDTys = DAG.getVTList(makeArrayRef(Tys, NumResultVecs+2));
|
||||
SmallVector<SDValue, 8> Ops;
|
||||
Ops.push_back(N->getOperand(0)); // incoming chain
|
||||
Ops.push_back(N->getOperand(AddrOpIdx));
|
||||
@ -9179,7 +9179,7 @@ static bool CombineVLDDUP(SDNode *N, TargetLowering::DAGCombinerInfo &DCI) {
|
||||
for (n = 0; n < NumVecs; ++n)
|
||||
Tys[n] = VT;
|
||||
Tys[n] = MVT::Other;
|
||||
SDVTList SDTys = DAG.getVTList(ArrayRef<EVT>(Tys, NumVecs+1));
|
||||
SDVTList SDTys = DAG.getVTList(makeArrayRef(Tys, NumVecs+1));
|
||||
SDValue Ops[] = { VLD->getOperand(0), VLD->getOperand(2) };
|
||||
MemIntrinsicSDNode *VLDMemInt = cast<MemIntrinsicSDNode>(VLD);
|
||||
SDValue VLDDup = DAG.getMemIntrinsicNode(NewOpc, SDLoc(VLD), SDTys,
|
||||
|
@ -1300,11 +1300,11 @@ static Value *createCast(IRBuilder<false> &Builder, Value *V, Type *DestTy) {
|
||||
Value *Result = UndefValue::get(DestTy);
|
||||
for (unsigned int I = 0, E = SrcTy->getStructNumElements(); I < E; ++I) {
|
||||
Value *Element = createCast(
|
||||
Builder, Builder.CreateExtractValue(V, ArrayRef<unsigned int>(I)),
|
||||
Builder, Builder.CreateExtractValue(V, makeArrayRef(I)),
|
||||
DestTy->getStructElementType(I));
|
||||
|
||||
Result =
|
||||
Builder.CreateInsertValue(Result, Element, ArrayRef<unsigned int>(I));
|
||||
Builder.CreateInsertValue(Result, Element, makeArrayRef(I));
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
@ -680,7 +680,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
||||
CI,
|
||||
Builder->CreateShuffleVector(
|
||||
Vec, Undef, ConstantDataVector::get(
|
||||
II->getContext(), ArrayRef<uint32_t>(Mask))));
|
||||
II->getContext(), makeArrayRef(Mask))));
|
||||
|
||||
} else if (auto Source =
|
||||
dyn_cast<IntrinsicInst>(II->getArgOperand(0))) {
|
||||
|
@ -435,7 +435,7 @@ bool DataFlowSanitizer::doInitialization(Module &M) {
|
||||
DFSanSetLabelFnTy = FunctionType::get(Type::getVoidTy(*Ctx),
|
||||
DFSanSetLabelArgs, /*isVarArg=*/false);
|
||||
DFSanNonzeroLabelFnTy = FunctionType::get(
|
||||
Type::getVoidTy(*Ctx), ArrayRef<Type *>(), /*isVarArg=*/false);
|
||||
Type::getVoidTy(*Ctx), None, /*isVarArg=*/false);
|
||||
|
||||
if (GetArgTLSPtr) {
|
||||
Type *ArgTLSTy = ArrayType::get(ShadowTy, 64);
|
||||
|
@ -737,11 +737,11 @@ GlobalVariable *GCOVProfiler::buildEdgeLookupTable(
|
||||
Edge += Successors;
|
||||
}
|
||||
|
||||
ArrayRef<Constant*> V(&EdgeTable[0], TableSize);
|
||||
GlobalVariable *EdgeTableGV =
|
||||
new GlobalVariable(
|
||||
*M, EdgeTableTy, true, GlobalValue::InternalLinkage,
|
||||
ConstantArray::get(EdgeTableTy, V),
|
||||
ConstantArray::get(EdgeTableTy,
|
||||
makeArrayRef(&EdgeTable[0],TableSize)),
|
||||
"__llvm_gcda_edge_table");
|
||||
EdgeTableGV->setUnnamedAddr(true);
|
||||
return EdgeTableGV;
|
||||
|
@ -1870,7 +1870,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
||||
Value *Op = I.getArgOperand(0);
|
||||
Type *OpType = Op->getType();
|
||||
Function *BswapFunc = Intrinsic::getDeclaration(
|
||||
F.getParent(), Intrinsic::bswap, ArrayRef<Type*>(&OpType, 1));
|
||||
F.getParent(), Intrinsic::bswap, makeArrayRef(&OpType, 1));
|
||||
setShadow(&I, IRB.CreateCall(BswapFunc, getShadow(Op)));
|
||||
setOrigin(&I, getOrigin(Op));
|
||||
}
|
||||
|
@ -481,8 +481,7 @@ bool ThreadSanitizer::instrumentAtomic(Instruction *I) {
|
||||
Type *PtrTy = Ty->getPointerTo();
|
||||
Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy),
|
||||
createOrdering(&IRB, LI->getOrdering())};
|
||||
CallInst *C = CallInst::Create(TsanAtomicLoad[Idx],
|
||||
ArrayRef<Value*>(Args));
|
||||
CallInst *C = CallInst::Create(TsanAtomicLoad[Idx], Args);
|
||||
ReplaceInstWithInst(I, C);
|
||||
|
||||
} else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
|
||||
@ -497,8 +496,7 @@ bool ThreadSanitizer::instrumentAtomic(Instruction *I) {
|
||||
Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy),
|
||||
IRB.CreateIntCast(SI->getValueOperand(), Ty, false),
|
||||
createOrdering(&IRB, SI->getOrdering())};
|
||||
CallInst *C = CallInst::Create(TsanAtomicStore[Idx],
|
||||
ArrayRef<Value*>(Args));
|
||||
CallInst *C = CallInst::Create(TsanAtomicStore[Idx], Args);
|
||||
ReplaceInstWithInst(I, C);
|
||||
} else if (AtomicRMWInst *RMWI = dyn_cast<AtomicRMWInst>(I)) {
|
||||
Value *Addr = RMWI->getPointerOperand();
|
||||
@ -515,7 +513,7 @@ bool ThreadSanitizer::instrumentAtomic(Instruction *I) {
|
||||
Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy),
|
||||
IRB.CreateIntCast(RMWI->getValOperand(), Ty, false),
|
||||
createOrdering(&IRB, RMWI->getOrdering())};
|
||||
CallInst *C = CallInst::Create(F, ArrayRef<Value*>(Args));
|
||||
CallInst *C = CallInst::Create(F, Args);
|
||||
ReplaceInstWithInst(I, C);
|
||||
} else if (AtomicCmpXchgInst *CASI = dyn_cast<AtomicCmpXchgInst>(I)) {
|
||||
Value *Addr = CASI->getPointerOperand();
|
||||
@ -543,7 +541,7 @@ bool ThreadSanitizer::instrumentAtomic(Instruction *I) {
|
||||
Value *Args[] = {createOrdering(&IRB, FI->getOrdering())};
|
||||
Function *F = FI->getSynchScope() == SingleThread ?
|
||||
TsanAtomicSignalFence : TsanAtomicThreadFence;
|
||||
CallInst *C = CallInst::Create(F, ArrayRef<Value*>(Args));
|
||||
CallInst *C = CallInst::Create(F, Args);
|
||||
ReplaceInstWithInst(I, C);
|
||||
}
|
||||
return true;
|
||||
|
@ -885,8 +885,7 @@ static void AppendMDNodeToInstForPtr(unsigned NodeId,
|
||||
OldSeq),
|
||||
SequenceToMDString(Inst->getContext(),
|
||||
NewSeq)};
|
||||
Node = MDNode::get(Inst->getContext(),
|
||||
ArrayRef<Value*>(tmp, 3));
|
||||
Node = MDNode::get(Inst->getContext(), tmp);
|
||||
|
||||
Inst->setMetadata(NodeId, Node);
|
||||
}
|
||||
@ -906,8 +905,7 @@ static void GenerateARCBBEntranceAnnotation(const char *Name, BasicBlock *BB,
|
||||
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
||||
Type *I8XX = PointerType::getUnqual(I8X);
|
||||
Type *Params[] = {I8XX, I8XX};
|
||||
FunctionType *FTy = FunctionType::get(Type::getVoidTy(C),
|
||||
ArrayRef<Type*>(Params, 2),
|
||||
FunctionType *FTy = FunctionType::get(Type::getVoidTy(C), Params,
|
||||
/*isVarArg=*/false);
|
||||
Constant *Callee = M->getOrInsertFunction(Name, FTy);
|
||||
|
||||
@ -949,8 +947,7 @@ static void GenerateARCBBTerminatorAnnotation(const char *Name, BasicBlock *BB,
|
||||
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
||||
Type *I8XX = PointerType::getUnqual(I8X);
|
||||
Type *Params[] = {I8XX, I8XX};
|
||||
FunctionType *FTy = FunctionType::get(Type::getVoidTy(C),
|
||||
ArrayRef<Type*>(Params, 2),
|
||||
FunctionType *FTy = FunctionType::get(Type::getVoidTy(C), Params,
|
||||
/*isVarArg=*/false);
|
||||
Constant *Callee = M->getOrInsertFunction(Name, FTy);
|
||||
|
||||
|
@ -1010,7 +1010,7 @@ void SCCPSolver::visitGetElementPtrInst(GetElementPtrInst &I) {
|
||||
}
|
||||
|
||||
Constant *Ptr = Operands[0];
|
||||
ArrayRef<Constant *> Indices(Operands.begin() + 1, Operands.end());
|
||||
auto Indices = makeArrayRef(Operands.begin() + 1, Operands.end());
|
||||
markConstant(&I, ConstantExpr::getGetElementPtr(Ptr, Indices));
|
||||
}
|
||||
|
||||
|
@ -42,8 +42,7 @@ Value *llvm::EmitStrLen(Value *Ptr, IRBuilder<> &B, const DataLayout *TD,
|
||||
AttributeSet AS[2];
|
||||
AS[0] = AttributeSet::get(M->getContext(), 1, Attribute::NoCapture);
|
||||
Attribute::AttrKind AVs[2] = { Attribute::ReadOnly, Attribute::NoUnwind };
|
||||
AS[1] = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex,
|
||||
ArrayRef<Attribute::AttrKind>(AVs, 2));
|
||||
AS[1] = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex, AVs);
|
||||
|
||||
LLVMContext &Context = B.GetInsertBlock()->getContext();
|
||||
Constant *StrLen = M->getOrInsertFunction("strlen",
|
||||
@ -71,8 +70,7 @@ Value *llvm::EmitStrNLen(Value *Ptr, Value *MaxLen, IRBuilder<> &B,
|
||||
AttributeSet AS[2];
|
||||
AS[0] = AttributeSet::get(M->getContext(), 1, Attribute::NoCapture);
|
||||
Attribute::AttrKind AVs[2] = { Attribute::ReadOnly, Attribute::NoUnwind };
|
||||
AS[1] = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex,
|
||||
ArrayRef<Attribute::AttrKind>(AVs, 2));
|
||||
AS[1] = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex, AVs);
|
||||
|
||||
LLVMContext &Context = B.GetInsertBlock()->getContext();
|
||||
Constant *StrNLen = M->getOrInsertFunction("strnlen",
|
||||
@ -100,8 +98,7 @@ Value *llvm::EmitStrChr(Value *Ptr, char C, IRBuilder<> &B,
|
||||
Module *M = B.GetInsertBlock()->getParent()->getParent();
|
||||
Attribute::AttrKind AVs[2] = { Attribute::ReadOnly, Attribute::NoUnwind };
|
||||
AttributeSet AS =
|
||||
AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex,
|
||||
ArrayRef<Attribute::AttrKind>(AVs, 2));
|
||||
AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex, AVs);
|
||||
|
||||
Type *I8Ptr = B.getInt8PtrTy();
|
||||
Type *I32Ty = B.getInt32Ty();
|
||||
@ -128,8 +125,7 @@ Value *llvm::EmitStrNCmp(Value *Ptr1, Value *Ptr2, Value *Len,
|
||||
AS[0] = AttributeSet::get(M->getContext(), 1, Attribute::NoCapture);
|
||||
AS[1] = AttributeSet::get(M->getContext(), 2, Attribute::NoCapture);
|
||||
Attribute::AttrKind AVs[2] = { Attribute::ReadOnly, Attribute::NoUnwind };
|
||||
AS[2] = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex,
|
||||
ArrayRef<Attribute::AttrKind>(AVs, 2));
|
||||
AS[2] = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex, AVs);
|
||||
|
||||
LLVMContext &Context = B.GetInsertBlock()->getContext();
|
||||
Value *StrNCmp = M->getOrInsertFunction("strncmp",
|
||||
@ -238,8 +234,7 @@ Value *llvm::EmitMemChr(Value *Ptr, Value *Val,
|
||||
Module *M = B.GetInsertBlock()->getParent()->getParent();
|
||||
AttributeSet AS;
|
||||
Attribute::AttrKind AVs[2] = { Attribute::ReadOnly, Attribute::NoUnwind };
|
||||
AS = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex,
|
||||
ArrayRef<Attribute::AttrKind>(AVs, 2));
|
||||
AS = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex, AVs);
|
||||
LLVMContext &Context = B.GetInsertBlock()->getContext();
|
||||
Value *MemChr = M->getOrInsertFunction("memchr",
|
||||
AttributeSet::get(M->getContext(), AS),
|
||||
@ -268,8 +263,7 @@ Value *llvm::EmitMemCmp(Value *Ptr1, Value *Ptr2,
|
||||
AS[0] = AttributeSet::get(M->getContext(), 1, Attribute::NoCapture);
|
||||
AS[1] = AttributeSet::get(M->getContext(), 2, Attribute::NoCapture);
|
||||
Attribute::AttrKind AVs[2] = { Attribute::ReadOnly, Attribute::NoUnwind };
|
||||
AS[2] = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex,
|
||||
ArrayRef<Attribute::AttrKind>(AVs, 2));
|
||||
AS[2] = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex, AVs);
|
||||
|
||||
LLVMContext &Context = B.GetInsertBlock()->getContext();
|
||||
Value *MemCmp = M->getOrInsertFunction("memcmp",
|
||||
|
@ -317,8 +317,7 @@ static void CloneAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap) {
|
||||
DenseMap<const MDNode *, TrackingVH<MDNode> > MDMap;
|
||||
for (SetVector<const MDNode *>::iterator I = MD.begin(), IE = MD.end();
|
||||
I != IE; ++I) {
|
||||
MDNode *Dummy = MDNode::getTemporary(CalledFunc->getContext(),
|
||||
ArrayRef<Value*>());
|
||||
MDNode *Dummy = MDNode::getTemporary(CalledFunc->getContext(), None);
|
||||
DummyNodes.push_back(Dummy);
|
||||
MDMap[*I] = Dummy;
|
||||
}
|
||||
|
@ -173,8 +173,7 @@ static BasicBlock *rewriteLoopExitBlock(Loop *L, BasicBlock *Exit, Pass *PP) {
|
||||
|
||||
if (Exit->isLandingPad()) {
|
||||
SmallVector<BasicBlock*, 2> NewBBs;
|
||||
SplitLandingPadPredecessors(Exit, ArrayRef<BasicBlock*>(&LoopBlocks[0],
|
||||
LoopBlocks.size()),
|
||||
SplitLandingPadPredecessors(Exit, LoopBlocks,
|
||||
".loopexit", ".nonloopexit",
|
||||
PP, NewBBs);
|
||||
NewExitBB = NewBBs[0];
|
||||
|
@ -3225,8 +3225,7 @@ public:
|
||||
unsigned i = 0;
|
||||
|
||||
for (; i < NumReducedVals - ReduxWidth + 1; i += ReduxWidth) {
|
||||
ArrayRef<Value *> ValsToReduce(&ReducedVals[i], ReduxWidth);
|
||||
V.buildTree(ValsToReduce, ReductionOps);
|
||||
V.buildTree(makeArrayRef(&ReducedVals[i], ReduxWidth), ReductionOps);
|
||||
|
||||
// Estimate cost.
|
||||
int Cost = V.getTreeCost() + getReductionCost(TTI, ReducedVals[i]);
|
||||
@ -3418,8 +3417,7 @@ bool SLPVectorizer::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) {
|
||||
// Try to vectorize them.
|
||||
unsigned NumElts = (SameTypeIt - IncIt);
|
||||
DEBUG(errs() << "SLP: Trying to vectorize starting at PHIs (" << NumElts << ")\n");
|
||||
if (NumElts > 1 &&
|
||||
tryToVectorizeList(ArrayRef<Value *>(IncIt, NumElts), R)) {
|
||||
if (NumElts > 1 && tryToVectorizeList(makeArrayRef(IncIt, NumElts), R)) {
|
||||
// Success start over because instructions might have been changed.
|
||||
HaveVectorizedPhiNodes = true;
|
||||
Changed = true;
|
||||
@ -3561,8 +3559,8 @@ bool SLPVectorizer::vectorizeStoreChains(BoUpSLP &R) {
|
||||
// Process the stores in chunks of 16.
|
||||
for (unsigned CI = 0, CE = it->second.size(); CI < CE; CI+=16) {
|
||||
unsigned Len = std::min<unsigned>(CE - CI, 16);
|
||||
ArrayRef<StoreInst *> Chunk(&it->second[CI], Len);
|
||||
Changed |= vectorizeStores(Chunk, -SLPCostThreshold, R);
|
||||
Changed |= vectorizeStores(makeArrayRef(&it->second[CI], Len),
|
||||
-SLPCostThreshold, R);
|
||||
}
|
||||
}
|
||||
return Changed;
|
||||
|
@ -88,5 +88,5 @@ FileCoverageSummary CoverageSummary::getCombinedFileSummaries() {
|
||||
"TOTAL", RegionCoverageInfo(CoveredRegions, NumRegions),
|
||||
LineCoverageInfo(CoveredLines, NonCodeLines, NumLines),
|
||||
FunctionCoverageInfo(NumFunctionsCovered, NumFunctions),
|
||||
ArrayRef<FunctionCoverageSummary>());
|
||||
None);
|
||||
}
|
||||
|
@ -214,8 +214,8 @@ public:
|
||||
}
|
||||
|
||||
void printBinary(StringRef Label, StringRef Str, ArrayRef<char> Value) {
|
||||
ArrayRef<uint8_t> V(reinterpret_cast<const uint8_t*>(Value.data()),
|
||||
Value.size());
|
||||
auto V = makeArrayRef(reinterpret_cast<const uint8_t*>(Value.data()),
|
||||
Value.size());
|
||||
printBinaryImpl(Label, Str, V, false);
|
||||
}
|
||||
|
||||
@ -224,20 +224,20 @@ public:
|
||||
}
|
||||
|
||||
void printBinary(StringRef Label, ArrayRef<char> Value) {
|
||||
ArrayRef<uint8_t> V(reinterpret_cast<const uint8_t*>(Value.data()),
|
||||
Value.size());
|
||||
auto V = makeArrayRef(reinterpret_cast<const uint8_t*>(Value.data()),
|
||||
Value.size());
|
||||
printBinaryImpl(Label, StringRef(), V, false);
|
||||
}
|
||||
|
||||
void printBinary(StringRef Label, StringRef Value) {
|
||||
ArrayRef<uint8_t> V(reinterpret_cast<const uint8_t*>(Value.data()),
|
||||
Value.size());
|
||||
auto V = makeArrayRef(reinterpret_cast<const uint8_t*>(Value.data()),
|
||||
Value.size());
|
||||
printBinaryImpl(Label, StringRef(), V, false);
|
||||
}
|
||||
|
||||
void printBinaryBlock(StringRef Label, StringRef Value) {
|
||||
ArrayRef<uint8_t> V(reinterpret_cast<const uint8_t*>(Value.data()),
|
||||
Value.size());
|
||||
auto V = makeArrayRef(reinterpret_cast<const uint8_t*>(Value.data()),
|
||||
Value.size());
|
||||
printBinaryImpl(Label, StringRef(), V, true);
|
||||
}
|
||||
|
||||
|
@ -614,7 +614,7 @@ TEST(APIntTest, arrayAccess) {
|
||||
0x7E7FFA5EADD8846ULL,
|
||||
0x305F341CA00B613DULL
|
||||
};
|
||||
APInt A2(integerPartWidth*4, ArrayRef<integerPart>(E2, 4));
|
||||
APInt A2(integerPartWidth*4, E2);
|
||||
for (unsigned i = 0; i < 4; ++i) {
|
||||
for (unsigned j = 0; j < integerPartWidth; ++j) {
|
||||
EXPECT_EQ(bool(E2[i] & (1ULL << j)),
|
||||
@ -653,17 +653,17 @@ TEST(APIntTest, nearestLogBase2) {
|
||||
|
||||
// Test round up.
|
||||
integerPart I4[4] = {0x0, 0xF, 0x18, 0x0};
|
||||
APInt A4(integerPartWidth*4, ArrayRef<integerPart>(I4, 4));
|
||||
APInt A4(integerPartWidth*4, I4);
|
||||
EXPECT_EQ(A4.nearestLogBase2(), A4.ceilLogBase2());
|
||||
|
||||
// Test round down.
|
||||
integerPart I5[4] = {0x0, 0xF, 0x10, 0x0};
|
||||
APInt A5(integerPartWidth*4, ArrayRef<integerPart>(I5, 4));
|
||||
APInt A5(integerPartWidth*4, I5);
|
||||
EXPECT_EQ(A5.nearestLogBase2(), A5.logBase2());
|
||||
|
||||
// Test ties round up.
|
||||
uint64_t I6[4] = {0x0, 0x0, 0x0, 0x18};
|
||||
APInt A6(integerPartWidth*4, ArrayRef<integerPart>(I6, 4));
|
||||
APInt A6(integerPartWidth*4, I6);
|
||||
EXPECT_EQ(A6.nearestLogBase2(), A6.ceilLogBase2());
|
||||
|
||||
// Test BitWidth == 1 special cases.
|
||||
|
@ -39,30 +39,30 @@ TEST(ConvertUTFTest, ConvertUTF16BigEndianToUTF8String) {
|
||||
|
||||
TEST(ConvertUTFTest, OddLengthInput) {
|
||||
std::string Result;
|
||||
bool Success = convertUTF16ToUTF8String(ArrayRef<char>("xxxxx", 5), Result);
|
||||
bool Success = convertUTF16ToUTF8String(makeArrayRef("xxxxx", 5), Result);
|
||||
EXPECT_FALSE(Success);
|
||||
}
|
||||
|
||||
TEST(ConvertUTFTest, Empty) {
|
||||
std::string Result;
|
||||
bool Success = convertUTF16ToUTF8String(ArrayRef<char>(), Result);
|
||||
bool Success = convertUTF16ToUTF8String(None, Result);
|
||||
EXPECT_TRUE(Success);
|
||||
EXPECT_TRUE(Result.empty());
|
||||
}
|
||||
|
||||
TEST(ConvertUTFTest, HasUTF16BOM) {
|
||||
bool HasBOM = hasUTF16ByteOrderMark(ArrayRef<char>("\xff\xfe", 2));
|
||||
bool HasBOM = hasUTF16ByteOrderMark(makeArrayRef("\xff\xfe", 2));
|
||||
EXPECT_TRUE(HasBOM);
|
||||
HasBOM = hasUTF16ByteOrderMark(ArrayRef<char>("\xfe\xff", 2));
|
||||
HasBOM = hasUTF16ByteOrderMark(makeArrayRef("\xfe\xff", 2));
|
||||
EXPECT_TRUE(HasBOM);
|
||||
HasBOM = hasUTF16ByteOrderMark(ArrayRef<char>("\xfe\xff ", 3));
|
||||
HasBOM = hasUTF16ByteOrderMark(makeArrayRef("\xfe\xff ", 3));
|
||||
EXPECT_TRUE(HasBOM); // Don't care about odd lengths.
|
||||
HasBOM = hasUTF16ByteOrderMark(ArrayRef<char>("\xfe\xff\x00asdf", 6));
|
||||
HasBOM = hasUTF16ByteOrderMark(makeArrayRef("\xfe\xff\x00asdf", 6));
|
||||
EXPECT_TRUE(HasBOM);
|
||||
|
||||
HasBOM = hasUTF16ByteOrderMark(ArrayRef<char>());
|
||||
HasBOM = hasUTF16ByteOrderMark(None);
|
||||
EXPECT_FALSE(HasBOM);
|
||||
HasBOM = hasUTF16ByteOrderMark(ArrayRef<char>("\xfe", 1));
|
||||
HasBOM = hasUTF16ByteOrderMark(makeArrayRef("\xfe", 1));
|
||||
EXPECT_FALSE(HasBOM);
|
||||
}
|
||||
|
||||
|
@ -41,19 +41,19 @@ void TestMD5Sum(StringRef Input, StringRef Final) {
|
||||
}
|
||||
|
||||
TEST(MD5Test, MD5) {
|
||||
TestMD5Sum(ArrayRef<uint8_t>((const uint8_t *)"", (size_t) 0),
|
||||
TestMD5Sum(makeArrayRef((const uint8_t *)"", (size_t) 0),
|
||||
"d41d8cd98f00b204e9800998ecf8427e");
|
||||
TestMD5Sum(ArrayRef<uint8_t>((const uint8_t *)"a", (size_t) 1),
|
||||
TestMD5Sum(makeArrayRef((const uint8_t *)"a", (size_t) 1),
|
||||
"0cc175b9c0f1b6a831c399e269772661");
|
||||
TestMD5Sum(ArrayRef<uint8_t>((const uint8_t *)"abcdefghijklmnopqrstuvwxyz",
|
||||
(size_t) 26),
|
||||
TestMD5Sum(makeArrayRef((const uint8_t *)"abcdefghijklmnopqrstuvwxyz",
|
||||
(size_t) 26),
|
||||
"c3fcd3d76192e4007dfb496cca67e13b");
|
||||
TestMD5Sum(ArrayRef<uint8_t>((const uint8_t *)"\0", (size_t) 1),
|
||||
TestMD5Sum(makeArrayRef((const uint8_t *)"\0", (size_t) 1),
|
||||
"93b885adfe0da089cdf634904fd59f71");
|
||||
TestMD5Sum(ArrayRef<uint8_t>((const uint8_t *)"a\0", (size_t) 2),
|
||||
TestMD5Sum(makeArrayRef((const uint8_t *)"a\0", (size_t) 2),
|
||||
"4144e195f46de78a3623da7364d04f11");
|
||||
TestMD5Sum(ArrayRef<uint8_t>((const uint8_t *)"abcdefghijklmnopqrstuvwxyz\0",
|
||||
(size_t) 27),
|
||||
TestMD5Sum(makeArrayRef((const uint8_t *)"abcdefghijklmnopqrstuvwxyz\0",
|
||||
(size_t) 27),
|
||||
"81948d1f1554f58cd1a56ebb01f808cb");
|
||||
TestMD5Sum("abcdefghijklmnopqrstuvwxyz", "c3fcd3d76192e4007dfb496cca67e13b");
|
||||
}
|
||||
|
@ -680,8 +680,7 @@ EmitAttributes(const std::vector<CodeGenIntrinsic> &Ints, raw_ostream &OS) {
|
||||
|
||||
OS << " }\n";
|
||||
OS << " }\n";
|
||||
OS << " return AttributeSet::get(C, ArrayRef<AttributeSet>(AS, "
|
||||
"NumAttrs));\n";
|
||||
OS << " return AttributeSet::get(C, makeArrayRef(AS, NumAttrs));\n";
|
||||
OS << "}\n";
|
||||
OS << "#endif // GET_INTRINSIC_ATTRIBUTES\n\n";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user