This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Use only the GVALinkage on function definitions.
ClosedPublic

Authored by jlebar on Nov 2 2016, 6:05 PM.

Details

Summary

Previously we'd look at the GVALinkage of whatever FunctionDecl you
happened to be calling.

This is not right. In the absence of the gnu_inline attribute, to be
handled separately, the function definition determines the function's
linkage. So we need to wait until we get a def before we can know
whether something is known-emitted.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 76808.Nov 2 2016, 6:05 PM
jlebar retitled this revision from to [CUDA] Use only the GVALinkage on function definitions..
jlebar updated this object.
jlebar added a reviewer: tra.
jlebar added subscribers: rsmith, cfe-commits.
jlebar added a comment.Nov 8 2016, 3:07 PM

Friendly ping

tra accepted this revision.Nov 8 2016, 3:22 PM
tra edited edge metadata.

LGTM.

clang/test/SemaCUDA/add-inline-in-definition.cu
13–14 ↗(On Diff #76808)

"bar() sees for foo()" does not sound right. Did you mean "bar() sees *that* foo()"?

15 ↗(On Diff #76808)

Extra whitespace.

This revision is now accepted and ready to land.Nov 8 2016, 3:22 PM
jlebar marked 2 inline comments as done.Nov 8 2016, 3:55 PM

Thank you for the review! Submitting...

clang/test/SemaCUDA/add-inline-in-definition.cu
13–14 ↗(On Diff #76808)

Yes, this is a mistake, thanks!

15 ↗(On Diff #76808)

We seem to be pretty evenly-split wrt one or two spaces here in llvm, agreed irl it's nbd.

This revision was automatically updated to reflect the committed changes.
jlebar marked 2 inline comments as done.