OSDN Git Service

[WebAssembly] Support CFI for WebAssembly target
authorDerek Schuff <dschuff@google.com>
Mon, 1 Aug 2016 22:25:02 +0000 (22:25 +0000)
committerDerek Schuff <dschuff@google.com>
Mon, 1 Aug 2016 22:25:02 +0000 (22:25 +0000)
commit23429a5af3b64dc59422e15381a8b5587a58f149
tree18942536fd1629387bdfdd997fd6238881169187
parentf4cfadb9c0a143beb98d1f451964c607f2159059
[WebAssembly] Support CFI for WebAssembly target

Summary: This patch implements CFI for WebAssembly. It modifies the
LowerTypeTest pass to pre-assign table indexes to functions that are
called indirectly, and lowers type checks to test against the
appropriate table indexes. It also modifies the WebAssembly backend to
support a special ".indidx" assembly directive that propagates the table
index assignments out to the linker.

Patch by Dominic Chen

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277398 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
lib/Transforms/IPO/LowerTypeTests.cpp
test/CodeGen/WebAssembly/cfi.ll [new file with mode: 0644]
test/Transforms/LowerTypeTests/function-disjoint.ll [new file with mode: 0644]
test/Transforms/LowerTypeTests/function-ext.ll
test/Transforms/LowerTypeTests/function.ll