This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, Fortran, OOP] PR 59493: Cleanup of vtab generation code


Hi all,

here is a follow-up to my recent patch for PR59493, doing some cleanup
related to the generation of vtab symbols:
1) Since the function gfc_find_intrinsic_vtab, contrary to its name,
handles not only intrinsic but also derived types, I removed the
latter functionality, and instead introduced a new function
gfc_find_vtab, which handles arbitrary types and simply decides
whether to call the corresponding function for intrinsic or derived
vtabs.
2) Basically all calls to gfc_find_intrinsic_vtab are replaced by
gfc_find_vtab. This often simplifies the logic and saves additional IF
clauses to distinguish between intrinsic and derived types.
3) As a consequence, gfc_find_intrinsic_vtab is made static and loses
the gfc_ prefix.

All of this results in the code being shorter, clearer and more
error-prone. The patch is regtested on x86_64-unknown-linux-gnu. Ok
for trunk?

Cheers,
Janus



2013-12-18  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/59493
    * gfortran.h (gfc_find_intrinsic_vtab): Removed prototype.
    (gfc_find_vtab): New prototype.
    * class.c (gfc_find_intrinsic_vtab): Rename to 'find_intrinsic_vtab' and
    make static. Minor modifications.
    (gfc_find_vtab): New function.
    (gfc_class_initializer): Use new function 'gfc_find_vtab'.
    * check.c (gfc_check_move_alloc): Ditto.
    * expr.c (gfc_check_pointer_assign): Ditto.
    * interface.c (compare_actual_formal): Ditto.
    * resolve.c (resolve_allocate_expr, resolve_select_type): Ditto.
    * trans-expr.c (gfc_conv_intrinsic_to_class, gfc_trans_class_assign):
    Ditto.
    * trans-intrinsic.c (conv_intrinsic_move_alloc): Ditto.
    * trans-stmt.c (gfc_trans_allocate): Ditto.

Attachment: pr59493_cleanup.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]