Skip to content

Commit 7c5c8b2

Browse files
authored
[BOLT][NFC] Move BAT::fetchParentAddress to header (#93061)
Unbreak shared build after #91683
1 parent b586149 commit 7c5c8b2

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

bolt/include/bolt/Profile/BoltAddressTranslation.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ class BoltAddressTranslation {
107107

108108
/// If available, fetch the address of the hot part linked to the cold part
109109
/// at \p Address. Return 0 otherwise.
110-
uint64_t fetchParentAddress(uint64_t Address) const;
110+
uint64_t fetchParentAddress(uint64_t Address) const {
111+
auto Iter = ColdPartSource.find(Address);
112+
if (Iter == ColdPartSource.end())
113+
return 0;
114+
return Iter->second;
115+
}
111116

112117
/// True if the input binary has a translation table we can use to convert
113118
/// addresses when aggregating profile

bolt/lib/Profile/BoltAddressTranslation.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -547,13 +547,6 @@ BoltAddressTranslation::getFallthroughsInTrace(uint64_t FuncAddress,
547547
return Res;
548548
}
549549

550-
uint64_t BoltAddressTranslation::fetchParentAddress(uint64_t Address) const {
551-
auto Iter = ColdPartSource.find(Address);
552-
if (Iter == ColdPartSource.end())
553-
return 0;
554-
return Iter->second;
555-
}
556-
557550
bool BoltAddressTranslation::enabledFor(
558551
llvm::object::ELFObjectFileBase *InputFile) const {
559552
for (const SectionRef &Section : InputFile->sections()) {

0 commit comments

Comments
 (0)