[LLVMdev] Named Address Spaces

Matthijs Kooijman matthijs at stdin.nl
Wed Sep 24 14:48:55 PDT 2008


Hi Gobi,

> I am a student trying to find out if LLVM can be used for the Embedded C
> architecture that I will be developing tools for at work. In LLVM 2.2
> Christopher Lamb contributed support for Multiple Address Spaces into the
> LLVM IR, and I was wondering if llvm-gcc is able to use this
> functionallity. If so, what syntax is used to assign address spaces, and
You should look at the addrspace attribute. IIRC, the syntax is as follows:

__attribute__(( addrspace(10) )) int foo;

This should allocate foo in address space 10 (though I'm not 100% sure about
the syntax and don't have examples at hand).

> what files are needed for the address spaces to be defined in the backend.
> If not, how do users capitalize on this functionallity?
clang and LLVM IRC only support numbered address spaces, no names. There is no
need to define anything to get address spaces in the IR. You should probably
do something to make a backend actually use the address space information,
though I don't know what, where, or if there are any backends using this info
already. Perhaps others can comment?

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080924/b992c0c0/attachment.sig>


More information about the llvm-dev mailing list