OSDN Git Service

[WebAssembly] Narrow the scope of WebAssemblyFixFunctionBitcasts
authorJacob Gravelle <jgravelle@google.com>
Tue, 10 Oct 2017 16:20:18 +0000 (16:20 +0000)
committerJacob Gravelle <jgravelle@google.com>
Tue, 10 Oct 2017 16:20:18 +0000 (16:20 +0000)
commit8e46b87a2e8298eb654965380834ccdef94ec48c
treee7b2fb8a468ac066f9adee570e5b0743b19f9e67
parent768ffd59959c78e8fa5260bc6bdfec8467dcb70d
[WebAssembly] Narrow the scope of WebAssemblyFixFunctionBitcasts

Summary:
The pass to fix function bitcasts generates thunks for functions that
are called directly with a mismatching signature. It was also generating
thunks in cases where the function was address-taken, causing aliasing
problems in otherwise valid cases.
This patch tightens the restrictions for when the pass runs.

Reviewers: sunfish, dschuff

Subscribers: jfb, sbc100, llvm-commits, aheejin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315326 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp
test/CodeGen/WebAssembly/function-bitcasts.ll