[LLVMdev] Using address space attribute in LLVM

Chris Lattner clattner at apple.com
Mon Oct 19 08:53:54 PDT 2009


On Oct 19, 2009, at 8:40 AM, Juan Carlos Martinez Santos wrote:

> Hello,
>
> What is the correct way to use address_space attribute? For CLANG, I  
> used the below code, but when I tried the same with LLVM, I got a  
> warning.

llvm-gcc doesn't support address spaces.  This is a clang-only feature.

-Chris

>
> Thanks in advance,
>
> Juan Carlos
>
> -----------------------------
>
> Code used:
>
> #define GS_RELATIVE __attribute__((address_space(256)))
> int foo(int GS_RELATIVE *P) {
>   return *P;
> }
>  int main(){
>         return (1);
> }
> ------------------------------
>
> LLVM messsage:
>
> ~/test$ llvm-gcc addrspace256.c -emit-llvm -o -
> addrspace256.c:2: warning: 'address_space' attribute directive ignored
> /tmp/ccpdq1E2.o: file not recognized: File format not recognized
> collect2: ld returned 1 exit status
>
>
> -- 
> Juan Carlos
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list