From patchwork Sun Mar 19 01:42:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 9632381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 41BA5602D7 for ; Sun, 19 Mar 2017 01:42:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33B4228306 for ; Sun, 19 Mar 2017 01:42:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 289AD28338; Sun, 19 Mar 2017 01:42:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C83E8282E8 for ; Sun, 19 Mar 2017 01:42:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751189AbdCSBmr (ORCPT ); Sat, 18 Mar 2017 21:42:47 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34995 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751380AbdCSBmq (ORCPT ); Sat, 18 Mar 2017 21:42:46 -0400 Received: by mail-wm0-f67.google.com with SMTP id z133so8937079wmb.2 for ; Sat, 18 Mar 2017 18:42:45 -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; bh=IcQPXoP5xZOB+leuYK9kB1oMtdbzg9qrLhxQk67MSXw=; b=g0sXq/1FGi2201U8Sve1ZbQFSQXxWTm8pVy5s1diEgqxfGOjjECHCTGRqgc2NWSYu0 E0XTI3NRoLsNRH/gfjCDATiQmYRNP4CpjDscy8+vhCAraY4DT5LQf5ukxcW71sN+fI8D m2hGzOv1I026Hy27McNwZVhZag5UKDy1jiq78x8Ye3yDCA82GKy8C6jgmoRY7W/pKHvc ob+DB6cz2gvcpPFbc8xEdZFDD8pOY8sGgAqVRAhgdTrotXXSLQ6LArQtGw6oRYZb28G9 VUmTxaehs5Y/z2aWniMtxxfqLT6txXh4uAnEox/rEDyHygGKoLcCRStAnSQKf8upRtcm YjLQ== 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; bh=IcQPXoP5xZOB+leuYK9kB1oMtdbzg9qrLhxQk67MSXw=; b=WYkh5/qOlGLLuOZQikbn28e0U7HS+YxI+DEWVvH/Nawo7N5Ovcwge6gxYEZuc85ZDv 1o7Q1+YOeUtIEvyYKbZXPREPGmBbmw2fX/10DLq+/9rM8aCA9+XdRLW8zuc0z5YwtgZS x03s/DM3Dy/SRuYxeaXyty7bdOU1XWVfdQnAtk8G/CZpLlwxGklQmGLmwrhTZe6Nfxrb pRbgbicm9wuC79jvGOc+sJBBeX552NBfHDw6zZP3TF5mQNmEa3xJvdSoMvYDQ0XraOuu XgvnsJ380f45zBQrrKyYgY+kwQyOlU04W5rdkIHwaAQwvrdd2CZ91RrZ2I2zFZAl13uR 8hmQ== X-Gm-Message-State: AFeK/H2ufUKEEV/RlGPX2Ny4nts03xi2D8oXg4nmIIyd0uQES6itP+NAnjssA3P6UdcMlw== X-Received: by 10.28.18.73 with SMTP id 70mr4096500wms.41.1489887764551; Sat, 18 Mar 2017 18:42:44 -0700 (PDT) Received: from localhost.localdomain (83.254-65-87.adsl-dyn.isp.belgacom.be. [87.65.254.83]) by smtp.gmail.com with ESMTPSA id m139sm10814099wma.2.2017.03.18.18.42.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Mar 2017 18:42:43 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Christopher Li , Dibyendu Majumdar , Luc Van Oostenryck Subject: [PATCH v3 07/30] llvm: remove unneeded 'generation' Date: Sun, 19 Mar 2017 02:42:04 +0100 Message-Id: <20170319014227.8833-8-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170319014227.8833-1-luc.vanoostenryck@gmail.com> References: <20170319014227.8833-1-luc.vanoostenryck@gmail.com> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's not needed here since there is no recursive access to BBs. Signed-off-by: Luc Van Oostenryck --- sparse-llvm.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sparse-llvm.c b/sparse-llvm.c index 9b702863d..f41fbe6e3 100644 --- a/sparse-llvm.c +++ b/sparse-llvm.c @@ -911,12 +911,10 @@ static void output_insn(struct function *fn, struct instruction *insn) } } -static void output_bb(struct function *fn, struct basic_block *bb, unsigned long generation) +static void output_bb(struct function *fn, struct basic_block *bb) { struct instruction *insn; - bb->generation = generation; - FOR_EACH_PTR(bb->insns, insn) { if (!insn->bb) continue; @@ -930,7 +928,6 @@ static void output_bb(struct function *fn, struct basic_block *bb, unsigned long static void output_fn(LLVMModuleRef module, struct entrypoint *ep) { - unsigned long generation = ++bb_generation; struct symbol *sym = ep->name; struct symbol *base_type = sym->ctype.base_type; struct symbol *ret_type = sym->ctype.base_type->ctype.base_type; @@ -964,9 +961,6 @@ static void output_fn(LLVMModuleRef module, struct entrypoint *ep) static int nr_bb; FOR_EACH_PTR(ep->bbs, bb) { - if (bb->generation == generation) - continue; - LLVMBasicBlockRef bbr; char bbname[32]; struct instruction *insn; @@ -997,12 +991,9 @@ static void output_fn(LLVMModuleRef module, struct entrypoint *ep) END_FOR_EACH_PTR(bb); FOR_EACH_PTR(ep->bbs, bb) { - if (bb->generation == generation) - continue; - LLVMPositionBuilderAtEnd(function.builder, bb->priv); - output_bb(&function, bb, generation); + output_bb(&function, bb); } END_FOR_EACH_PTR(bb); }