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,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 BA7BCC54E4B for ; Mon, 11 May 2020 10:08:38 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 8FF9D20720 for ; Mon, 11 May 2020 10:08:38 +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="Tix/5NW9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FF9D20720 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 hemlock.osuosl.org (Postfix) with ESMTP id 6FBA4888C2; Mon, 11 May 2020 10:08:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jOqLR+ftTyxY; Mon, 11 May 2020 10:08:38 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 00EC0888B9; Mon, 11 May 2020 10:08:38 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DCA2DC088F; Mon, 11 May 2020 10:08:37 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 77E11C016F for ; Mon, 11 May 2020 10:08:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 70A1524763 for ; Mon, 11 May 2020 10:08:36 +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 DHstMD3vJrKT for ; Mon, 11 May 2020 10:08:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by silver.osuosl.org (Postfix) with ESMTPS id E5C602050E for ; Mon, 11 May 2020 10:08:35 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id t9so7647726pjw.0 for ; Mon, 11 May 2020 03:08:35 -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=5ydkvxIkepDiYoSKkPkEhluyN99PFKVNQGZApVx5OTU=; b=Tix/5NW9TtYMKbcVlhqdkMS0wLaYQNd4PtMM+YZ9KswJOuujTEOve+1Y+Gk0CE+Qwk jDbsHPE74fZym02/jwqD84uyk/ltgc16AsGKoxdHhqCOUzlkoXjdxLS4h5/6LkBo63Ux I1PrZLcyky64F5JUw9ZTupaN7h+/+HJ37gdBx9Mrh1ofXW3QKCRwvS4ZI4gS4ksthjd6 nYFmoTO2YDlIhYMeJskd32KyEbu3XvBznRUtu3t07hwkVo9wMclML3jRZm0/4SzMFIMy zd0ci/Q52Gva+Cwsn8wJB4mwigk5TU44GAPAvHCChZJ0zF/f+rJzcgPUFlHUDs7zTv4T w8iw== 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=5ydkvxIkepDiYoSKkPkEhluyN99PFKVNQGZApVx5OTU=; b=UUTUIcN76Wn1kGXoD0kGmZMVJBb6TOSschz34cIHDrTcxpnL2P6THWQLh3XwPi7Ezu B0VOchRnASLgWz2TxVvYPyvaxa0jUTv2oVy8BvbubpvItyeCdG5lkq6j+wMs9Iliwv0e m7N3G+Xh8YDYPAOQLvgfBTxhD0lL5gfHmadDwddpU2mZjduI1l9BD77LwWB7BWVI7bfS 11ng0EsC4zP3hSIcyVRZmpnZquDAJ9YLFztNIqUisLCYQSUZJgVhlKSQ9pq+ilz7aqDt zH7UFaxi8DfoQbYVpXw6GepFQ2QainIrtbNx1My5si3DuRQEeDYhuVOqt8AUtXNHQyQE y7dg== X-Gm-Message-State: AGi0PuYUYHviH8jfywVSTn0RxYJ5uS89bxYPq2H6mEsSzz97PRTUCQ3R xeJ3hZBSWBpgyxeImiEh34M= X-Google-Smtp-Source: APiQypK6T0n3C+2oibpAfmDHL6GfcRjGUBElnKjJjbI2Wo2f2KeuKkhf8+GgT5VGk+D0xh/fxrcGew== X-Received: by 2002:a17:902:5a8e:: with SMTP id r14mr14610306pli.81.1589191715445; Mon, 11 May 2020 03:08:35 -0700 (PDT) Received: from localhost.localdomain ([2405:204:382:66db:4729:1ab8:2139:8945]) by smtp.gmail.com with ESMTPSA id o99sm9772994pjo.8.2020.05.11.03.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 03:08:35 -0700 (PDT) From: Jaskaran Singh To: cocci@systeme.lip6.fr Date: Mon, 11 May 2020 15:36:58 +0530 Message-Id: <20200511100715.19819-16-jaskaransingh7654321@gmail.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200511100715.19819-1-jaskaransingh7654321@gmail.com> References: <20200511100715.19819-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 v2 15/32] parsing_cocci: visitor_ast: Visit cast attributes 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" Cast attributes are added to the SmPL AST. Visit these attributes in the SmPL AST visitor. Signed-off-by: Jaskaran Singh --- parsing_cocci/visitor_ast.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/parsing_cocci/visitor_ast.ml b/parsing_cocci/visitor_ast.ml index 8e530114..644bcd5d 100644 --- a/parsing_cocci/visitor_ast.ml +++ b/parsing_cocci/visitor_ast.ml @@ -198,12 +198,13 @@ let combiner bind option_default let lar = string_mcode ar in let lfield = ident field in multibind [lexp; lar; lfield] - | Ast.Cast(lp,ty,rp,exp) -> + | Ast.Cast(lp,ty,attr,rp,exp) -> let llp = string_mcode lp in let lty = fullType ty in + let lattr = multibind (List.map string_mcode attr) in let lrp = string_mcode rp in let lexp = expression exp in - multibind [llp; lty; lrp; lexp] + multibind [llp; lty; lattr; lrp; lexp] | Ast.SizeOfExpr(szf,exp) -> let lszf = string_mcode szf in let lexp = expression exp in @@ -1184,12 +1185,13 @@ let rebuilder let lar = string_mcode ar in let lfield = ident field in Ast.RecordPtAccess(lexp, lar, lfield) - | Ast.Cast(lp,ty,rp,exp) -> + | Ast.Cast(lp,ty,attr,rp,exp) -> let llp = string_mcode lp in let lty = fullType ty in + let lattr = List.map string_mcode attr in let lrp = string_mcode rp in let lexp = expression exp in - Ast.Cast(llp, lty, lrp, lexp) + Ast.Cast(llp, lty, lattr, lrp, lexp) | Ast.SizeOfExpr(szf,exp) -> let lszf = string_mcode szf in let lexp = expression exp in -- 2.21.1 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees