-
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 1 commit
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
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ | |
#include "llvm/Object/Archive.h" | ||
#include "llvm/Object/Decompressor.h" | ||
#include "llvm/Object/ObjectFile.h" | ||
#include "llvm/Object/OffloadBinary.h" | ||
#include "llvm/Object/OffloadBundle.h" | ||
#include "llvm/Support/Error.h" | ||
#include "llvm/Support/FormatVariadic.h" | ||
#include "llvm/Support/ScopedPrinter.h" | ||
|
@@ -230,4 +232,15 @@ void ObjDumper::printSectionsAsHex(const object::ObjectFile &Obj, | |
} | ||
} | ||
|
||
void ObjDumper::printOffloading(const object::ObjectFile &Obj) { | ||
|
||
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: don't start a function with a blank line. 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. ok |
||
SmallVector<llvm::object::OffloadBundleFatBin> Bundles; | ||
if (Error Err = object::extractOffloadBundleFatBinary(Obj, Bundles)) | ||
reportWarning(std::move(Err), Obj.getFileName()); | ||
jh7370 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Print out all the FatBin Bundles that are contained in this buffer. | ||
for (const auto &[Index, Bundle] : llvm::enumerate(Bundles)) | ||
Bundle.printEntriesAsURI(); | ||
} | ||
|
||
} // namespace llvm |
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.