Page MenuHomePhabricator

[clang] Use enum for LangOptions::SYCLVersion instead of unsigned
ClosedPublic

Authored by jansvoboda11 on Dec 18 2020, 6:40 AM.

Details

Summary

LangOptions::SYCLVersion can only have two values. This patch introduces an enum that allows us to reduce the member size from 32 bits to 1 bit.

Consequently, this also makes marshalling of this option fit into our model for enums: D84674.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Dec 18 2020, 6:40 AM
jansvoboda11 requested review of this revision.Dec 18 2020, 6:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 18 2020, 6:40 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I've reviewed the code and it seems to do the right thing. I'd like a SYCL maintainer to take a look too though.

(If for some reason changing the interface to an enum isn't desirable, maybe there's a compromise where there's an accessor that converts back to an integer?)

bader accepted this revision.Dec 19 2020, 7:23 AM
bader added subscribers: mdtoguchi, erichkeane.

LGTM. Thanks!

@erichkeane, @mdtoguchi, we should upstream support for SYCL-2020 version in addition to SYCL-2017.

This revision is now accepted and ready to land.Dec 19 2020, 7:23 AM