[PATCH] D132013: [BOLT][NFC] Simplify scanExternalRefs

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 17:34:08 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGcdef841fe70e: [BOLT][NFC] Simplify scanExternalRefs (authored by Amir).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132013/new/

https://reviews.llvm.org/D132013

Files:
  bolt/lib/Core/BinaryFunction.cpp


Index: bolt/lib/Core/BinaryFunction.cpp
===================================================================
--- bolt/lib/Core/BinaryFunction.cpp
+++ bolt/lib/Core/BinaryFunction.cpp
@@ -1470,15 +1470,11 @@
     bool IsPCRel = false;
     bool IsBranch = false;
     if (BC.MIB->hasPCRelOperand(Instruction)) {
-      if (BC.MIB->evaluateMemOperandTarget(Instruction, TargetAddress,
-                                           AbsoluteInstrAddr, Size)) {
-        IsPCRel = true;
-      }
+      IsPCRel = BC.MIB->evaluateMemOperandTarget(Instruction, TargetAddress,
+                                                 AbsoluteInstrAddr, Size);
     } else if (BC.MIB->isCall(Instruction) || BC.MIB->isBranch(Instruction)) {
-      if (BC.MIB->evaluateBranch(Instruction, AbsoluteInstrAddr, Size,
-                                 TargetAddress)) {
-        IsBranch = true;
-      }
+      IsBranch = BC.MIB->evaluateBranch(Instruction, AbsoluteInstrAddr, Size,
+                                        TargetAddress);
     }
 
     MCSymbol *TargetSymbol = nullptr;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132013.453483.patch
Type: text/x-patch
Size: 1065 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220818/3d471843/attachment.bin>


More information about the llvm-commits mailing list