[WebAssembly] Add support for the event section
authorHeejin Ahn <aheejin@gmail.com>
Wed, 14 Nov 2018 02:46:21 +0000 (02:46 +0000)
committerHeejin Ahn <aheejin@gmail.com>
Wed, 14 Nov 2018 02:46:21 +0000 (02:46 +0000)
commitda419bdb5e3e167ea90c6923660059f35fa17d67
tree0264ae56ecdddf59399c2b355e1dee8eeffafb63
parent6a3c279d1cdcd4205a233952b4bacd5941cd355e
[WebAssembly] Add support for the event section

Summary:
This adds support for the 'event section' specified in the exception
handling proposal. (This was named 'exception section' first, but later
renamed to 'event section' to take possibilities of other kinds of
events into consideration. But currently we only store exception info in
this section.)

The event section is added between the global section and the export
section. This is for ease of validation per request of the V8 team.

This patch:
- Creates the event symbol type, which is a weak symbol
- Makes 'throw' instruction take the event symbol '__cpp_exception'
- Adds relocation support for events
- Adds WasmObjectWriter / WasmObjectFile (Reader) support
- Adds obj2yaml / yaml2obj support
- Adds '.eventtype' printing support

Reviewers: dschuff, sbc100, aardappel

Subscribers: jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 346825
34 files changed:
llvm/include/llvm/BinaryFormat/Wasm.h
llvm/include/llvm/BinaryFormat/WasmRelocs.def
llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
llvm/include/llvm/MC/MCExpr.h
llvm/include/llvm/MC/MCSymbolWasm.h
llvm/include/llvm/Object/RelocVisitor.h
llvm/include/llvm/Object/Wasm.h
llvm/include/llvm/ObjectYAML/WasmYAML.h
llvm/lib/BinaryFormat/Wasm.cpp
llvm/lib/CodeGen/AsmPrinter/WasmException.cpp
llvm/lib/CodeGen/AsmPrinter/WasmException.h
llvm/lib/MC/MCExpr.cpp
llvm/lib/MC/WasmObjectWriter.cpp
llvm/lib/Object/WasmObjectFile.cpp
llvm/lib/ObjectYAML/WasmYAML.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp
llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
llvm/lib/Target/WebAssembly/WebAssemblyISD.def
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.h
llvm/test/CodeGen/WebAssembly/exception.ll
llvm/test/MC/WebAssembly/event-section.ll [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/event_section.yaml [new file with mode: 0644]
llvm/tools/llvm-readobj/WasmDumper.cpp
llvm/tools/obj2yaml/wasm2yaml.cpp
llvm/tools/yaml2obj/yaml2wasm.cpp