Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/include/llvm/Object/ELF.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ Expected<typename ELFT::ShdrRange> ELFFile<ELFT>::sections() const {
const uintX_t SectionTableOffset = getHeader().e_shoff;
if (SectionTableOffset == 0) {
if (!FakeSections.empty())
return ArrayRef(FakeSections.data(), FakeSections.size());
return ArrayRef(FakeSections);
return ArrayRef<Elf_Shdr>();
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/ExecutionEngine/JITLink/XCOFFLinkGraphBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ Error XCOFFLinkGraphBuilder::processCsectsAndSymbols() {
if (!CsectSymbolAddr)
return CsectSymbolAddr.takeError();

ArrayRef<char> SectionBuffer{Data->data(), Data->size()};
ArrayRef<char> SectionBuffer{*Data};
auto Offset = *CsectSymbolAddr - SectionRef.getAddress();

LLVM_DEBUG(dbgs() << " symbol entry: offset = " << Offset
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/ExecutionEngine/Orc/SectCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ void SectCreateMaterializationUnit::materialize(
SubtargetFeatures(), getGenericEdgeKindName);

auto &Sect = G->createSection(SectName, MP);
auto Content = G->allocateContent(
ArrayRef<char>(Data->getBuffer().data(), Data->getBuffer().size()));
auto Content = G->allocateContent(ArrayRef<char>(Data->getBuffer()));
auto &B = G->createContentBlock(Sect, Content, ExecutorAddr(), Alignment, 0);

for (auto &[Name, Info] : ExtraSymbols) {
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Object/OffloadBundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ CompressedOffloadBundle::decompress(llvm::MemoryBufferRef &Input,
HashRecalcTimer.startTimer();
llvm::MD5 Hash;
llvm::MD5::MD5Result Result;
Hash.update(llvm::ArrayRef<uint8_t>(DecompressedData.data(),
DecompressedData.size()));
Hash.update(llvm::ArrayRef<uint8_t>(DecompressedData));
Hash.final(Result);
uint64_t RecalculatedHash = Result.low();
HashRecalcTimer.stopTimer();
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/XRay/FDRTraceWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Error FDRTraceWriter::visit(CustomEventRecord &R) {
if (auto E = writeMetadata<5u>(OS, R.size(), R.tsc(), R.cpu()))
return E;
auto D = R.data();
ArrayRef<char> Bytes(D.data(), D.size());
ArrayRef<char> Bytes(D);
OS.write(Bytes);
return Error::success();
}
Expand All @@ -105,7 +105,7 @@ Error FDRTraceWriter::visit(CustomEventRecordV5 &R) {
if (auto E = writeMetadata<5u>(OS, R.size(), R.delta()))
return E;
auto D = R.data();
ArrayRef<char> Bytes(D.data(), D.size());
ArrayRef<char> Bytes(D);
OS.write(Bytes);
return Error::success();
}
Expand All @@ -114,7 +114,7 @@ Error FDRTraceWriter::visit(TypedEventRecord &R) {
if (auto E = writeMetadata<8u>(OS, R.size(), R.delta(), R.eventType()))
return E;
auto D = R.data();
ArrayRef<char> Bytes(D.data(), D.size());
ArrayRef<char> Bytes(D);
OS.write(Bytes);
return Error::success();
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-mc/Disassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef std::pair<std::vector<unsigned char>, std::vector<const char *>>
static bool PrintInsts(const MCDisassembler &DisAsm, const ByteArrayTy &Bytes,
SourceMgr &SM, MCStreamer &Streamer, bool InAtomicBlock,
const MCSubtargetInfo &STI) {
ArrayRef<uint8_t> Data(Bytes.first.data(), Bytes.first.size());
ArrayRef<uint8_t> Data(Bytes.first);

// Disassemble it to strings.
uint64_t Size;
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-ml/Disassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ typedef std::pair<std::vector<unsigned char>, std::vector<const char *>>
static bool PrintInsts(const MCDisassembler &DisAsm, const ByteArrayTy &Bytes,
SourceMgr &SM, raw_ostream &Out, MCStreamer &Streamer,
bool InAtomicBlock, const MCSubtargetInfo &STI) {
ArrayRef<uint8_t> Data(Bytes.first.data(), Bytes.first.size());
ArrayRef<uint8_t> Data(Bytes.first);

// Disassemble it to strings.
uint64_t Size;
Expand Down
5 changes: 2 additions & 3 deletions llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ static int linkAndVerify() {
RuntimeDyldChecker::MemoryRegionInfo SecInfo;
SecInfo.setTargetAddress(Dyld.getSectionLoadAddress(*SectionID));
StringRef SecContent = Dyld.getSectionContent(*SectionID);
SecInfo.setContent(ArrayRef<char>(SecContent.data(), SecContent.size()));
SecInfo.setContent(ArrayRef<char>(SecContent));
return SecInfo;
};

Expand All @@ -945,8 +945,7 @@ static int linkAndVerify() {
SI.Offset);
StringRef SecContent =
Dyld.getSectionContent(SI.SectionID).substr(SI.Offset);
StubMemInfo.setContent(
ArrayRef<char>(SecContent.data(), SecContent.size()));
StubMemInfo.setContent(ArrayRef<char>(SecContent));
return StubMemInfo;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ TEST(ExecutionSessionWrapperFunctionCalls, RegisterAsyncHandlerAndRun) {
EXPECT_TRUE(SPSArgList<int32_t>::deserialize(IB, Result));
RP.set_value(Result);
},
AddAsyncTagAddr, ArrayRef<char>(ArgBuffer.data(), ArgBuffer.size()));
AddAsyncTagAddr, ArrayRef<char>(ArgBuffer));

EXPECT_EQ(RF.get(), (int32_t)3);

Expand Down
2 changes: 1 addition & 1 deletion llvm/unittests/Support/Base64Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void TestBase64Decode(StringRef Input, StringRef Expected,
if (ExpectedErrorMessage.empty()) {
ASSERT_THAT_ERROR(decodeBase64(Input, DecodedBytes), Succeeded());
EXPECT_EQ(llvm::ArrayRef<char>(DecodedBytes),
llvm::ArrayRef<char>(Expected.data(), Expected.size()));
llvm::ArrayRef<char>(Expected));
} else {
ASSERT_THAT_ERROR(decodeBase64(Input, DecodedBytes),
FailedWithMessage(ExpectedErrorMessage));
Expand Down