Use the correct address space when emitting the ctor function list
authorDylan McKay <me@dylanmckay.io>
Fri, 9 Nov 2018 17:15:06 +0000 (17:15 +0000)
committerDylan McKay <me@dylanmckay.io>
Fri, 9 Nov 2018 17:15:06 +0000 (17:15 +0000)
commit21e7f5e24eb1fef1676d70eb013b1346482a7bac
treed92b3014d66dbe420eef3d71041252365f81e45c
parent96d37cf5374761e0f07f1ad064798e92d04786d8
Use the correct address space when emitting the ctor function list

This patch modifies clang so that, if compiling for a target that
explicitly specifies a nonzero program memory address space, the
constructor list global will have the same address space as the
functions it contains.

AVR is the only in-tree backend which has a nonzero program memory
address space.

Without this, the IR verifier would always fail if a constructor
was used on a Harvard architecture backend.

This has no functional change to any in-tree backends except AVR.

llvm-svn: 346520
clang/lib/CodeGen/CodeGenModule.cpp