Skip to content

Commit 33e100e

Browse files
committed
fix bug cause test failures with build
1 parent ecfcf56 commit 33e100e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/tools/llvm-objdump/llvm-objdump.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,8 @@ collectLocalBranchTargets(ArrayRef<uint8_t> Bytes, MCInstrAnalysis *MIA,
15141514
if (Disassembled) {
15151515
uint64_t Target;
15161516
bool BranchTargetKnown = MIA->evaluateBranch(Inst, Index, Size, Target);
1517-
if (BranchTargetKnown && (Target >= Start && Target < End)) {
1517+
if (BranchTargetKnown && (Target >= Start && Target < End) &&
1518+
!Labels.count(Target)) {
15181519
// On PowerPC and AIX, a function call is encoded as a branch to 0.
15191520
// On other PowerPC platforms (ELF), a function call is encoded as
15201521
// a branch to self. Do not add a label for these cases.
@@ -2322,9 +2323,8 @@ disassembleObject(ObjectFile &Obj, const ObjectFile &DbgObj,
23222323
if (Disassembled && DT->InstrAnalysis) {
23232324
llvm::raw_ostream *TargetOS = &FOS;
23242325
uint64_t Target;
2325-
bool PrintTarget = DT->InstrAnalysis->evaluateBranch(Inst, SectionAddr + Index, Size, Target);
2326-
if (DT->SubtargetInfo->getTargetTriple().isRISCV())
2327-
PrintTarget = DT->InstrAnalysis->evaluateInstruction(Inst, SectionAddr + Index, Size, Target);
2326+
bool PrintTarget = DT->InstrAnalysis->evaluateBranch(Inst, SectionAddr + Index, Size, Target) ||
2327+
DT->InstrAnalysis->evaluateInstruction(Inst, SectionAddr + Index, Size, Target);
23282328
if (!PrintTarget) {
23292329
if (std::optional<uint64_t> MaybeTarget =
23302330
DT->InstrAnalysis->evaluateMemoryOperandAddress(

0 commit comments

Comments
 (0)