diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-12-09 13:28:42 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2023-12-09 13:28:42 +0000 |
| commit | b1c73532ee8997fe5dfbeb7d223027bdf99758a0 (patch) | |
| tree | 7d6e51c294ab6719475d660217aa0c0ad0526292 /llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp | |
| parent | 7fa27ce4a07f19b07799a767fc29416f3b625afb (diff) | |
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp')
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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)); } } |
