diff options
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp index 179dcc50540..0644f1232f6 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp @@ -244,11 +244,13 @@ bool FixFunctionBitcasts::runOnModule(Module &M) { if (!TemporaryWorkarounds && !F.isDeclaration() && F.getName() == "main") { Main = &F; LLVMContext &C = M.getContext(); - Type *MainArgTys[] = {PointerType::get(Type::getInt8PtrTy(C), 0), - Type::getInt32Ty(C)}; + Type *MainArgTys[] = {Type::getInt32Ty(C), + PointerType::get(Type::getInt8PtrTy(C), 0)}; FunctionType *MainTy = FunctionType::get(Type::getInt32Ty(C), MainArgTys, /*isVarArg=*/false); if (F.getFunctionType() != MainTy) { + LLVM_DEBUG(dbgs() << "Found `main` function with incorrect type: " + << *F.getFunctionType() << "\n"); Value *Args[] = {UndefValue::get(MainArgTys[0]), UndefValue::get(MainArgTys[1])}; Value *Casted = |