[llvm] 490cd14 - [MC] [Win64EH] Simplify code using WinEH::Instruction::operator!=. NFC.

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 05:25:44 PDT 2022


Author: Martin Storsjö
Date: 2022-05-12T15:23:04+03:00
New Revision: 490cd14fe6ff119fa6f74832470eb29528a6f750

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

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

operator== and operator!= were added in
1308bb99e06752ab0b5175c92da31083f91af921 / D87369, but this existing
codepath wasn't updated to use them.

Also fix the indentation of the enclosed liens.

Differential Revision: https://reviews.llvm.org/D125368

Added: 
    

Modified: 
    llvm/lib/MC/MCWin64EH.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/MCWin64EH.cpp b/llvm/lib/MC/MCWin64EH.cpp
index 56ac18c3c1c9e..0aa066eba5948 100644
--- a/llvm/lib/MC/MCWin64EH.cpp
+++ b/llvm/lib/MC/MCWin64EH.cpp
@@ -532,11 +532,9 @@ FindMatchingEpilog(const std::vector<WinEH::Instruction>& EpilogInstrs,
 
     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)


        


More information about the llvm-commits mailing list