Skip to content

[ARM] Remove an unnecessary cast (NFC) #148869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2025

Conversation

kazutakahirata
Copy link
Contributor

TII is already of const ARMBaseInstrInfo *. This patch removes AII in
favor of TII.

@llvmbot
Copy link
Member

llvmbot commented Jul 15, 2025

@llvm/pr-subscribers-backend-arm

Author: Kazu Hirata (kazutakahirata)

Changes

TII is already of const ARMBaseInstrInfo *. This patch removes AII in
favor of TII.


Full diff: https://github.com/llvm/llvm-project/pull/148869.diff

1 Files Affected:

  • (modified) llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp (+1-3)
diff --git a/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp b/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
index 52302241fe365..57141ab69223f 100644
--- a/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
+++ b/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
@@ -2542,9 +2542,7 @@ bool ARMExpandPseudo::ExpandMI(MachineBasicBlock &MBB,
     }
     case ARM::Int_eh_sjlj_dispatchsetup: {
       MachineFunction &MF = *MI.getParent()->getParent();
-      const ARMBaseInstrInfo *AII =
-        static_cast<const ARMBaseInstrInfo*>(TII);
-      const ARMBaseRegisterInfo &RI = AII->getRegisterInfo();
+      const ARMBaseRegisterInfo &RI = TII->getRegisterInfo();
       // For functions using a base pointer, we rematerialize it (via the frame
       // pointer) here since eh.sjlj.setjmp and eh.sjlj.longjmp don't do it
       // for us. Otherwise, expand to nothing.

Copy link
Collaborator

@davemgreen davemgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

TII is already of const ARMBaseInstrInfo *.  This patch removes AII in
favor of TII.
@kazutakahirata kazutakahirata force-pushed the cleanup_20250715_cast_ARM branch from 32316a1 to 0c55977 Compare July 15, 2025 23:43
@kazutakahirata kazutakahirata merged commit 39dd6cd into llvm:main Jul 16, 2025
9 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250715_cast_ARM branch July 16, 2025 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants