[cfe-commits] [PATCH] OpenCL inline calls have internal linkage

Tanya Lattner lattner at apple.com
Thu Jun 21 17:07:31 PDT 2012


On Jun 14, 2012, at 4:15 AM, Anton Lokhmotov <Anton.Lokhmotov at arm.com> wrote:

> Hi Tanya,
> 
>> In OpenCL inline calls without a specified storage class should have
>> internal linkage. The attached patch makes this modification and adds a
>> test case.
> 
> If this is OpenCL 1.2 specific, it should be guarded on a new language
> option OpenCL_1_2 [1].
> 

A "recent" change in Clang caused functions that are not marked with extern inline to only include the definition for inlining. This was to adhere more closely to the C99 standard (as far as I know). This also changed the behavior for OpenCL which is a problem for us. When you have a kernel that uses some function that is marked "inline" and doesn't get inlined because its too large, the function body no longer exists. I would imagine that other OpenCL framework implementors would also be upset at this change as well.

After discussing offline, it would be better if OpenCL followed C++ semantics here instead of C99 and my patch should be modified. But this is technically not in the spec. 

Do you have objections to this?

-Tanya






More information about the cfe-commits mailing list