15 Commits

Author SHA1 Message Date
Dan Gohman
53ff96ab08 [WebAssembly] Basic support for Wasm object file encoding.
With the "wasm32-unknown-unknown-wasm" triple, this allows writing out
simple wasm object files, and is another step in a larger series toward
migrating from ELF to general wasm object support. Note that this code
and the binary format itself is still experimental.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296190 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 23:18:00 +00:00
Dan Gohman
8073df7f9a [WebAssembly] Add a cast to void to fix an unused private member warning, for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295327 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 15:21:37 +00:00
Dan Gohman
897444660d [WebAssembly] Pass an MCContext to WebAssemblyMCCodeEmitter. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294679 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 00:14:42 +00:00
Dan Gohman
474281748f [WebAssembly] Add an "explicit" keyword to a constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290345 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-22 16:03:02 +00:00
Dan Gohman
01b89435ec [WebAssembly] Implement more WebAssembly binary encoding.
This changes locals from being declared by the emitLocal hook in
WebAssemblyTargetStreamer, rather than with an instruction. After exploring
the infastructure in LLVM more, this seems to make more sense since
declaring locals doesn't use an encoded opcode.

This also adds more 0xd opcodes, type encodings, and miscellaneous
binary encoding bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285040 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 23:27:49 +00:00
Dan Gohman
1871c0f455 [WebAssembly] Add an option to make get_local/set_local explicit.
This patch adds a pass, controlled by an option and off by default for
now, for making implicit get_local/set_local explicit. This simplifies
emitting wasm with MC.

Differential Revision: https://reviews.llvm.org/D25836


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 19:49:43 +00:00
Reid Kleckner
06876d225a Fix the wasm build by including EndianStream.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273591 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-23 18:12:31 +00:00
Dan Gohman
bb15d409cb [WebAssembly] Minor code cleanups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 05:54:22 +00:00
Dan Gohman
92c68ce7c8 [WebAssembly] Remove an unused data member. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:31:41 +00:00
Dan Gohman
b28bc14f59 [WebAssembly] Implement a prototype instruction encoder and disassembler.
This is using an extremely simple temporary made-up binary format, not the
official binary format (which isn't defined yet).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257440 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 03:32:29 +00:00
Dan Gohman
ad86ed61f2 [WebAssembly] Minor code cleanups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 01:18:00 +00:00
Dan Gohman
0b9379b950 [WebAssembly] Remove unused arguments, unused functions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257125 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 00:43:54 +00:00
Eric Christopher
a07559388f Remove unused class variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255939 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-17 23:43:40 +00:00
Diego Novillo
b8e9fb8816 Fix unused variable warning in release builds. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255897 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-17 14:58:34 +00:00
Dan Gohman
5731435941 [WebAssembly] Experimental ELF writer support
This creates the initial infrastructure for writing ELF output files. It
doesn't yet have any implementation for encoding instructions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255869 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-17 01:39:00 +00:00