clover/llvm: Fix build against LLVM/Clang 4.0

Submitted by Aaron Watry on March 21, 2018, 9:07 p.m.

Details

Message ID 20180321210731.3772-1-awatry@gmail.com
State New
Headers show
Series "clover/llvm: Fix build against LLVM/Clang 4.0" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Aaron Watry March 21, 2018, 9:07 p.m.
The opencl 1.0 langstandard was renamed in 5.0+

Cc: Mark Janes <mark.a.janes@intel.com>
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index af78c2ae28..2fb3ce2365 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -85,7 +85,11 @@  namespace {
     };
 
     const clc_version_lang_std cl_version_lang_stds[] = {
+#if HAVE_LLVM >= 0x0500
        { 100, clang::LangStandard::lang_opencl10},
+#else
+       { 100, clang::LangStandard::lang_opencl},
+#endif
        { 110, clang::LangStandard::lang_opencl11},
        { 120, clang::LangStandard::lang_opencl12},
        { 200, clang::LangStandard::lang_opencl20},

Comments

Aaron Watry <awatry@gmail.com> writes:

> The opencl 1.0 langstandard was renamed in 5.0+
>
> Cc: Mark Janes <mark.a.janes@intel.com>
> ---
>  src/gallium/state_trackers/clover/llvm/invocation.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index af78c2ae28..2fb3ce2365 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -85,7 +85,11 @@ namespace {
>      };
>  
>      const clc_version_lang_std cl_version_lang_stds[] = {
> +#if HAVE_LLVM >= 0x0500
>         { 100, clang::LangStandard::lang_opencl10},
> +#else
> +       { 100, clang::LangStandard::lang_opencl},
> +#endif

Please move this preprocessor magic into an llvm/compat.hpp definition.
Thanks!

>         { 110, clang::LangStandard::lang_opencl11},
>         { 120, clang::LangStandard::lang_opencl12},
>         { 200, clang::LangStandard::lang_opencl20},
> -- 
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
This patch fixes the clover build for Clang 4.0, which is what the Intel
CI uses.

Tested-by: Mark Janes <mark.a.janes@intel.com>

Aaron Watry <awatry@gmail.com> writes:

> The opencl 1.0 langstandard was renamed in 5.0+
>
> Cc: Mark Janes <mark.a.janes@intel.com>
> ---
>  src/gallium/state_trackers/clover/llvm/invocation.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index af78c2ae28..2fb3ce2365 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -85,7 +85,11 @@ namespace {
>      };
>  
>      const clc_version_lang_std cl_version_lang_stds[] = {
> +#if HAVE_LLVM >= 0x0500
>         { 100, clang::LangStandard::lang_opencl10},
> +#else
> +       { 100, clang::LangStandard::lang_opencl},
> +#endif
>         { 110, clang::LangStandard::lang_opencl11},
>         { 120, clang::LangStandard::lang_opencl12},
>         { 200, clang::LangStandard::lang_opencl20},
> -- 
> 2.14.1
Aaron Watry <awatry@gmail.com> writes:

> On Wed, Mar 21, 2018, 4:49 PM Francisco Jerez <currojerez@riseup.net> wrote:
>
>> Aaron Watry <awatry@gmail.com> writes:
>>
>> > The opencl 1.0 langstandard was renamed in 5.0+
>> >
>> > Cc: Mark Janes <mark.a.janes@intel.com>
>> > ---
>> >  src/gallium/state_trackers/clover/llvm/invocation.cpp | 4 ++++
>> >  1 file changed, 4 insertions(+)
>> >
>> > diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp
>> b/src/gallium/state_trackers/clover/llvm/invocation.cpp
>> > index af78c2ae28..2fb3ce2365 100644
>> > --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
>> > +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
>> > @@ -85,7 +85,11 @@ namespace {
>> >      };
>> >
>> >      const clc_version_lang_std cl_version_lang_stds[] = {
>> > +#if HAVE_LLVM >= 0x0500
>> >         { 100, clang::LangStandard::lang_opencl10},
>> > +#else
>> > +       { 100, clang::LangStandard::lang_opencl},
>> > +#endif
>>
>> Please move this preprocessor magic into an llvm/compat.hpp definition.
>> Thanks!
>>
>
> Sure thing.  Do you want to see a v2?
>

I wouldn't mind.

> --Aaron
>
>
>> >         { 110, clang::LangStandard::lang_opencl11},
>> >         { 120, clang::LangStandard::lang_opencl12},
>> >         { 200, clang::LangStandard::lang_opencl20},
>> > --
>> > 2.14.1
>> >
>> > _______________________________________________
>> > mesa-dev mailing list
>> > mesa-dev@lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
On Wed, Mar 21, 2018, 4:49 PM Francisco Jerez <currojerez@riseup.net> wrote:

> Aaron Watry <awatry@gmail.com> writes:
>
> > The opencl 1.0 langstandard was renamed in 5.0+
> >
> > Cc: Mark Janes <mark.a.janes@intel.com>
> > ---
> >  src/gallium/state_trackers/clover/llvm/invocation.cpp | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> > index af78c2ae28..2fb3ce2365 100644
> > --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> > +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> > @@ -85,7 +85,11 @@ namespace {
> >      };
> >
> >      const clc_version_lang_std cl_version_lang_stds[] = {
> > +#if HAVE_LLVM >= 0x0500
> >         { 100, clang::LangStandard::lang_opencl10},
> > +#else
> > +       { 100, clang::LangStandard::lang_opencl},
> > +#endif
>
> Please move this preprocessor magic into an llvm/compat.hpp definition.
> Thanks!
>

Sure thing.  Do you want to see a v2?

--Aaron


> >         { 110, clang::LangStandard::lang_opencl11},
> >         { 120, clang::LangStandard::lang_opencl12},
> >         { 200, clang::LangStandard::lang_opencl20},
> > --
> > 2.14.1
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>