mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-24 21:15:04 +00:00
7a578c9156
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288251 91177308-0d34-0410-b5e6-96231b3b80d8
29 lines
880 B
C++
29 lines
880 B
C++
//===-- 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";
|
|
}
|