All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@kernel.org>
To: sparse@chrisli.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-sparse@vger.kernel.org, Jeff Garzik <jeff@garzik.org>,
	Josh Triplett <josh@joshtriplett.org>
Subject: Re: [ANNOUNCE] LLVM backend for Sparse
Date: Mon, 29 Aug 2011 14:05:41 +0300	[thread overview]
Message-ID: <CAOJsxLHDHZyR--qo-V_22bn_V_btiXnLt6nNxid-Zj0Wj1DpVw@mail.gmail.com> (raw)
In-Reply-To: <4E5B599F.4090205@chrisli.org>

On 08/29/2011 12:41 AM, Pekka Enberg wrote:
>> Right. Will the "link time constant" 'struct symbol' be part of the
>> symbol_list? If it is, then we already do LLVMAddGlobal in output_data() on
>> it and could probably just stash that into a ->priv member in 'struct
>> symbol' and use that in pseudo_to_value().

On Mon, Aug 29, 2011 at 12:19 PM, Christopher Li <sparse@chrisli.org> wrote:
> The link time constant is a LLVMValueRef, it is just the address of the
> symbol.
> Yes, it will belong to the function scope's symbol_list but not necessary
> the global one.
> Here is some tips that help me a lot on my own llvm branch, which lost due
> to a hard
> drive crash. It was able to do hello world back then.
>
> LLVM can output c++ source code that construct the llvm byte code.
>
> # this will emit hello.s as the llvm asm code
> $ clang -S -emit-llvm hello.c
>
> # this will generate hello.s.cpp which is the c++ source code to construct
> # the llvm byte code above
>
> $ llc -march=cpp hello.s
>
> The hello.s.cpp is a very good reference to build the llvm byte code in C.
> It is in C++, but convert to llvm C binding should be easy.
> BTW, "-march=c" does not generate C bindings, it generate the
> equivalent IR in C code instead.

Yup, I've been doing that online here:

http://llvm.org/demo/test.cgi

  reply	other threads:[~2011-08-29 11:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-28  6:08 [ANNOUNCE] LLVM backend for Sparse Pekka Enberg
2011-08-28  8:51 ` Christopher Li
2011-08-28 13:51   ` Pekka Enberg
2011-08-28 14:01   ` Pekka Enberg
2011-08-28 16:54     ` Linus Torvalds
2011-08-29  7:41       ` Pekka Enberg
2011-08-29  9:19         ` Christopher Li
2011-08-29 11:05           ` Pekka Enberg [this message]
2011-08-29 14:22   ` Pekka Enberg
2011-08-29 15:14     ` Derek M Jones
2011-08-29 15:33       ` Jeff Garzik
2011-08-29 15:42         ` Derek M Jones
2011-08-29 15:45           ` Pekka Enberg
2011-08-29 16:58       ` Linus Torvalds
2011-08-29 15:27     ` Jeff Garzik

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=CAOJsxLHDHZyR--qo-V_22bn_V_btiXnLt6nNxid-Zj0Wj1DpVw@mail.gmail.com \
    --to=penberg@kernel.org \
    --cc=jeff@garzik.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.