This makes it necessary to specify address spaces when creating new
functions.
Most users won't have to worry about this as all of the
'getOrInsertFunction' functions on Module will default to the program
address space.
An overload has been added to Function::Create to abstract away the
details for most callers.
Full patchset
Just wondering if it would be better to put functions without an explicit address space in the program address space?
I think this may be more consistent since creating a new FunctionType without an address space will put it in the program address space and not address space zero.
I am not sure if there are any backwards compatibility constraints here since IR generated by an older version will never have the program address space in the datalayout string so they should also end up in address space zero.
Putting everything in the program address space should make it easier for us to keep the existing IR testcases once we expect all functions to be in address space 200.