[llvm] e874615 - [llc] Remove an unnecessary cast (NFC) (#151085)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 29 08:19:14 PDT 2025


Author: Kazu Hirata
Date: 2025-07-29T08:19:09-07:00
New Revision: e874615a62e6a5cb7be0be67b0c4c66c4719f67a

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

LOG: [llc] Remove an unnecessary cast (NFC) (#151085)

getObjFileLowering() already returns TargetLoweringObjectFile *.

Added: 
    

Modified: 
    llvm/tools/llc/llc.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index 93b4a50ef86d7..b3d7185e7f144 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -733,8 +733,8 @@ static int compileModule(char **argv, LLVMContext &Context) {
         reportError("target does not support generation of this file type");
     }
 
-    const_cast<TargetLoweringObjectFile *>(Target->getObjFileLowering())
-        ->Initialize(MMIWP->getMMI().getContext(), *Target);
+    Target->getObjFileLowering()->Initialize(MMIWP->getMMI().getContext(),
+                                             *Target);
     if (MIR) {
       assert(MMIWP && "Forgot to create MMIWP?");
       if (MIR->parseMachineFunctions(*M, MMIWP->getMMI()))


        


More information about the llvm-commits mailing list