[llvm] a749484 - [ExecutionEngine] Remove unnecessary casts (NFC) (#151442)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 07:31:19 PDT 2025


Author: Kazu Hirata
Date: 2025-07-31T07:31:15-07:00
New Revision: a74948471a6666ed4c590874ffaffac8df70ccd2

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

LOG: [ExecutionEngine] Remove unnecessary casts (NFC) (#151442)

WA, WA1, and WA2 are already of char *.

Added: 
    

Modified: 
    llvm/unittests/ExecutionEngine/Orc/MemoryMapperTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/ExecutionEngine/Orc/MemoryMapperTest.cpp b/llvm/unittests/ExecutionEngine/Orc/MemoryMapperTest.cpp
index 6ab659d38f5ca..fea9eabbb465b 100644
--- a/llvm/unittests/ExecutionEngine/Orc/MemoryMapperTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/MemoryMapperTest.cpp
@@ -81,7 +81,7 @@ TEST(MemoryMapperTest, InitializeDeinitialize) {
     {
       // Provide working memory
       char *WA1 = Mapper->prepare(Mem1->Start, HW.size() + 1);
-      std::strcpy(static_cast<char *>(WA1), HW.c_str());
+      std::strcpy(WA1, HW.c_str());
     }
 
     // A structure to be passed to initialize
@@ -106,7 +106,7 @@ TEST(MemoryMapperTest, InitializeDeinitialize) {
 
     {
       char *WA2 = Mapper->prepare(Mem1->Start + PageSize, HW.size() + 1);
-      std::strcpy(static_cast<char *>(WA2), HW.c_str());
+      std::strcpy(WA2, HW.c_str());
     }
 
     MemoryMapper::AllocInfo Alloc2;
@@ -159,7 +159,7 @@ TEST(MemoryMapperTest, InitializeDeinitialize) {
       EXPECT_THAT_ERROR(Mem2.takeError(), Succeeded());
 
       char *WA = Mapper->prepare(Mem2->Start, HW.size() + 1);
-      std::strcpy(static_cast<char *>(WA), HW.c_str());
+      std::strcpy(WA, HW.c_str());
 
       MemoryMapper::AllocInfo Alloc3;
       {


        


More information about the llvm-commits mailing list