[BOLT][NFC] Simplify scanExternalRefs

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D132013
This commit is contained in:
Amir Ayupov 2022-08-17 17:33:38 -07:00
parent ccbf28b09d
commit cdef841fe7
1 changed files with 4 additions and 8 deletions

View File

@ -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;