This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Don't generate aliases for static extern "C" functions.
ClosedPublic

Authored by jlebar on Jan 22 2016, 5:43 PM.

Diff Detail

Event Timeline

jlebar updated this revision to Diff 45781.Jan 22 2016, 5:43 PM
jlebar retitled this revision from to [CUDA] Don't generate aliases for static extern "C" functions..
jlebar updated this object.
jlebar added a reviewer: tra.
jlebar added subscribers: echristo, jhen, cfe-commits.
tra edited edge metadata.Jan 25 2016, 11:32 AM

Failing silently is not a good idea. At the very least there should produce an error.
The right thing to do here, IMO, would be to generate a stub with alias name that just jumps to or calls aliasee.

In D16501#335225, @tra wrote:

Failing silently is not a good idea. At the very least there should produce an error.
The right thing to do here, IMO, would be to generate a stub with alias name that just jumps to or calls aliasee.

Discussed IRL. We're not breaking anyone who's not already broken -- if you currently have "device attribute((used)) static int foo()", that's just not going to compile for you without this patch. With this patch, at least this will work for some people; we can always add this stub function later if we want (I have concerns about potentially surprising performance implications, but we can postpone worrying about that).

tra accepted this revision.Jan 25 2016, 11:59 AM
tra edited edge metadata.

OK. If someone attempts to rely on this feature in CUDA it will be obviously broken due to the missing C-style mangled name. We can deal with it then.

This revision is now accepted and ready to land.Jan 25 2016, 11:59 AM
This revision was automatically updated to reflect the committed changes.