Skip to content

Commit 98f59d4

Browse files
committed
Resolve PR comments part 2
1 parent bd67241 commit 98f59d4

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

llvm/lib/Object/OffloadBundle.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Error OffloadBundleFatBin::readEntries(StringRef Buffer,
104104
uint64_t SectionOffset) {
105105
uint64_t NumOfEntries = 0;
106106

107-
BinaryStreamReader Reader(Buffer, endianness::little);
107+
BinaryStreamReader Reader(Buffer, llvm::endianness::little);
108108

109109
// Read the Magic String first.
110110
StringRef Magic;
@@ -200,15 +200,16 @@ Error object::extractOffloadBundleFatBinary(
200200
return Buffer.takeError();
201201

202202
// If it does not start with the reserved suffix, just skip this section.
203-
if ((identify_magic(*Buffer) == file_magic::offload_bundle) ||
204-
(identify_magic(*Buffer) == file_magic::offload_bundle_compressed)) {
203+
if ((llvm::identify_magic(*Buffer) == file_magic::offload_bundle) ||
204+
(llvm::identify_magic(*Buffer) ==
205+
file_magic::offload_bundle_compressed)) {
205206

206207
uint64_t SectionOffset = 0;
207208
if (Obj.isELF()) {
208209
SectionOffset = ELFSectionRef(Sec).getOffset();
209210
} else if (Obj.isCOFF()) // TODO: add COFF Support.
210211
return createStringError(object_error::parse_failed,
211-
"COFF object files not supported.\n");
212+
"COFF object files not supported");
212213

213214
MemoryBufferRef Contents(*Buffer, Obj.getFileName());
214215
if (Error Err = extractOffloadBundle(Contents, SectionOffset,
@@ -334,12 +335,12 @@ CompressedOffloadBundle::compress(compression::Params P,
334335
// For V2, ensure the sizes don't exceed 32-bit limit.
335336
if (UncompressedSize64 > std::numeric_limits<uint32_t>::max())
336337
return createStringError(inconvertibleErrorCode(),
337-
"uncompressed size exceeds version 2 limit.");
338+
"uncompressed size exceeds version 2 limit");
338339
if ((MagicNumber.size() + sizeof(uint32_t) + sizeof(Version) +
339340
sizeof(CompressionMethod) + sizeof(uint32_t) + sizeof(TruncatedHash) +
340341
CompressedBuffer.size()) > std::numeric_limits<uint32_t>::max())
341342
return createStringError(inconvertibleErrorCode(),
342-
"total file size exceeds version 2 limit.");
343+
"total file size exceeds version 2 limit");
343344

344345
TotalFileSize64 = MagicNumber.size() + sizeof(uint32_t) + sizeof(Version) +
345346
sizeof(CompressionMethod) + sizeof(uint32_t) +
@@ -471,7 +472,7 @@ CompressedOffloadBundle::CompressedBundleHeader::tryParse(StringRef Blob) {
471472

472473
if (Blob.size() < RequiredSize)
473474
return createStringError(inconvertibleErrorCode(),
474-
"compressed bundle header size too small.");
475+
"compressed bundle header size too small");
475476

476477
switch (Normalized.Version) {
477478
case 1:
@@ -490,7 +491,7 @@ CompressedOffloadBundle::CompressedBundleHeader::tryParse(StringRef Blob) {
490491
break;
491492
default:
492493
return createStringError(inconvertibleErrorCode(),
493-
"unknown compressed bundle version.");
494+
"unknown compressed bundle version");
494495
}
495496

496497
// Determine compression format.
@@ -502,7 +503,7 @@ CompressedOffloadBundle::CompressedBundleHeader::tryParse(StringRef Blob) {
502503
break;
503504
default:
504505
return createStringError(inconvertibleErrorCode(),
505-
"unknown compressing method.");
506+
"unknown compressing method");
506507
}
507508

508509
return Normalized;
@@ -518,7 +519,7 @@ CompressedOffloadBundle::decompress(const MemoryBuffer &Input, bool Verbose) {
518519

519520
if (identify_magic(Blob) != file_magic::offload_bundle_compressed) {
520521
if (Verbose)
521-
errs() << "Uncompressed bundle.\n";
522+
errs() << "Uncompressed bundle\n";
522523
return MemoryBuffer::getMemBufferCopy(Blob);
523524
}
524525

0 commit comments

Comments
 (0)