[cfe-dev] address_space pragma

Leonard Chan via cfe-dev cfe-dev at lists.llvm.org
Thu Aug 2 10:20:27 PDT 2018


I'm also looking into this. Could you provide an example of a
diagnostic that does this?
On Thu, Aug 2, 2018 at 10:06 AM David Chisnall
<David.Chisnall at cl.cam.ac.uk> wrote:
>
> On 1 Aug 2018, at 20:19, Leonard Chan via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> >
> > ```
> > error: passing '__attribute__((address_space(2))) char *' to parameter
> > of type '__attribute__((address_space(1))) char *' changes address
> > space of pointer
> > ```
> >
> > We would like to propose a pragma that would allow for binding an
> > address_space to a string, and a list of other attributes used with
> > address_space, such that the error will instead print the string
> > passed instead of the whole attribute. That is, this would be dumped
> > instead:
> >
> > ```
> > error: passing 'SPACE2 char *' to parameter of type 'SPACE1 char *'
> > changes address space of pointer
> > ```
>
> A few other error messages look for macro definitions and, if there is a macro that expands to the correct character sequence, use that macro name instead in the error message.  Is there a reason that the same approach wouldn’t work here?
>
> David
>



More information about the cfe-dev mailing list