[llvm] fac5ab6 - [llvm][WebAssemblyFixFunctionBitcasts] Remove no-op ptr-to-ptr bitcast (NFC)

Youngsuk Kim via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 10:31:36 PST 2023


Author: Youngsuk Kim
Date: 2023-11-17T12:31:22-06:00
New Revision: fac5ab662e6556f6e552196daaa8fe5280f26f2f

URL: https://github.com/llvm/llvm-project/commit/fac5ab662e6556f6e552196daaa8fe5280f26f2f
DIFF: https://github.com/llvm/llvm-project/commit/fac5ab662e6556f6e552196daaa8fe5280f26f2f.diff

LOG: [llvm][WebAssemblyFixFunctionBitcasts] Remove no-op ptr-to-ptr bitcast (NFC)

Opaque ptr cleanup effort (NFC)

Added: 
    

Modified: 
    llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp
index 2aebc94aa663f4f..81a450dbc0d9c5d 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp
@@ -255,8 +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(C, 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));
       }
     }


        


More information about the llvm-commits mailing list