[BOLT][NFC] Move BAT::fetchParentAddress to header (#93061)

Unbreak shared build after
https://github.com/llvm/llvm-project/pull/91683
This commit is contained in:
Amir Ayupov
2024-05-22 09:14:10 -07:00
committed by GitHub
parent b586149475
commit 7c5c8b2f47
2 changed files with 6 additions and 8 deletions

View File

@@ -107,7 +107,12 @@ public:
/// If available, fetch the address of the hot part linked to the cold part
/// at \p Address. Return 0 otherwise.
uint64_t fetchParentAddress(uint64_t Address) const;
uint64_t fetchParentAddress(uint64_t Address) const {
auto Iter = ColdPartSource.find(Address);
if (Iter == ColdPartSource.end())
return 0;
return Iter->second;
}
/// True if the input binary has a translation table we can use to convert
/// addresses when aggregating profile

View File

@@ -547,13 +547,6 @@ BoltAddressTranslation::getFallthroughsInTrace(uint64_t FuncAddress,
return Res;
}
uint64_t BoltAddressTranslation::fetchParentAddress(uint64_t Address) const {
auto Iter = ColdPartSource.find(Address);
if (Iter == ColdPartSource.end())
return 0;
return Iter->second;
}
bool BoltAddressTranslation::enabledFor(
llvm::object::ELFObjectFileBase *InputFile) const {
for (const SectionRef &Section : InputFile->sections()) {