From patchwork Mon Mar 27 21:23:26 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: 9647467 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 4E549601D7 for ; Mon, 27 Mar 2017 21:26:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FAB92840E for ; Mon, 27 Mar 2017 21:26:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3488C28420; Mon, 27 Mar 2017 21:26:31 +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 CEAFB2840E for ; Mon, 27 Mar 2017 21:26:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751739AbdC0V0a (ORCPT ); Mon, 27 Mar 2017 17:26:30 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:33181 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751629AbdC0V03 (ORCPT ); Mon, 27 Mar 2017 17:26:29 -0400 Received: by mail-wr0-f194.google.com with SMTP id 20so17041383wrx.0 for ; Mon, 27 Mar 2017 14:26:27 -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=e1YCtqwCv2fshkUUc5SHyhFGdFqP0UwP2bZQ3JfJW2/gFvmOT8qpOxyulz4jRohe0M asdYkuayKsaTDvyJKapqNyuvJ5MvYjHKX9Z692TNycGIQgjJGhuVxvWv9zr3lmkBEiQu +tdqZFhcnJJJgOPdHIyemkJUx4N4VlxCesCsyzIULm2PPt93SyJCq0SWJCHhI/348lxP CxkhYpZ+2f2XZhRraJI0QrOl24waIZSIeyVqufhg2NMze5xy4qIZVxxUF8nENIDM/n1q cVv1Vw6lbkCdcHed1QnDE/zS4p8Oxg0rMGH7RSNYeBvOKSO+VMvBRH8zEeAKcrnF8eLX ubtA== 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=reL9qdctR0AWG84JwNGv/EV/Hz6tKh/8DmaL+bKc84azNIlaMBtj5sHwVqy2bGgZ2H cRASu3wHtsSzxTN/58FdsQG6ztRZKd6h8jccQej0HfBpCGfa1oIBQHpnSrhp5YAUF0QU uJmSK7HfuxXcQhkZZyxOBQautvks3WuUCiGWBWfRMZ+EwgZwFmuJ/m+TtbG/P/Bix+tK i+y8gCqxh9zJdEekm5vD0CU2aWpsKv5nUOnDHJgCXRucRHFhHqSUjBUERQFnMzcLV0jf KKITcgryk+YsknavrOTJSVhAROKryFxJ38EYAr4V0THBam86n6BuVM/JpWCTqXg1KzwH lWUg== X-Gm-Message-State: AFeK/H3N+n9BGtDyTwRj74yqpfdBE1FXewrOwiIWYSahS/SFyEehI83kCRSPQAA5b4H17Q== X-Received: by 10.28.199.132 with SMTP id x126mr10780833wmf.37.1490649987082; Mon, 27 Mar 2017 14:26:27 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:802:b00:496:ae63:aebb:a034]) by smtp.gmail.com with ESMTPSA id k203sm973767wmk.4.2017.03.27.14.26.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Mar 2017 14:26:26 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Christopher Li , Luc Van Oostenryck Subject: [PATCH v6 02/52] llvm: remove unneeded 'generation' Date: Mon, 27 Mar 2017 23:23:26 +0200 Message-Id: <20170327212416.18536-3-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170327212416.18536-1-luc.vanoostenryck@gmail.com> References: <20170327212416.18536-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); }