From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B4A6C433E0 for ; Fri, 5 Jun 2020 13:44:54 +0000 (UTC) Received: from isis.lip6.fr (isis.lip6.fr [132.227.60.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B731206E6 for ; Fri, 5 Jun 2020 13:44:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fXh5W24x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B731206E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=cocci-bounces@systeme.lip6.fr Received: from systeme.lip6.fr (systeme.lip6.fr [132.227.104.7]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 055DipOt029887; Fri, 5 Jun 2020 15:44:51 +0200 (CEST) Received: from systeme.lip6.fr (systeme.lip6.fr [127.0.0.1]) by systeme.lip6.fr (Postfix) with ESMTP id 193AD7567; Fri, 5 Jun 2020 15:44:51 +0200 (CEST) Received: from isis.lip6.fr (isis.lip6.fr [132.227.60.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by systeme.lip6.fr (Postfix) with ESMTPS id AB7963F9A for ; Fri, 5 Jun 2020 15:44:49 +0200 (CEST) Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20:0:0:0:1044]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTPS id 055DimeW001244 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=OK) for ; Fri, 5 Jun 2020 15:44:49 +0200 (CEST) Received: by mail-pj1-x1044.google.com with SMTP id nm22so2604584pjb.4 for ; Fri, 05 Jun 2020 06:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ehxusg0wFvuEPrRhtjKOUQLdOEx3QD4aVXqqLyIFDM8=; b=fXh5W24xVbDFtDPiVvviSlkBRaf+Sv1cHqvakHXrRE6KZFBM0s6WtLg+kTEXG4Pw8A /Q375nS9AfsftgD0X8Rg6upI1Yx9e28HMsvFbSNjqStN/bPYQnKGK98u0GZb9XaPHzB/ 2ep5MKz5Ek0yQCbx8/pOqqq8pLEEyd8nDRlymGDYMyOLthfzRztmKpzjznrg8zJUXk8f lJ7fY1pM2x5tGCyP8CleRYibABADqpNcvfUhlhRFPYzZr0TStZmggKlTwudO8/JbtfWF 0+mEyV6OWRUhu6rjfKjZFahh+nFxleInWSBSxa2vUZymPEPLKuIWBfU12v9UnFKI98Xt wm3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ehxusg0wFvuEPrRhtjKOUQLdOEx3QD4aVXqqLyIFDM8=; b=GFpThE2clv06nz0xuNA4RIBi78inBgjYkH6WUuzNiNaMSXs4VoopNpnX/GAe66ULo3 BcVTrPGYcLdiYy74yAbtwV7tPj9fE/us452Zvtminnyr/HxDZyNm6eLTjYUEdGmbqzMn sV66UyPUi8NurEMB+kX759o5nSDthy7JYak2/S2qYFiR0ng+6U2KwacAOTpz0DHNP0Hm mmLRTl29wPzYOOsuHpTIp40UdlbBauEo+0roOCLMzjCt47QO29RajpNVGbmArA2ulnbI fzLAO+nvR2qmTd3x4+NfgyWPNXihRbOJ6GNfbPOU5p75Rc5JGDuUFhB5b54LN7mN2hfa 6oAg== X-Gm-Message-State: AOAM531VN+pI6F6FQyodVN6bSLhgPysmX6oIwstbM8qW08rI8tY+MjyS WYXLZLdpagFhx7jWg5wGMSIeiT+ETq0= X-Google-Smtp-Source: ABdhPJxcaxdE16027mZpA3O8NkW5nAOngcRZ85miMBVLUqGFQlYwHifv4G36TqtC45TCLTGrIgHZGQ== X-Received: by 2002:a17:902:684e:: with SMTP id f14mr10147871pln.328.1591364687326; Fri, 05 Jun 2020 06:44:47 -0700 (PDT) Received: from localhost.localdomain ([1.38.221.125]) by smtp.gmail.com with ESMTPSA id w186sm7861353pff.83.2020.06.05.06.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 06:44:46 -0700 (PDT) From: Jaskaran Singh To: cocci@systeme.lip6.fr Date: Fri, 5 Jun 2020 19:13:19 +0530 Message-Id: <20200605134322.15307-12-jaskaransingh7654321@gmail.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200605134322.15307-1-jaskaransingh7654321@gmail.com> References: <20200605134322.15307-1-jaskaransingh7654321@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, Sender e-mail whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Fri, 05 Jun 2020 15:44:51 +0200 (CEST) X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [IPv6:2001:660:3302:283c:0:0:0:2]); Fri, 05 Jun 2020 15:44:49 +0200 (CEST) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 X-Scanned-By: MIMEDefang 2.78 Cc: linux-kernel-mentees@lists.linuxfoundation.org Subject: [Cocci] [PATCH v4 11/14] parsing_c: parser: Add MacroDecl end attributes production X-BeenThere: cocci@systeme.lip6.fr X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: cocci-bounces@systeme.lip6.fr Errors-To: cocci-bounces@systeme.lip6.fr Add a production for macro declaration end attributes. This parses the following C code from Linux v5.6-rc7: arch/x86/kernel/nmi_selftest.c: static DECLARE_BITMAP(nmi_ipi_mask, NR_CPUS) __initdata; Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parsing_c/parser_c.mly b/parsing_c/parser_c.mly index 3412c34e..71e58e5b 100644 --- a/parsing_c/parser_c.mly +++ b/parsing_c/parser_c.mly @@ -1576,15 +1576,16 @@ decl2: } /*(* cppext: *)*/ - | storage_const_opt TMacroDecl TOPar argument_list TCPar TPtVirg + | storage_const_opt TMacroDecl TOPar argument_list TCPar end_attributes_opt + TPtVirg { function _ -> match $1 with Some (sto,stoii) -> MacroDecl - ((sto, fst $2, $4, true), (snd $2::$3::$5::$6::fakeInfo()::stoii)) + ((sto, fst $2, $4, true), (snd $2::$3::$5::$7::fakeInfo()::stoii)) | None -> MacroDecl - ((NoSto, fst $2, $4, true), [snd $2;$3;$5;$6;fakeInfo()]) } + ((NoSto, fst $2, $4, true), [snd $2;$3;$5;$7;fakeInfo()]) } | storage_const_opt TMacroDecl TOPar argument_list TCPar teq initialize TPtVirg -- 2.21.1 _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BFDAC433DF for ; Fri, 5 Jun 2020 13:44:50 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 325E12075B for ; Fri, 5 Jun 2020 13:44:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fXh5W24x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 325E12075B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DB566203E3; Fri, 5 Jun 2020 13:44:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S1JEOgg99lNy; Fri, 5 Jun 2020 13:44:49 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 441FF2038B; Fri, 5 Jun 2020 13:44:49 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 40688C0888; Fri, 5 Jun 2020 13:44:49 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 158F3C016E for ; Fri, 5 Jun 2020 13:44:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 125598714B for ; Fri, 5 Jun 2020 13:44:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V_QL_ZJWmXry for ; Fri, 5 Jun 2020 13:44:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by fraxinus.osuosl.org (Postfix) with ESMTPS id C05D486BA3 for ; Fri, 5 Jun 2020 13:44:47 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id nm22so2604577pjb.4 for ; Fri, 05 Jun 2020 06:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ehxusg0wFvuEPrRhtjKOUQLdOEx3QD4aVXqqLyIFDM8=; b=fXh5W24xVbDFtDPiVvviSlkBRaf+Sv1cHqvakHXrRE6KZFBM0s6WtLg+kTEXG4Pw8A /Q375nS9AfsftgD0X8Rg6upI1Yx9e28HMsvFbSNjqStN/bPYQnKGK98u0GZb9XaPHzB/ 2ep5MKz5Ek0yQCbx8/pOqqq8pLEEyd8nDRlymGDYMyOLthfzRztmKpzjznrg8zJUXk8f lJ7fY1pM2x5tGCyP8CleRYibABADqpNcvfUhlhRFPYzZr0TStZmggKlTwudO8/JbtfWF 0+mEyV6OWRUhu6rjfKjZFahh+nFxleInWSBSxa2vUZymPEPLKuIWBfU12v9UnFKI98Xt wm3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ehxusg0wFvuEPrRhtjKOUQLdOEx3QD4aVXqqLyIFDM8=; b=lJaB3ua1aS3eAeP7KwIz4OJNQ/xu2YfJH3WxdmKKvwCnI5BTesMWqI+N1G9rlNvDzF H/nOi4NsepFTMBc9IsO1c42i12VyBV4HIqwfnY6iYB35wZbPlMsPNZIh1h/4cECGRtYr k0vHLgn7rM7DPYq4OMu0SfjHfslwXQrxirCcP5wNZZm5MeXQd3mh6CVMLzf8OKq6gi/U ooR65uZiKHuBNZZccGln3CdLc/ZSeh5Hb31iDeMEILmnnV9zIwzq0dBurh9TF4HesYsJ aoZJ8V6tQjwzK32lN/g5GVtNWytWYTiPtoxbrC6EsaksZBHHDmheoO1jF+EFSPGEbf5s 2ayg== X-Gm-Message-State: AOAM532q/3BPQZQ9v85l4HIYVwV2j/fr5sF65EB/u0dOV2OdUON0a3R9 kgt0pUl+oNNWiFJ8hjawsKI= X-Google-Smtp-Source: ABdhPJxcaxdE16027mZpA3O8NkW5nAOngcRZ85miMBVLUqGFQlYwHifv4G36TqtC45TCLTGrIgHZGQ== X-Received: by 2002:a17:902:684e:: with SMTP id f14mr10147871pln.328.1591364687326; Fri, 05 Jun 2020 06:44:47 -0700 (PDT) Received: from localhost.localdomain ([1.38.221.125]) by smtp.gmail.com with ESMTPSA id w186sm7861353pff.83.2020.06.05.06.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 06:44:46 -0700 (PDT) From: Jaskaran Singh To: cocci@systeme.lip6.fr Date: Fri, 5 Jun 2020 19:13:19 +0530 Message-Id: <20200605134322.15307-12-jaskaransingh7654321@gmail.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200605134322.15307-1-jaskaransingh7654321@gmail.com> References: <20200605134322.15307-1-jaskaransingh7654321@gmail.com> MIME-Version: 1.0 Cc: julia.lawall@inria.fr, jaskaransingh7654321@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org Subject: [Linux-kernel-mentees] [PATCH v4 11/14] parsing_c: parser: Add MacroDecl end attributes production X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" Add a production for macro declaration end attributes. This parses the following C code from Linux v5.6-rc7: arch/x86/kernel/nmi_selftest.c: static DECLARE_BITMAP(nmi_ipi_mask, NR_CPUS) __initdata; Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parsing_c/parser_c.mly b/parsing_c/parser_c.mly index 3412c34e..71e58e5b 100644 --- a/parsing_c/parser_c.mly +++ b/parsing_c/parser_c.mly @@ -1576,15 +1576,16 @@ decl2: } /*(* cppext: *)*/ - | storage_const_opt TMacroDecl TOPar argument_list TCPar TPtVirg + | storage_const_opt TMacroDecl TOPar argument_list TCPar end_attributes_opt + TPtVirg { function _ -> match $1 with Some (sto,stoii) -> MacroDecl - ((sto, fst $2, $4, true), (snd $2::$3::$5::$6::fakeInfo()::stoii)) + ((sto, fst $2, $4, true), (snd $2::$3::$5::$7::fakeInfo()::stoii)) | None -> MacroDecl - ((NoSto, fst $2, $4, true), [snd $2;$3;$5;$6;fakeInfo()]) } + ((NoSto, fst $2, $4, true), [snd $2;$3;$5;$7;fakeInfo()]) } | storage_const_opt TMacroDecl TOPar argument_list TCPar teq initialize TPtVirg -- 2.21.1 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees