[cfe-dev] address_space pragma

Leonard Chan via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 1 15:50:22 PDT 2018


> Is your expectation that these address spaces will be exclusively used for diagnostics?

Yes. This will serve as a way of essentially shortening an attribute
list in the diagnostic for address_space since this is what's useful
to us for now, but we are open to expanding this to fit other use
cases as long as we get this.

> Should they support promotions between address spaces?

We weren't planning on this. The idea is that each new address space
created with this pragma will be a new address space disassociated
from any previous one.

> Do you have an idea of what the "variable attributes" would look like?

Should've clarified on this more. This is the syntax of regular
attributes that you would normally declare in an attribute list but
space separated. So something like

```
#define __iomem __attribute__((address_space(2), noderef, other_attr(arg)))
```

would be represented as

```
#pragma clang address_space "__iomem" noderef other_attr(arg)
#define __iomem __attribute__((address_space("__iomem")))
```

Though after experimenting for a bit, I'm running into a few
unexpected errors and may change the syntax. I've been looking into
arphaman's patch for the pragma clang attribute and may borrow his
syntax.



More information about the cfe-dev mailing list