linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Christopher Li <sparse@chrisli.org>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 3/5] llvm: add support for float initializer
Date: Mon, 18 Sep 2017 11:30:12 +0200	[thread overview]
Message-ID: <20170918093014.11878-4-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20170918093014.11878-1-luc.vanoostenryck@gmail.com>

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 sparse-llvm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sparse-llvm.c b/sparse-llvm.c
index 9a32efe36..206fac227 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -1197,6 +1197,9 @@ static LLVMValueRef output_data(LLVMModuleRef module, struct symbol *sym)
 		case EXPR_VALUE:
 			initial_value = LLVMConstInt(symbol_type(sym), initializer->value, 1);
 			break;
+		case EXPR_FVALUE:
+			initial_value = LLVMConstReal(symbol_type(sym), initializer->fvalue);
+			break;
 		case EXPR_SYMBOL: {
 			struct symbol *sym = initializer->symbol;
 
-- 
2.14.0


  parent reply	other threads:[~2017-09-18  9:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18  9:30 [PATCH 0/5] extra fixes for LLVM Luc Van Oostenryck
2017-09-18  9:30 ` [PATCH 1/5] llvm: warn instead of assert on global inits Luc Van Oostenryck
2017-09-18  9:30 ` [PATCH 2/5] llvm: gracefully catch impossible type/value Luc Van Oostenryck
2017-09-18  9:30 ` Luc Van Oostenryck [this message]
2017-09-18  9:30 ` [PATCH 4/5] llvm: give names easier to debug Luc Van Oostenryck
2017-09-18  9:30 ` [PATCH 5/5] llvm: only compare void pointers Luc Van Oostenryck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170918093014.11878-4-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).