From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id C4497385843E for ; Wed, 15 Dec 2021 15:56:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C4497385843E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: VMvI8ZbRfpguSIkaZ60jiWX6PVtn38OFoZpdLHkbwvZSp2BFyno6jXmHdmsKi4qatwJF/zAi2v hgWxwW9x/1Odysgh6r2AGbLd+zDUPaFCVDYDj8bZaXHb821/NN/o8QOXEyotSiwGqfl0q8fmtB j7vzmSjM7O47tyi9Hq+7ytNT8/MDXMo2b9pDRy54Na/lY97Owoeae7jxaEhaZtZ0nK/lOnT3DB abNReA6LuAOkc25a+j3+ULNHlV+FQ9TR6zgLKOCg8x+wG8dWKixZW79ylGIryShO/13Ii4oPTf 0AQSvbGwWrMFgEeFOy5nwKgp X-IronPort-AV: E=Sophos;i="5.88,207,1635235200"; d="scan'208";a="69738395" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 15 Dec 2021 07:56:26 -0800 IronPort-SDR: wgP8Gv6i5ksAj57JUkg7nMO1Z0+EOfz1etSMwJkM4qv4mDFIi2e7NdTXy2lbmFpv1HSSqVwdvE pXMcSiBOrJR+r2Lje3iKwCAxPH932pycd4cKsLW7PBt/iSlc4C1eaQTqW41dhaS8Bsftz3nav7 oKUFpfURn1Zom1QRdKB0qQl38U5Jp59bRWyrbAT5s9nASf8xt1d7BgnS3yV1nKL39UzmsikeFC SgPx/s+8l+e3eZKuCiMIjYdzOoZfjz2jlwbM/C55p6vC7Ei97ayOes4ad6ARtng2KqI6q16K7+ Xgg= From: Frederik Harwath To: CC: , Subject: [PATCH 23/40] Add function for printing a single OMP_CLAUSE Date: Wed, 15 Dec 2021 16:54:30 +0100 Message-ID: <20211215155447.19379-24-frederik@codesourcery.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211215155447.19379-1-frederik@codesourcery.com> References: <20211215155447.19379-1-frederik@codesourcery.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-07.mgc.mentorg.com (139.181.222.7) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2021 15:56:29 -0000 Commit 89f4f339130c ("For 'OMP_CLAUSE' in 'dump_generic_node', dump the whole OMP clause chain") changed the dumping behavior for OMP_CLAUSEs. The old behavior is required for a follow-up commit ("openacc: Add data optimization pass") that optimizes single OMP_CLAUSEs. gcc/ChangeLog: * tree-pretty-print.c (print_omp_clause_to_str): Add new function. * tree-pretty-print.h (print_omp_clause_to_str): Add declaration. --- gcc/tree-pretty-print.c | 11 +++++++++++ gcc/tree-pretty-print.h | 1 + 2 files changed, 12 insertions(+) diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 275dc7d8af73..e85370cfe722 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -1360,6 +1360,17 @@ dump_omp_clause (pretty_printer *pp, tree clause, in= t spc, dump_flags_t flags) } } +/* Print the single clause at the top of the clause chain C to a string an= d + return it. Note that print_generic_expr_to_str prints the whole clause = chain + instead. The caller must free the returned memory. */ + +char * +print_omp_clause_to_str (tree c) +{ + pretty_printer pp; + dump_omp_clause (&pp, c, 0, TDF_VOPS|TDF_MEMSYMS); + return xstrdup (pp_formatted_text (&pp)); +} /* Dump chain of OMP clauses. diff --git a/gcc/tree-pretty-print.h b/gcc/tree-pretty-print.h index dacd256302b2..f9ff0ee1ce0b 100644 --- a/gcc/tree-pretty-print.h +++ b/gcc/tree-pretty-print.h @@ -41,6 +41,7 @@ extern void print_generic_expr (FILE *, tree, dump_flags_= t =3D TDF_NONE); extern char *print_generic_expr_to_str (tree); extern void dump_omp_clauses (pretty_printer *, tree, int, dump_flags_t, bool =3D true); +extern char *print_omp_clause_to_str (tree); extern void dump_omp_atomic_memory_order (pretty_printer *, enum omp_memory_order); extern void dump_omp_loop_non_rect_expr (pretty_printer *, tree, int, -- 2.33.0 ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=DFe 201, 8= 0634 M=FCnchen; Gesellschaft mit beschr=E4nkter Haftung; Gesch=E4ftsf=FChre= r: Thomas Heurung, Frank Th=FCrauf; Sitz der Gesellschaft: M=FCnchen; Regis= tergericht M=FCnchen, HRB 106955