1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[ORC] Work around AIX build compiler: Replace lambda; NFC

By replacing a lambda expression with a functor class instance, this
patch works around an issue encountered on AIX where the IBM XL compiler
appears to make no progress for many hours.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D106554
This commit is contained in:
Hubert Tong 2021-07-23 00:40:54 -04:00
parent 845cd9f16b
commit 63a85da461

View File

@ -446,19 +446,30 @@ void MachOPlatform::rt_lookupSymbol(SendSymbolAddressFn SendResult,
return;
}
// Use functor class to work around XL build compiler issue on AIX.
class RtLookupNotifyComplete {
public:
RtLookupNotifyComplete(SendSymbolAddressFn &&SendResult)
: SendResult(std::move(SendResult)) {}
void operator()(Expected<SymbolMap> Result) {
if (Result) {
assert(Result->size() == 1 && "Unexpected result map count");
SendResult(ExecutorAddress(Result->begin()->second.getAddress()));
} else {
SendResult(Result.takeError());
}
}
private:
SendSymbolAddressFn SendResult;
};
// FIXME: Proper mangling.
auto MangledName = ("_" + SymbolName).str();
ES.lookup(
LookupKind::DLSym, {{JD, JITDylibLookupFlags::MatchExportedSymbolsOnly}},
SymbolLookupSet(ES.intern(MangledName)), SymbolState::Ready,
[SendResult = std::move(SendResult)](Expected<SymbolMap> Result) mutable {
if (Result) {
assert(Result->size() == 1 && "Unexpected result map count");
SendResult(ExecutorAddress(Result->begin()->second.getAddress()));
} else
SendResult(Result.takeError());
},
NoDependenciesToRegister);
RtLookupNotifyComplete(std::move(SendResult)), NoDependenciesToRegister);
}
Error MachOPlatform::bootstrapMachORuntime(JITDylib &PlatformJD) {