[PATCH] D53153: [OpenCL] Mark kernel functions with default visibility
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 5 16:40:36 PST 2018
rjmccall added a comment.
I agree with Richard that I'm not sure what the point of supporting frontend visibility settings in OpenCL is. If you want the "everything is internal to the image" optimization, presumably you can just infer visibility on everything in a pass over the IR.
Comment at: lib/AST/Decl.cpp:565
+ return FD->hasAttr<OpenCLKernelAttr>();
+ return dyn_cast<VarDecl>(D);
I think you should just check for the attribute here; it can't be present in non-OpenCL files, and it can't be present on non-functions, and it's probably cheaper to look for it than to check the language option anyway.
More information about the cfe-commits