summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/llvm-objdump/WasmDump.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/llvm-objdump/WasmDump.cpp')
-rw-r--r--contrib/llvm/tools/llvm-objdump/WasmDump.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/llvm/tools/llvm-objdump/WasmDump.cpp b/contrib/llvm/tools/llvm-objdump/WasmDump.cpp
new file mode 100644
index 0000000..0d8ffba
--- /dev/null
+++ b/contrib/llvm/tools/llvm-objdump/WasmDump.cpp
@@ -0,0 +1,28 @@
+//===-- WasmDump.cpp - wasm-specific dumper ---------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// \brief This file implements the wasm-specific dumper for llvm-objdump.
+///
+//===----------------------------------------------------------------------===//
+
+#include "llvm-objdump.h"
+#include "llvm/Object/Wasm.h"
+
+using namespace llvm;
+using namespace object;
+
+void llvm::printWasmFileHeader(const object::ObjectFile *Obj) {
+ const WasmObjectFile *File = dyn_cast<const WasmObjectFile>(Obj);
+
+ outs() << "Program Header:\n";
+ outs() << "Version: 0x";
+ outs().write_hex(File->getHeader().Version);
+ outs() << "\n";
+}
OpenPOWER on IntegriCloud