-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Add --offoading option to llvm-readobj #143342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
82d085c
e1d45de
a0929b5
674daab
94911f8
69908e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,17 +89,17 @@ Error OffloadBundleFatBin::readEntries(StringRef Buffer, | |
uint64_t EntryIDSize; | ||
StringRef EntryID; | ||
|
||
if (auto EC = Reader.readInteger(EntryOffset)) | ||
return errorCodeToError(object_error::parse_failed); | ||
if (Error EC = Reader.readInteger(EntryOffset)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: since |
||
return EC; | ||
|
||
if (auto EC = Reader.readInteger(EntrySize)) | ||
return errorCodeToError(object_error::parse_failed); | ||
if (Error EC = Reader.readInteger(EntrySize)) | ||
return EC; | ||
|
||
if (auto EC = Reader.readInteger(EntryIDSize)) | ||
return errorCodeToError(object_error::parse_failed); | ||
if (Error EC = Reader.readInteger(EntryIDSize)) | ||
return EC; | ||
|
||
if (auto EC = Reader.readFixedString(EntryID, EntryIDSize)) | ||
return errorCodeToError(object_error::parse_failed); | ||
if (Error EC = Reader.readFixedString(EntryID, EntryIDSize)) | ||
return EC; | ||
|
||
auto Entry = std::make_unique<OffloadBundleEntry>( | ||
EntryOffset + SectionOffset, EntrySize, EntryIDSize, EntryID); | ||
|
@@ -125,7 +125,7 @@ OffloadBundleFatBin::create(MemoryBufferRef Buf, uint64_t SectionOffset, | |
// Read the Bundle Entries | ||
Error Err = TheBundle->readEntries(Buf.getBuffer(), SectionOffset); | ||
if (Err) | ||
return errorCodeToError(object_error::parse_failed); | ||
return Err; | ||
|
||
return std::unique_ptr<OffloadBundleFatBin>(TheBundle); | ||
} | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,6 +138,7 @@ static bool Notes; | |
static bool ProgramHeaders; | ||
static bool SectionGroups; | ||
static bool VersionInfo; | ||
static bool Offloading; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: this list is the wrong list to add this option, as it's the ELF-specific ones (according to the comment). It should be the list above (and in alphabetical order). |
||
|
||
// Mach-O specific options. | ||
static bool MachODataInCode; | ||
|
@@ -288,6 +289,7 @@ static void parseOptions(const opt::InputArgList &Args) { | |
} | ||
} | ||
opts::VersionInfo = Args.hasArg(OPT_version_info); | ||
opts::Offloading = Args.hasArg(OPT_offloading); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: These options are set in alphabetical order. |
||
|
||
// Mach-O specific options. | ||
opts::MachODataInCode = Args.hasArg(OPT_macho_data_in_code); | ||
|
@@ -455,6 +457,8 @@ static void dumpObject(ObjectFile &Obj, ScopedPrinter &Writer, | |
Dumper->printGnuHashTable(); | ||
if (opts::VersionInfo) | ||
Dumper->printVersionInfo(); | ||
if (opts::Offloading) | ||
Dumper->printOffloading(Obj); | ||
if (opts::StringTable) | ||
Dumper->printStringTable(); | ||
if (Obj.isELF()) { | ||
|
@@ -699,6 +703,7 @@ int llvm_readobj_main(int argc, char **argv, const llvm::ToolContext &) { | |
opts::DynamicTable = true; | ||
opts::Notes = true; | ||
opts::VersionInfo = true; | ||
opts::Offloading = true; | ||
opts::UnwindInfo = true; | ||
opts::SectionGroups = true; | ||
opts::HashHistogram = true; | ||
|
Uh oh!
There was an error while loading. Please reload this page.