I am popping this up on Phabricator for early feedback.
**NOTE*: I will submit this in several smaller patches once this is actually ready.
This adds support for letting targets specify which address
spaces their functions should reside in by default.
This is the first step towards placing functions into the correct
address space for Harvard architectures.
This requires address space to be specified when creating functions. In general, you should always be using DataLayout.getProgramAddressSpace() unless you have a reason not to.
I worry that other LLVM developers will see AddrSpace and naively enter 0, which would break all Harvard architectures.
One way around this could be make the ctor take a DataLayout instead, but you shouldn't really need one to construct this.
Any ideas are very welcome!