[PATCH] D88636: [AArch64] Remove a duplicate call to setHasWinCFI. NFCI.

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 01:15:58 PDT 2020


mstorsjo created this revision.
mstorsjo added reviewers: efriedma, rnk, ssijaric, TomTan.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.
Herald added a project: LLVM.
mstorsjo requested review of this revision.

The function already has a cleanup scope that calls the same whenever the function is exited. When reading the code, seeing that this return codepath has an explicit call while other return paths lack it is confusing.

In the hypothetical case of a function having a prologue that set the HasWinCFI flag in the MF, but the epilogue containing no WinCFI instructions, the HasWinCFI flag in the MF would end up reset back to false.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88636

Files:
  llvm/lib/Target/AArch64/AArch64FrameLowering.cpp


Index: llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
+++ llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
@@ -1770,8 +1770,6 @@
   if (NeedsWinCFI && HasWinCFI)
     BuildMI(MBB, MBB.getFirstTerminator(), DL, TII->get(AArch64::SEH_EpilogEnd))
         .setMIFlag(MachineInstr::FrameDestroy);
-
-  MF.setHasWinCFI(HasWinCFI);
 }
 
 /// getFrameIndexReference - Provide a base+offset reference to an FI slot for


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88636.295482.patch
Type: text/x-patch
Size: 534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201001/105e4683/attachment.bin>


More information about the llvm-commits mailing list