summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-04-28 21:12:09 +0000
committerSam Clegg <sbc@chromium.org>2017-04-28 21:12:09 +0000
commitff0730b3fcd488caf121e2e4d1aa8506ff13f3c6 (patch)
tree1ef967cec5a0f6d43a28015a9bd81ede35262ad4 /llvm/tools/llvm-readobj
parent267ba94ce6593ba09b1d45ac04d8cc5851685f9c (diff)
downloadbcm5719-llvm-ff0730b3fcd488caf121e2e4d1aa8506ff13f3c6.tar.gz
bcm5719-llvm-ff0730b3fcd488caf121e2e4d1aa8506ff13f3c6.zip
[WebAssembly] Write initial memory in pages not bytes
Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32660 llvm-svn: 301687
Diffstat (limited to 'llvm/tools/llvm-readobj')
-rw-r--r--llvm/tools/llvm-readobj/WasmDumper.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/tools/llvm-readobj/WasmDumper.cpp b/llvm/tools/llvm-readobj/WasmDumper.cpp
index f07dd07b59f..21614297e46 100644
--- a/llvm/tools/llvm-readobj/WasmDumper.cpp
+++ b/llvm/tools/llvm-readobj/WasmDumper.cpp
@@ -150,8 +150,20 @@ void WasmDumper::printSections() {
W.printEnum("Type", WasmSec.Type, makeArrayRef(WasmSectionTypes));
W.printNumber("Size", (uint64_t)WasmSec.Content.size());
W.printNumber("Offset", WasmSec.Offset);
- if (WasmSec.Type == wasm::WASM_SEC_CUSTOM) {
+ switch (WasmSec.Type) {
+ case wasm::WASM_SEC_CUSTOM:
W.printString("Name", WasmSec.Name);
+ break;
+ case wasm::WASM_SEC_MEMORY:
+ ListScope Group(W, "Memories");
+ for (const wasm::WasmLimits &Memory : Obj->memories()) {
+ DictScope Group(W, "Memory");
+ W.printNumber("InitialPages", Memory.Initial);
+ if (Memory.Flags & wasm::WASM_LIMITS_FLAG_HAS_MAX) {
+ W.printNumber("MaxPages", WasmSec.Offset);
+ }
+ }
+ break;
}
if (opts::SectionRelocations) {
OpenPOWER on IntegriCloud