[WebAssembly] Add support for the event section

Summary:
This adds support for the 'event section' specified in the exception
handling proposal.

Wasm exception handling binary model spec:
https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md#changes-to-the-binary-model

Reviewers: sbc100, ruiu

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 348703
diff --git a/lld/wasm/MarkLive.cpp b/lld/wasm/MarkLive.cpp
index 7f4696b..3bbd114 100644
--- a/lld/wasm/MarkLive.cpp
+++ b/lld/wasm/MarkLive.cpp
@@ -22,6 +22,7 @@
 #include "MarkLive.h"
 #include "Config.h"
 #include "InputChunks.h"
+#include "InputEvent.h"
 #include "InputGlobal.h"
 #include "SymbolTable.h"
 #include "Symbols.h"
@@ -105,6 +106,9 @@
       for (InputGlobal *G : Obj->Globals)
         if (!G->Live)
           message("removing unused section " + toString(G));
+      for (InputEvent *E : Obj->Events)
+        if (!E->Live)
+          message("removing unused section " + toString(E));
     }
     for (InputChunk *C : Symtab->SyntheticFunctions)
       if (!C->Live)