aboutsummaryrefslogtreecommitdiff
path: root/bolt
diff options
context:
space:
mode:
authorAmir Ayupov <aaupov@fb.com>2022-08-17 17:33:38 -0700
committerAmir Ayupov <aaupov@fb.com>2022-08-17 17:33:59 -0700
commitcdef841fe70e709fd849935ab716ab4bf3716bd6 (patch)
tree26d4ce37a11ace527dd754c3324dbf83ad8d99d8 /bolt
parentccbf28b09d605d91b6bd10e3d033168c6048beb4 (diff)
downloadllvm-cdef841fe70e709fd849935ab716ab4bf3716bd6.zip
llvm-cdef841fe70e709fd849935ab716ab4bf3716bd6.tar.gz
llvm-cdef841fe70e709fd849935ab716ab4bf3716bd6.tar.bz2
[BOLT][NFC] Simplify scanExternalRefs
Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D132013
Diffstat (limited to 'bolt')
-rw-r--r--bolt/lib/Core/BinaryFunction.cpp12
1 files changed, 4 insertions, 8 deletions
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;