[llvm] [CodeGen] Remove an unnecessary cast (NFC) (PR #148764)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 19:48:06 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/148764

getExpression() already returns DIExpression *.


>From e544590ae9232004ba2041dda66dc91c3e85ce45 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 13 Jul 2025 13:31:51 -0700
Subject: [PATCH] [CodeGen] Remove an unnecessary cast (NFC)

getExpression() already returns DIExpression *.
---
 llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
index 03d3e8eab35d0..85efb1bd8aed9 100644
--- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
@@ -784,7 +784,7 @@ MachineInstr *
 InstrEmitter::EmitDbgInstrRef(SDDbgValue *SD,
                               VRBaseMapType &VRBaseMap) {
   MDNode *Var = SD->getVariable();
-  const DIExpression *Expr = (DIExpression *)SD->getExpression();
+  const DIExpression *Expr = SD->getExpression();
   DebugLoc DL = SD->getDebugLoc();
   const MCInstrDesc &RefII = TII->get(TargetOpcode::DBG_INSTR_REF);
 



More information about the llvm-commits mailing list