[cfe-dev] Functions in non-default address space.

Sanjiv Gupta sanjiv.gupta at microchip.com
Tue May 5 23:59:50 PDT 2009


Eli Friedman wrote:
> On Tue, May 5, 2009 at 11:13 PM, Sanjiv Gupta
> <sanjiv.gupta at microchip.com> wrote:
>   
>> void foo (void) {}
>>
>> In PIC16, functions resides in a different address space (program
>> memory), how to change the default address space for GlobalAddress "foo"
>> in clang for a particular target?
>>     
>
> You shouldn't need to do anything outside the LLVM backend, I think;
> the backend should take care of putting functions in an appropriate
> section, no?
>
>   
I need to use that information in the back end only.
We emit 'bank selection' insns before any insn that access data memory.  
For example, a global int a; (GlobalAddress a) should have a banksel 
emitted while anything that access "foo()"  (GlobalAddress foo) need not.
Are you saying to distinguish GloalAddress that are functions from those 
that are not?

> As far as I know, LLVM doesn't support putting functions in alternate
> address spaces, so we can't really add it to clang.
>
> -Eli
>   




More information about the cfe-dev mailing list