mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[WebAssembly] Fixup main
signature by default
Differential Revision: https://reviews.llvm.org/D53396 llvm-svn: 345880
This commit is contained in:
parent
06198ea6c1
commit
1fdc70c30d
@ -36,11 +36,6 @@ using namespace llvm;
|
||||
|
||||
#define DEBUG_TYPE "wasm-fix-function-bitcasts"
|
||||
|
||||
static cl::opt<bool>
|
||||
TemporaryWorkarounds("wasm-temporary-workarounds",
|
||||
cl::desc("Apply certain temporary workarounds"),
|
||||
cl::init(true), cl::Hidden);
|
||||
|
||||
namespace {
|
||||
class FixFunctionBitcasts final : public ModulePass {
|
||||
StringRef getPassName() const override {
|
||||
@ -241,7 +236,7 @@ bool FixFunctionBitcasts::runOnModule(Module &M) {
|
||||
// "int main(int argc, char *argv[])", create an artificial call with it
|
||||
// bitcasted to that type so that we generate a wrapper for it, so that
|
||||
// the C runtime can call it.
|
||||
if (!TemporaryWorkarounds && !F.isDeclaration() && F.getName() == "main") {
|
||||
if (!F.isDeclaration() && F.getName() == "main") {
|
||||
Main = &F;
|
||||
LLVMContext &C = M.getContext();
|
||||
Type *MainArgTys[] = {Type::getInt32Ty(C),
|
||||
|
@ -1,5 +1,5 @@
|
||||
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -wasm-temporary-workarounds=false -mattr=+sign-ext,+simd128 | FileCheck %s
|
||||
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -fast-isel -fast-isel-abort=1 -wasm-temporary-workarounds=false -mattr=+sign-ext,+simd128 | FileCheck %s
|
||||
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -mattr=+sign-ext,+simd128 | FileCheck %s
|
||||
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -fast-isel -fast-isel-abort=1 -mattr=+sign-ext,+simd128 | FileCheck %s
|
||||
|
||||
; Test that basic call operations assemble as expected.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
; RUN: llc < %s -asm-verbose=false -wasm-temporary-workarounds=false -wasm-keep-registers | FileCheck %s
|
||||
; RUN: llc < %s -asm-verbose=false -wasm-keep-registers | FileCheck %s
|
||||
|
||||
; Test that function pointer casts casting away varargs are replaced with
|
||||
; wrappers.
|
||||
|
@ -1,4 +1,4 @@
|
||||
; RUN: llc < %s -asm-verbose=false -wasm-disable-explicit-locals -wasm-keep-registers -enable-emscripten-cxx-exceptions -wasm-temporary-workarounds=false | FileCheck %s
|
||||
; RUN: llc < %s -asm-verbose=false -wasm-disable-explicit-locals -wasm-keep-registers -enable-emscripten-cxx-exceptions | FileCheck %s
|
||||
|
||||
; Test that function pointer casts are replaced with wrappers.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
; RUN: llc < %s -asm-verbose=false -wasm-temporary-workarounds=false | FileCheck %s
|
||||
; RUN: llc < %s -asm-verbose=false | FileCheck %s
|
||||
|
||||
; Test main functions with alternate signatures.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
; RUN: llc < %s -asm-verbose=false -wasm-temporary-workarounds=false | FileCheck %s
|
||||
; RUN: llc < %s -asm-verbose=false | FileCheck %s
|
||||
|
||||
; Test main functions with alternate signatures.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
; RUN: llc < %s -asm-verbose=false -wasm-temporary-workarounds=false | FileCheck %s
|
||||
; RUN: llc < %s -asm-verbose=false | FileCheck %s
|
||||
|
||||
; Test that main function with expected signature is not wrapped
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user