[flang-commits] [flang] [flang] Consider bind(c) when lowering calls to intrinsic module procedures (PR #70386)

Razvan Lupusoru via flang-commits flang-commits at lists.llvm.org
Fri Oct 27 07:08:58 PDT 2023


razvanlupusoru wrote:

> Thanks, the patch looks fine to me.
> 
> Users might also use the `omp_lib.f90` from the OpenMP runtime. For some reason, these functions are not marked `bind(C)` there as well.
> 
> https://github.com/llvm/llvm-project/blob/4d4f603793aa134d1d04b60782fac0e6b0ed2172/openmp/runtime/src/include/omp_lib.f90.var#L524
> 
> I have asked a question in the patch that introduced this change. https://reviews.llvm.org/D55148. Maybe you can update there as well.

Thanks Kiran for reviewing! I was considering adding you as a reviewer initially - but at first it seemed very little related to omp since I was just removing the hardcoded line to omp_lib. But either way, I appreciate you took the time to look!

Second, I do see that the module there is missing bind(c) also. I have looked at that module and I see several differences - not just this case. For example, in the F18 module, `omp_logical_kind = 1` and in that one `omp_logical_kind = 4`. My point is that there are several differences that likely need consolidated at some point - and I am not the right person to start doing that.

The fact that the module there is missing bind(c) is not an issue as the one in the F18 modules directory since if it is an user module, it won't be considered as intrinsic. But for anything that is intrinsic, we need to specify some implementation - otherwise we cannot distinguish between what remains to be implemented and what is implemented externally.

https://github.com/llvm/llvm-project/pull/70386


More information about the flang-commits mailing list