More Cleanup of fortran_generic code#438
Merged
Conversation
Dump to JSON if options.debug_index. Print in Fortran wrappers, similar to how C wrappers print them. Add signature_i for Fortran interface to C function. May be different from signature_c by passing bufferify arguments. No changes to JSON since debug_index is not used in tests since it will produce lots of changes as fc-statements changes.
fortran_generic was still relying on a C wrapper being generated. The wrap_fortran=True now also generates it's own C wrappers. Shroud tries to detect when a duplicate wrapper is created for wrap_c=True and will share the wrapper. These changes no longer assume the C wrapper is available. If only scalar native types are used in fortran_generic, the original library function is wrapped for C with an interface then each fortran_generic generated function will call the same interface. The Fortran wrappers will covert the argument using the a Fortran intrinsic function. This is a special case controlled by the variable FunctionNode._fortran_generic_wrap. The intent is to avoid having duplicate C wrappers.
The one with a fortran_generic section. Check for shadow type as return value.
Not yet wrapped due to errors. Class1 *createView(const std::string& path, int type, long num_elems);
In the simplest case of only scalar native, all fortran_generic functions will call the original function. Function which have void* or rank attribute need a C wrapper for each fortran_generic to ensure the ranks match with the arguments. There are now fewer special cases when deciding how to wrap fortran_generic.
createView is overloaded and uses a void* argument. Test if it's overloaded when deciding which wrappers to create. Otherwise, two wrappers may create identical name in the effort to minimize the number of wrappers. While this solves a problem, there may still be an issue with cdesc.yaml GetScalar2 which may have a problem is its name was overloaded since it uses a void pointer which is replaced in the fortran_generic statement.
If a statement group has owner=caller a capsule argument will be added
which is intent(OUT). This capsule is used to release memory by the
user.
gfortran 13
481 | pure function c_class1_get_path(self, SHT_rv_capsule) &
| 1
Error: Argument ‘sht_rv_capsule’ of pure function ‘c_class1_get_path’ at (1)
must be INTENT(IN) or VALUE
intel 2025
error #7115: The specification-part of a PURE function must specify that all dummy arguments have explicitly declared INTENT(IN) except procedure arguments and arguments with the POINTER or VALUE attributes. [SHT_RV_CAPSULE]
pure function c_class1_get_path(self, SHT_rv_capsule) &
----------------------------------------------^
Message from github actions SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: BSD License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ********************************************************************************
Message from github actions
UserWarning: Unknown distribution option: 'test_suite'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid some special cases in
GenFunctions.generic_funcionHavefortran_genericfunctions all call the same interface for the C function using intrinsic functions to convert arguments.Or have a wrapper for each generic function and not one for the library function. Needed when +rank is different in
fortran_generic. Also deal withvoidarguments.Take into account overloaded functions when one of the also has
fortran_generic. The Fortran generic interface can not also have a function by the same name.