[PATCH] D125368: [MC] [Win64EH] Simplify code using WinEH::Instruction::operator!=. NFC.

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 03:26:45 PDT 2022


mstorsjo created this revision.
mstorsjo added reviewers: efriedma, rnk.
Herald added a subscriber: hiraditya.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: LLVM.

operator== and operator!= were added in
1308bb99e06752ab0b5175c92da31083f91af921 <https://reviews.llvm.org/rG1308bb99e06752ab0b5175c92da31083f91af921> / D87369 <https://reviews.llvm.org/D87369>, but this existing
codepath wasn't updated to use them.

Also fix the indentation of the enclosed liens.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125368

Files:
  llvm/lib/MC/MCWin64EH.cpp


Index: llvm/lib/MC/MCWin64EH.cpp
===================================================================
--- llvm/lib/MC/MCWin64EH.cpp
+++ llvm/lib/MC/MCWin64EH.cpp
@@ -532,11 +532,9 @@
 
     bool Match = true;
     for (unsigned i = 0; i < Instrs.size(); ++i)
-      if (Instrs[i].Operation != EpilogInstrs[i].Operation ||
-          Instrs[i].Offset != EpilogInstrs[i].Offset ||
-          Instrs[i].Register != EpilogInstrs[i].Register) {
-         Match = false;
-         break;
+      if (Instrs[i] != EpilogInstrs[i]) {
+        Match = false;
+        break;
       }
 
     if (Match)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125368.428611.patch
Type: text/x-patch
Size: 591 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220511/5b5308df/attachment.bin>


More information about the llvm-commits mailing list