[WebAssembly] Add llvm-objdump support for wasm file format

This is the first part of an effort to add wasm binary
support across all llvm tools.

Patch by Sam Clegg

Differential Revision: https://reviews.llvm.org/D26172

llvm-svn: 288251
This commit is contained in:
Derek Schuff
2016-11-30 16:49:11 +00:00
parent 288c088c17
commit 2c6f75ddc5
17 changed files with 546 additions and 2 deletions

View File

@@ -11,9 +11,10 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/MachO.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/Wasm.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -105,6 +106,8 @@ ObjectFile::createObjectFile(MemoryBufferRef Object, sys::fs::file_magic Type) {
case sys::fs::file_magic::coff_import_library:
case sys::fs::file_magic::pecoff_executable:
return errorOrToExpected(createCOFFObjectFile(Object));
case sys::fs::file_magic::wasm_object:
return createWasmObjectFile(Object);
}
llvm_unreachable("Unexpected Object File Type");
}