[Patch, fortran] [1/4] C binding access to C_PTR type: preliminary cleanups

Mikael Morin mikael.morin@sfr.fr
Sat Mar 2 16:54:00 GMT 2013


This patch contains some preliminary cleanup.
 - generate_isocbinding_symbol handles NULL symbol names just fine.
Thus, there is no need to pass explicitly the "c_ptr" or "c_funptr"
strings.
 - There is a lot of code that looks like
	if (cond)
	  {
	    foo (c_ptr);
	    bar (c_ptr);
	  }
	else
	  {
	    foo (c_funptr);
	    bar (c_funptr);
	  }

That code is changed by this patch to:
	if (cond)
	  ptr_id = c_ptr_id;
	else
	  ptr_id = c_funptr_id;
	  
	foo (ptr_id);
	bar (ptr_id);
-------------- next part --------------
2013-03-02  Mikael Morin  <mikael@gcc.gnu.org>

	* symbol.c (gen_special_c_interop_ptr, gen_cptr_param,
	generate_isocbinding_symbol): Use symbol ID explicitly.
	Pass a NULL string to generate_isocbinding_symbol.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr55574_v20-1.patch
Type: text/x-diff
Size: 5513 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130302/c8aa7a07/attachment.bin>


More information about the Fortran mailing list