summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/llvm-objdump.h
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-05-17 17:10:12 +0000
committerKevin Enderby <enderby@apple.com>2016-05-17 17:10:12 +0000
commitac9e15551dfccb2996708534648e6b7e8d4fee8a (patch)
tree2c0c21fb4b4d25171654d1e0800555a949c4f355 /llvm/tools/llvm-objdump/llvm-objdump.h
parent75259bb3cb719446b3b705bd85ddb7ad3cb9cce7 (diff)
downloadbcm5719-llvm-ac9e15551dfccb2996708534648e6b7e8d4fee8a.tar.gz
bcm5719-llvm-ac9e15551dfccb2996708534648e6b7e8d4fee8a.zip
Change llvm-objdump, llvm-nm and llvm-size when reporting an object file error
when the object is in an archive to use something like libx.a(foo.o) as part of the error message. Also changed llvm-objdump and llvm-size to be like llvm-nm and ignore non-object files in archives and not produce any error message. To do this Archive::Child::getAsBinary() was changed from ErrorOr<...> to Expected<...> then that was threaded up to its users. Converting this interface to Expected<> from ErrorOr<> does involve touching a number of places. To contain the changes for now the use of errorToErrorCode() is still used in one place yet to be fully converted. Again there some were bugs in the existing code that did not deal with the old ErrorOr<> return values.  So now with Expected<> since they must be checked and the error handled, I added a TODO and a comments for those. llvm-svn: 269784
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.h')
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.h b/llvm/tools/llvm-objdump/llvm-objdump.h
index 19b62ac459c..51a600d9a04 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.h
+++ b/llvm/tools/llvm-objdump/llvm-objdump.h
@@ -13,6 +13,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataTypes.h"
+#include "llvm/Object/Archive.h"
namespace llvm {
class StringRef;
@@ -21,6 +22,7 @@ namespace object {
class COFFObjectFile;
class MachOObjectFile;
class ObjectFile;
+ class Archive;
class RelocationRef;
}
@@ -84,9 +86,15 @@ void printRawClangAST(const object::ObjectFile *o);
void PrintRelocations(const object::ObjectFile *o);
void PrintSectionHeaders(const object::ObjectFile *o);
void PrintSectionContents(const object::ObjectFile *o);
-void PrintSymbolTable(const object::ObjectFile *o);
+void PrintSymbolTable(const object::ObjectFile *o, StringRef ArchiveName);
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, std::error_code EC);
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, llvm::Error E);
+LLVM_ATTRIBUTE_NORETURN void report_error(StringRef FileName,
+ StringRef ArchiveName,
+ llvm::Error E);
+LLVM_ATTRIBUTE_NORETURN void report_error(StringRef ArchiveName,
+ const object::Archive::Child &C,
+ llvm::Error E);
} // end namespace llvm
OpenPOWER on IntegriCloud