From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19752 invoked by alias); 7 Jun 2011 09:07:09 -0000 Received: (qmail 19736 invoked by uid 22791); 7 Jun 2011 09:07:08 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from taro.utanet.at (HELO taro.utanet.at) (213.90.36.45) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Jun 2011 09:06:50 +0000 Received: from plenty.xoc.tele2net.at ([213.90.36.8]) by taro.utanet.at with esmtp (Exim 4.76) (envelope-from ) id 1QTsFM-0006Hy-5p; Tue, 07 Jun 2011 11:06:48 +0200 Received: from d91-128-23-47.cust.tele2.at ([91.128.23.47] helo=[192.168.1.18]) by plenty.xoc.tele2net.at with esmtpa (Exim 4.76) (envelope-from ) id 1QTsFM-000500-2c; Tue, 07 Jun 2011 11:06:48 +0200 Message-ID: <4DEDEB13.6030302@domob.eu> Date: Tue, 07 Jun 2011 09:07:00 -0000 From: Daniel Kraft User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Tobias Burnus CC: gcc patches , gfortran Subject: Re: [Patch, Fortran] (Coarray) Add parse support for LOCK/UNLOCK (part 1 of 2) References: <4DED493E.5030705@net-b.de> In-Reply-To: <4DED493E.5030705@net-b.de> OpenPGP: id=A3B53998 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00486.txt.bz2 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Tobias, On 06/06/11 23:40, Tobias Burnus wrote: > This patch adds incomplete parsing support for the LOCK and UNLOCK > statement. Missing part 2 is the addition of the LOCK_TYPE of the > ISO_FORTRAN_ENV. > > Build and tested on x86-64-linux. > OK for the trunk? Ok but you could consider the comments below (all not very important, though, and I'm fine if you check in just as it is). Thanks for the patch! Yours, Daniel + fputs ("lock-variable=", dumpfile); + if (c->expr1 != NULL) + show_expr (c->expr1); Why do you dump "lock-variable=" in any case, while you only print the names for the other arguments only if present? - - gfc_expr *expr1, *expr2, *expr3; + gfc_expr *expr1, *expr2, *expr3, *expr4; Just a side-remark, but this makes me wonder whether we should at some point use a union there if we keep adding more and more expressions? So that the code can be understood more easily and it is always clear what something like c->expr3 actually references? + m = gfc_match_char (','); + if (m == MATCH_YES) + continue; + + tmp = NULL; + break; Looks like a white-space / tab mismatch in the tmp = NULL line. For the same context (lock_unlock_statement function): We're repeating the same matching logic thrice for all stat-variables ... maybe I would be tempted to think about a way out; possibly using a macro. Although this may of course also make the code harder to read. I'm certainly ok with the code as it is, just a thought. (I personally don't really like duplicating code so large, although it is a very simple and clear one.) - -- http://www.pro-vegan.info/ - -- Done: Arc-Bar-Cav-Kni-Ran-Rog-Sam-Tou-Val-Wiz To go: Hea-Mon-Pri -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIVAwUBTe3rE1J+ebqjtTmYAQKkNQ/8C1UGEH3EFtsaLST+vEpU3drdgPM6XQ7v mxRbb9RXwd6MuzgF1yBJbv+aAFxvTcpUbmlm1etuNDdnJDPEhqedHbUJOU4VjP1k 4IDGRt/YHVQyff8/kmsY9w2+ls5ETOyVpGyxL9B2HcHYWs46733WivpDE2Cvt2yb b6VTsb03rvpJjRszSIH2XH3H9DB1udAQlAj0F17Lt+kcK07h7EodxbrEbUlQXrdh Caqby9e5GU0dotVJdrWPax7we6wORGgQ2rI5fufSrELE3OOo3mNrnRWtidPywnbn mM99XoR9HwHuTEFjfWgzix3js8fpqHJJWE3JECJXx5g5KIDBTN+IxruwWU/8L65O QCPEBza3h6pb5PgkLe0QnerWDVJ/BrXynHJ9UP645R21k6VamE+/zN5E8xMMNDEq beEvztTPHR6Ih5UmLk7leNBE0WLAhtJKRP1p529PBznQ5rAvtfXEuzsjNsvIZMsC AIfE4/un2HHc4oGLHrGQ4YimQEVdg3Px4js1gmI6wcuXj68cpS2R6S1zih+bTcFV +18gp6XOtGDJhrQyMO34xIGAfSLVxlIBqT/xntvT7uTYhVHtwX1Y5ih9cFZlo7kC tN13bV1x9PdUaYtUtFTHb4Tf6GhsRMksFFUPvuh0ddzpR/peVmoB+d+U+yu0TZCm A3U+CWmwv5o= =sLG0 -----END PGP SIGNATURE-----