From cdef841fe70e709fd849935ab716ab4bf3716bd6 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Wed, 17 Aug 2022 17:33:38 -0700 Subject: [BOLT][NFC] Simplify scanExternalRefs Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D132013 --- bolt/lib/Core/BinaryFunction.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'bolt') diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp index a6411e5..7c7d581 100644 --- a/bolt/lib/Core/BinaryFunction.cpp +++ b/bolt/lib/Core/BinaryFunction.cpp @@ -1470,15 +1470,11 @@ bool BinaryFunction::scanExternalRefs() { 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; -- cgit v1.1