From patchwork Wed Aug 23 20:15:17 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: 9918261 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 ACDDD602CB for ; Wed, 23 Aug 2017 20:16:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A009B28A2C for ; Wed, 23 Aug 2017 20:16:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 950D528A2E; Wed, 23 Aug 2017 20:16:23 +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 51ECA28A2C for ; Wed, 23 Aug 2017 20:16:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932673AbdHWUQX (ORCPT ); Wed, 23 Aug 2017 16:16:23 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33613 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932443AbdHWUQW (ORCPT ); Wed, 23 Aug 2017 16:16:22 -0400 Received: by mail-wm0-f68.google.com with SMTP id b79so661523wmf.0 for ; Wed, 23 Aug 2017 13:16:22 -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=mFUViYrNjTNRKU6Rab+5AMRkm/sHmJRRkCr8jcACZMc=; b=WS7e1EzQ19ArcA1rzTHd6vFDnpostD7+HFgrElwHkBZMDan5j13QNR4XsVCgxiU+VD hcCh2VbpnzYqteiXAmHyW7sXvUJtKYFsuI47tDOI6HOWBVaydzxKFdcc+IbrqSZercQf XbkYXtrKGc2wRCdwXDKVfaCFrqXl3v8wBWvvHYMkhsfbLYlwfmx6pXwNzA6zVs5ns3FQ i0NyBmmx7QPYox7aaeErdw+yJv6t4IoeR/xCgcUXzRdo53Ui+kZiFR4MLXQjEJmC8/X9 HXHlubhYy6y+UtxyRdAal/8rvMYBGzSniokEFTWDKg1TAgx05PHF4MW3qhCSwWYAZcER l0dg== 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=mFUViYrNjTNRKU6Rab+5AMRkm/sHmJRRkCr8jcACZMc=; b=m6p+lmyw3K6bsfqsppuqICqpxH/rXtUWc23CTT8EI7r8k4zMQLeNHm7nsp4bGxU6cX OVkCdSjw3VPXrvgXViy5w5ltYyb51S54FdQtHuVCyAQOPDBryuzPKLuDHGVs3PZjyqyU GDRj/CP7+tHYumpD6Hve+Q/6HulUJFvskP2Xf3B9InNIRlLmMA+Yje58opJqyHR8sNtn Cr2nG9C7wSDaFovNByKdgn6t2eEMkVLvCSZYD7PW9qWZ6zoBB/v1LilDEusfczO96WY5 KGXwM57IaS6zKZeth1Vzlk67Y6hom1FadA2ltXTGNOK3rXtHNzlfKsLHs9c6UyeTUfh8 iHJg== X-Gm-Message-State: AHYfb5gU+qElJ+gegXErVsueh5j2MUQqUhz6rOf/QN8jHZ3DGs3o8T3Z NosbVXNCq5nKJjTOLnk= X-Received: by 10.80.154.6 with SMTP id o6mr4103679edb.205.1503519381094; Wed, 23 Aug 2017 13:16:21 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:4076:600:9020:103b:7912:3a40]) by smtp.gmail.com with ESMTPSA id e29sm1183374edd.88.2017.08.23.13.16.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 13:16:20 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Christopher Li , Luc Van Oostenryck Subject: [RFC PATCH 11/48] add undef_pseudo() Date: Wed, 23 Aug 2017 22:15:17 +0200 Message-Id: <20170823201554.90551-12-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170823201554.90551-1-luc.vanoostenryck@gmail.com> References: <20170823201554.90551-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 This helper simply create a pseudo of type PSEUDO_UNDEF. Signed-off-by: Luc Van Oostenryck --- linearize.c | 7 +++++++ linearize.h | 1 + 2 files changed, 8 insertions(+) diff --git a/linearize.c b/linearize.c index aadecfc5d..3ef65d585 100644 --- a/linearize.c +++ b/linearize.c @@ -823,6 +823,13 @@ static pseudo_t argument_pseudo(struct entrypoint *ep, int nr) return pseudo; } +pseudo_t undef_pseudo(void) +{ + pseudo_t pseudo = __alloc_pseudo(0); + pseudo->type = PSEUDO_UNDEF; + return pseudo; +} + pseudo_t alloc_phi(struct basic_block *source, pseudo_t pseudo, struct symbol *type) { struct instruction *insn; diff --git a/linearize.h b/linearize.h index 54fcf2a46..060d5f327 100644 --- a/linearize.h +++ b/linearize.h @@ -335,6 +335,7 @@ extern void insert_branch(struct basic_block *bb, struct instruction *br, struct pseudo_t alloc_phi(struct basic_block *source, pseudo_t pseudo, struct symbol *type); pseudo_t alloc_pseudo(struct instruction *def); pseudo_t value_pseudo(long long val); +pseudo_t undef_pseudo(void); struct entrypoint *linearize_symbol(struct symbol *sym); int unssa(struct entrypoint *ep);