mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-25 13:05:04 +00:00

This is an enhancement for the locate module callback. https://discourse.llvm.org/t/rfc-python-callback-for-target-get-module/71580/6 On Android remote platform, module UUID is resolved by Platform::GetRemoteSharedModule. Which means the current Target::CallLocateModuleCallbackIfSet() call undesirably is not able to pass the module UUID to the locate module callback. This diff moves the CallLocateModuleCallbackIfSet() implementation from Target to Platform to allows both Target and Platform can call it. One is from the current Target call site, and second is from Platform after resolving the module UUID. As the result of this change, the locate module callback may be called twice for a same module on remote platforms. And it should be ok. - First, without UUID. - The locate module callback is allowed to return an error if the callback requires UUID. - Second, with UUID, if the first callback call did not return a module. Differential Revision: https://reviews.llvm.org/D156066