aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/llvm-objdump/WasmDump.cpp
blob: 0d8ffba6ba457b230532803a3e5af6ea7570b41f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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";
}