public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5199] Fortran: Use build_debug_expr_decl to create DEBUG_DECL_EXPRs
@ 2021-11-12 14:46 Martin Jambor
  0 siblings, 0 replies; only message in thread
From: Martin Jambor @ 2021-11-12 14:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:847f587dc478654b5139ef5bb2e228024143c512

commit r12-5199-g847f587dc478654b5139ef5bb2e228024143c512
Author: Martin Jambor <mjambor@suse.cz>
Date:   Thu Nov 11 17:17:30 2021 +0100

    Fortran: Use build_debug_expr_decl to create DEBUG_DECL_EXPRs
    
    This patch converts one more open coded construction of a
    DEBUG_EXPR_DECL to a call of build_debug_expr_decl that I missed in my
    previous patch befause it happens to be in the Fortran front-end.
    
    gcc/fortran/ChangeLog:
    
    2021-11-11  Martin Jambor  <mjambor@suse.cz>
    
            * trans-types.c (gfc_get_array_descr_info): Use build_debug_expr_decl
            instead of building DEBUG_EXPR_DECL manually.

Diff:
---
 gcc/fortran/trans-types.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 947ab5a099b..e5d36d5a58f 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -3417,10 +3417,8 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info)
   base_decl = GFC_TYPE_ARRAY_BASE_DECL (type, indirect);
   if (!base_decl)
     {
-      base_decl = make_node (DEBUG_EXPR_DECL);
-      DECL_ARTIFICIAL (base_decl) = 1;
-      TREE_TYPE (base_decl) = indirect ? build_pointer_type (ptype) : ptype;
-      SET_DECL_MODE (base_decl, TYPE_MODE (TREE_TYPE (base_decl)));
+      base_decl = build_debug_expr_decl (indirect
+					 ? build_pointer_type (ptype) : ptype);
       GFC_TYPE_ARRAY_BASE_DECL (type, indirect) = base_decl;
     }
   info->base_decl = base_decl;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-12 14:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 14:46 [gcc r12-5199] Fortran: Use build_debug_expr_decl to create DEBUG_DECL_EXPRs Martin Jambor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).