[Openmp-commits] [openmp] r304601 - [OpenMP] libomptarget: eliminate compiler warnings at build
George Rokos via Openmp-commits
openmp-commits at lists.llvm.org
Fri Jun 2 15:41:35 PDT 2017
Author: grokos
Date: Fri Jun 2 17:41:35 2017
New Revision: 304601
URL: http://llvm.org/viewvc/llvm-project?rev=304601&view=rev
Log:
[OpenMP] libomptarget: eliminate compiler warnings at build
Thanks to Sergey Dmitriev for submitting the patch.
Differential Revision: https://reviews.llvm.org/D33851
Modified:
openmp/trunk/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp
openmp/trunk/libomptarget/src/omptarget.cpp
Modified: openmp/trunk/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp?rev=304601&r1=304600&r2=304601&view=diff
==============================================================================
--- openmp/trunk/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp (original)
+++ openmp/trunk/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp Fri Jun 2 17:41:35 2017
@@ -301,7 +301,9 @@ int32_t __tgt_rtl_run_target_team_region
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;
}
Modified: openmp/trunk/libomptarget/src/omptarget.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/src/omptarget.cpp?rev=304601&r1=304600&r2=304601&view=diff
==============================================================================
--- openmp/trunk/libomptarget/src/omptarget.cpp (original)
+++ openmp/trunk/libomptarget/src/omptarget.cpp Fri Jun 2 17:41:35 2017
@@ -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;
More information about the Openmp-commits
mailing list