JITDylibState &JDS) {
ORC_RT_DEBUG(printdbg("Registering Objective-C / Swift metadata.\n"));
+ std::vector<char *> RegObjBases;
+ JDS.ObjCRuntimeRegistrationObjects.processNewSections(
+ [&](span<char> RegObj) { RegObjBases.push_back(RegObj.data()); });
+
+ if (RegObjBases.empty())
+ return Error::success();
+
if (!_objc_map_images || !_objc_load_image)
return make_error<StringError>(
"Could not register Objective-C / Swift metadata: _objc_map_images / "
"_objc_load_image not found");
- std::vector<char *> RegObjBases;
- JDS.ObjCRuntimeRegistrationObjects.processNewSections(
- [&](span<char> RegObj) { RegObjBases.push_back(RegObj.data()); });
-
std::vector<char *> Paths;
Paths.resize(RegObjBases.size());
_objc_map_images(RegObjBases.size(), Paths.data(),