WebAssembly: update syntax
authorJF Bastien <jfb@google.com>
Fri, 16 Oct 2015 00:53:49 +0000 (00:53 +0000)
committerJF Bastien <jfb@google.com>
Fri, 16 Oct 2015 00:53:49 +0000 (00:53 +0000)
commit8cafdf539bee5223da767bc4e3ebc28059fe81bf
treea7b4b246421c3f8c5e47a70e18391eae509cbf76
parentb83a35aab60d422fb449d2d7bbde02e2408efc80
WebAssembly: update syntax

Summary:
Follow the same syntax as for the spec repo. Both have evolved slightly
independently and need to converge again.

This, along with wasmate changes, allows me to do the following:

  echo "int add(int a, int b) { return a + b; }" > add.c
  ./out/bin/clang -O2 -S --target=wasm32-unknown-unknown add.c -o add.wack
  ./experimental/prototype-wasmate/wasmate.py add.wack > add.wast
  ./sexpr-wasm-prototype/out/sexpr-wasm add.wast -o add.wasm
  ./sexpr-wasm-prototype/third_party/v8-native-prototype/v8/v8/out/Release/d8 -e "print(WASM.instantiateModule(readbuffer('add.wasm'), {print:print}).add(42, 1337));"

As you'd expect, the d8 shell prints out the right value.

Reviewers: sunfish

Subscribers: jfb, llvm-commits, dschuff

Differential Revision: http://reviews.llvm.org/D13712

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250480 91177308-0d34-0410-b5e6-96231b3b80d8
23 files changed:
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
test/CodeGen/WebAssembly/call.ll
test/CodeGen/WebAssembly/cfg-stackify.ll
test/CodeGen/WebAssembly/comparisons_f32.ll
test/CodeGen/WebAssembly/comparisons_f64.ll
test/CodeGen/WebAssembly/comparisons_i32.ll
test/CodeGen/WebAssembly/comparisons_i64.ll
test/CodeGen/WebAssembly/conv.ll
test/CodeGen/WebAssembly/f32.ll
test/CodeGen/WebAssembly/f64.ll
test/CodeGen/WebAssembly/func.ll
test/CodeGen/WebAssembly/i32.ll
test/CodeGen/WebAssembly/i64.ll
test/CodeGen/WebAssembly/immediates.ll
test/CodeGen/WebAssembly/load-ext.ll
test/CodeGen/WebAssembly/load-store-i1.ll
test/CodeGen/WebAssembly/load.ll
test/CodeGen/WebAssembly/memory-addr32.ll
test/CodeGen/WebAssembly/memory-addr64.ll
test/CodeGen/WebAssembly/phi.ll
test/CodeGen/WebAssembly/store-trunc.ll
test/CodeGen/WebAssembly/store.ll
test/CodeGen/WebAssembly/unused-argument.ll