[llvm] f053b73 - [CodeGen] Remove an unnecessary cast (NFC) (#150784)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 26 18:15:20 PDT 2025


Author: Kazu Hirata
Date: 2025-07-26T18:15:16-07:00
New Revision: f053b736a954eab57e9200743e9773bcb3b65373

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

LOG: [CodeGen] Remove an unnecessary cast (NFC) (#150784)

createTargetMachine() already returns TargetMachine *.

Added: 
    

Modified: 
    llvm/unittests/CodeGen/DroppedVariableStatsMIRTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/CodeGen/DroppedVariableStatsMIRTest.cpp b/llvm/unittests/CodeGen/DroppedVariableStatsMIRTest.cpp
index 36504f50505a4..e72b4e4aea49f 100644
--- a/llvm/unittests/CodeGen/DroppedVariableStatsMIRTest.cpp
+++ b/llvm/unittests/CodeGen/DroppedVariableStatsMIRTest.cpp
@@ -39,8 +39,7 @@ createTargetMachine(std::string TargetStr, StringRef CPU, StringRef FS) {
     return nullptr;
   TargetOptions Options;
   return std::unique_ptr<TargetMachine>(
-      static_cast<TargetMachine *>(T->createTargetMachine(
-          TT, CPU, FS, Options, std::nullopt, std::nullopt)));
+      T->createTargetMachine(TT, CPU, FS, Options, std::nullopt, std::nullopt));
 }
 
 std::unique_ptr<Module> parseMIR(const TargetMachine &TM, StringRef MIRCode,


        


More information about the llvm-commits mailing list