This is an archive of the discontinued LLVM Phabricator instance.

[clang] Require address space to be specified when creating functions (3/3)
AbandonedPublic

Authored by dylanmckay on Aug 23 2017, 4:04 AM.

Details

Summary

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

  • Add program address space to data layout D37052
  • Require address space to be specified when creating functions D37054
  • [clang] Require address space to be specified when creating functions D37057

Diff Detail

Event Timeline

dylanmckay created this revision.Aug 23 2017, 4:04 AM
  • Remove the switch table stuff for a later patch
  • Rebased on top of trunk
dylanmckay retitled this revision from [clang] Require address space to be specified when creating functions (4/4) to [clang] Require address space to be specified when creating functions (3/3).Dec 6 2017, 10:15 PM
dylanmckay edited the summary of this revision. (Show Details)
dylanmckay updated this revision to Diff 126270.Dec 9 2017, 1:12 AM

Rebase on trunk

Looks good to me but I guess someone else should approve the change.

I added a bunch of hacks in our fork to ensure that functions end up being in address space 200 but this would be much better.

Gentle rebase

dylanmckay abandoned this revision.Jul 14 2018, 8:55 AM

Superseded by D47541