[PATCH] D53153: [OpenCL] Mark kernel functions with default visibility

Scott Linder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 10 12:35:17 PST 2019


scott.linder added a comment.

In D53153#1317977 <https://reviews.llvm.org/D53153#1317977>, @rjmccall wrote:

> I think `-fvisibility=hidden` isn't good enough because you want to infer hidden visibility even for external symbol references, and that's just not how global visibility works.  But after this discussion, I'm prepared to accept that (1) we should have some sort of single-image compiler mode that implies that all symbols are defined within the image and (2) you can make your toolchain imply that together with `-fvisibility=hidden` and then have specific symbols opt in to non-hidden visibility if they need to be accessible to whatever loader / runtime you have.


It seems that explicit visibility attributes on external symbol references (e.g. `__attribute__((visibility("hidden"))) extern int foo;`) are respected in Clang, so I don't understand the rationale for global visibility controls not applying to them as well. Can you describe why this is the case?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D53153/new/

https://reviews.llvm.org/D53153





More information about the cfe-commits mailing list