[OpenMP] libomptarget: eliminate compiler warnings at build

Thanks to Sergey Dmitriev for submitting the patch.

Differential Revision: https://reviews.llvm.org/D33851

llvm-svn: 304601
This commit is contained in:
George Rokos 2017-06-02 22:41:35 +00:00
parent 5fdc75aea1
commit 0e86bfb5bb
2 changed files with 13 additions and 11 deletions

View File

@ -301,7 +301,9 @@ int32_t __tgt_rtl_run_target_team_region(int32_t device_id, void *tgt_entry_ptr,
DP("Running entry point at " DPxMOD "...\n", DPxPTR(tgt_entry_ptr));
ffi_call(&cif, FFI_FN(tgt_entry_ptr), NULL, &args[0]);
void (*entry)(void);
*((void**) &entry) = tgt_entry_ptr;
ffi_call(&cif, entry, NULL, &args[0]);
return OFFLOAD_SUCCESS;
}

View File

@ -314,34 +314,34 @@ void RTLsTy::LoadRTLs() {
R.RTLName = Name;
#endif
if (!(R.is_valid_binary = (RTLInfoTy::is_valid_binary_ty *)dlsym(
if (!(*((void**) &R.is_valid_binary) = dlsym(
dynlib_handle, "__tgt_rtl_is_valid_binary")))
continue;
if (!(R.number_of_devices = (RTLInfoTy::number_of_devices_ty *)dlsym(
if (!(*((void**) &R.number_of_devices) = dlsym(
dynlib_handle, "__tgt_rtl_number_of_devices")))
continue;
if (!(R.init_device = (RTLInfoTy::init_device_ty *)dlsym(
if (!(*((void**) &R.init_device) = dlsym(
dynlib_handle, "__tgt_rtl_init_device")))
continue;
if (!(R.load_binary = (RTLInfoTy::load_binary_ty *)dlsym(
if (!(*((void**) &R.load_binary) = dlsym(
dynlib_handle, "__tgt_rtl_load_binary")))
continue;
if (!(R.data_alloc = (RTLInfoTy::data_alloc_ty *)dlsym(
if (!(*((void**) &R.data_alloc) = dlsym(
dynlib_handle, "__tgt_rtl_data_alloc")))
continue;
if (!(R.data_submit = (RTLInfoTy::data_submit_ty *)dlsym(
if (!(*((void**) &R.data_submit) = dlsym(
dynlib_handle, "__tgt_rtl_data_submit")))
continue;
if (!(R.data_retrieve = (RTLInfoTy::data_retrieve_ty *)dlsym(
if (!(*((void**) &R.data_retrieve) = dlsym(
dynlib_handle, "__tgt_rtl_data_retrieve")))
continue;
if (!(R.data_delete = (RTLInfoTy::data_delete_ty *)dlsym(
if (!(*((void**) &R.data_delete) = dlsym(
dynlib_handle, "__tgt_rtl_data_delete")))
continue;
if (!(R.run_region = (RTLInfoTy::run_region_ty *)dlsym(
if (!(*((void**) &R.run_region) = dlsym(
dynlib_handle, "__tgt_rtl_run_target_region")))
continue;
if (!(R.run_team_region = (RTLInfoTy::run_team_region_ty *)dlsym(
if (!(*((void**) &R.run_team_region) = dlsym(
dynlib_handle, "__tgt_rtl_run_target_team_region")))
continue;