From b1c73532ee8997fe5dfbeb7d223027bdf99758a0 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 9 Dec 2023 14:28:42 +0100 Subject: Vendor import of llvm-project main llvmorg-18-init-14265-ga17671084db1. --- llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp') diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp index b3fe110a092b..81a450dbc0d9 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp @@ -247,8 +247,7 @@ bool FixFunctionBitcasts::runOnModule(Module &M) { if (F.getName() == "main") { Main = &F; LLVMContext &C = M.getContext(); - Type *MainArgTys[] = {Type::getInt32Ty(C), - PointerType::get(Type::getInt8PtrTy(C), 0)}; + Type *MainArgTys[] = {Type::getInt32Ty(C), PointerType::get(C, 0)}; FunctionType *MainTy = FunctionType::get(Type::getInt32Ty(C), MainArgTys, /*isVarArg=*/false); if (shouldFixMainFunction(F.getFunctionType(), MainTy)) { @@ -256,9 +255,7 @@ bool FixFunctionBitcasts::runOnModule(Module &M) { << *F.getFunctionType() << "\n"); Value *Args[] = {UndefValue::get(MainArgTys[0]), UndefValue::get(MainArgTys[1])}; - Value *Casted = - ConstantExpr::getBitCast(Main, PointerType::get(MainTy, 0)); - CallMain = CallInst::Create(MainTy, Casted, Args, "call_main"); + CallMain = CallInst::Create(MainTy, Main, Args, "call_main"); Uses.push_back(std::make_pair(CallMain, &F)); } } -- cgit v1.3