From patchwork Wed Aug 16 15:34:38 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: 9903983 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 4E3F360231 for ; Wed, 16 Aug 2017 15:35:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4089F22B27 for ; Wed, 16 Aug 2017 15:35:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35701286AC; Wed, 16 Aug 2017 15:35:32 +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 C01F622B27 for ; Wed, 16 Aug 2017 15:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751580AbdHPPfb (ORCPT ); Wed, 16 Aug 2017 11:35:31 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34014 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751370AbdHPPfb (ORCPT ); Wed, 16 Aug 2017 11:35:31 -0400 Received: by mail-wr0-f193.google.com with SMTP id x43so3697579wrb.1 for ; Wed, 16 Aug 2017 08:35:30 -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=PoLHfGHPR8TBPEL8UVC6m2mqRrpj7zCA/FSBOp+6CHI=; b=FGd0U/b4OzPj/1mv16gHv9M2ZJaFvwYcc3bt/WxHlp+Rh3ijDNfBbja98LKKaAdV3X IB0MQ+9uNP0l2MxMqAs1vrgEebbxlrZ+VII6ikJse60zAoKmmGt8xPDjMZ5hz6ai+SPe h6A2nvqY3ppyimNacPQy52NoCi+aILCJ5FCr/ekgwYl7hau1t6AOTR2Xb5AwlS9KifNd yD+CenHNtLVf0Hgg8v0AKiNo7VE7qOzovGjkDIauSdqUe1AgHMaodOlc5R6brzL08/jq uWTGfMXBpQYghS910yYtAOur1Us3yoZJO4/+dd5jAnvzZJTE0jaVckINxKLIHWS956OX 2lEg== 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=PoLHfGHPR8TBPEL8UVC6m2mqRrpj7zCA/FSBOp+6CHI=; b=sDdzzwZu8q7FT2+0VUqcQkKjK7mm4VyzI1kmLXD1/XaaeZ4y1cHoSvcoLNyNKnIBSL SBA8B3tLECPL2ZzfXb4k1ZOBrJD7hIIz0o+hnyJmwbsKbCnG292XLWR99ycjgnug7Sde ck50oBcrIfJUWId6SzETZAcMz99drlmX3PzKkmKMo8GByBYS7ObN08RtgcpqlK2WtAZy 5PqzsIw4tPwHFf6T6oNyhuIcYlEp+GPH1UPt5Vlt2oFO2YEEU3lsbw0FcHXvLj2+Of46 o/8fXdDJW1HDWfWbIimBfUFLNRa9eGcdoEMAeVUS0r6fwnPzFJ8IXmoeNyaMDHw7GjRQ SPcw== X-Gm-Message-State: AHYfb5gwm+qDLHr9SSo2qcUi2v/8U84pxXQk+7Yf1fH38VBl8JA/wUsw l2UPVLK4bZp2wa0MwdA= X-Received: by 10.80.175.166 with SMTP id h35mr2330186edd.193.1502897729729; Wed, 16 Aug 2017 08:35:29 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:4076:600:895a:bb88:13f:9772]) by smtp.gmail.com with ESMTPSA id y19sm690635edi.6.2017.08.16.08.35.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 08:35:29 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Linus Torvalds , Christopher Li , Luc Van Oostenryck Subject: [PATCH 12/29] add undef_pseudo() Date: Wed, 16 Aug 2017 17:34:38 +0200 Message-Id: <20170816153455.97693-13-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170816153455.97693-1-luc.vanoostenryck@gmail.com> References: <20170816153455.97693-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 9ec65079a..3d14892cd 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);