Skip to content

Commit

Permalink
[BOLT] Fix logs with no hex convension (llvm#112650)
Browse files Browse the repository at this point in the history
Add `utohexstr` to ensure that offsets/addresses are correctly formatted
as hexadecimal values.
  • Loading branch information
linsinan1995 authored Oct 18, 2024
1 parent 69a798a commit c3bbc3a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bolt/include/bolt/Core/DIEBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class DIEBuilder {

BC.errs()
<< "BOLT-ERROR: unable to find TypeUnit for Type Unit at offset 0x"
<< DU.getOffset() << "\n";
<< Twine::utohexstr(DU.getOffset()) << "\n";
return nullptr;
}

Expand Down
4 changes: 2 additions & 2 deletions bolt/lib/Core/BinaryContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,8 +1294,8 @@ bool BinaryContext::handleAArch64Veneer(uint64_t Address, bool MatchOnly) {
Veneer->getOrCreateLocalLabel(Address);
Veneer->setMaxSize(TotalSize);
Veneer->updateState(BinaryFunction::State::Disassembled);
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: handling veneer function at 0x" << Address
<< "\n");
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: handling veneer function at 0x"
<< Twine::utohexstr(Address) << "\n");
return true;
};

Expand Down
2 changes: 1 addition & 1 deletion bolt/lib/Rewrite/DWARFRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ void DWARFRewriter::updateDWARFObjectAddressRanges(
Die.getTag() == dwarf::DW_TAG_compile_unit)) {
if (opts::Verbosity >= 1)
errs() << "BOLT-WARNING: cannot update ranges for DIE in Unit offset 0x"
<< Unit.getOffset() << '\n';
<< Twine::utohexstr(Unit.getOffset()) << '\n';
}
}

Expand Down

0 comments on commit c3bbc3a

Please sign in to comment.