[llvm] cf18e5e - [ProfileData] Remove an unnecessary cast (NFC) (#152087)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 5 07:39:18 PDT 2025


Author: Kazu Hirata
Date: 2025-08-05T07:39:14-07:00
New Revision: cf18e5e0f84b23f5dc410af5447ca03b62aaa12c

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

LOG: [ProfileData] Remove an unnecessary cast (NFC) (#152087)

new already returns ValueProfData *.

Added: 
    

Modified: 
    llvm/lib/ProfileData/InstrProf.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index bd3964ce127fd..542572975dc89 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/lib/ProfileData/InstrProf.cpp
@@ -1160,8 +1160,7 @@ void getValueForSiteInstrProf(const void *R, InstrProfValueData *Dst,
 }
 
 ValueProfData *allocValueProfDataInstrProf(size_t TotalSizeInBytes) {
-  ValueProfData *VD =
-      (ValueProfData *)(new (::operator new(TotalSizeInBytes)) ValueProfData());
+  ValueProfData *VD = new (::operator new(TotalSizeInBytes)) ValueProfData();
   memset(VD, 0, TotalSizeInBytes);
   return VD;
 }


        


More information about the llvm-commits mailing list