This is an archive of the discontinued LLVM Phabricator instance.

[PR40707][PR41011][OpenCL] Allow addr space spelling without double underscore in C++ mode
ClosedPublic

Authored by Anastasia on Mar 20 2019, 10:08 AM.

Details

Summary

For backwards compatibility we should allow alternative spelling of address spaces - private, local, global, constant, generic.

Note that in order to accept private correctly parsing has been changed to understand two different use cases - access specifier vs address space.

This fixes the issues reported in the bugs.

The header from libclc is compiled successfully.

Diff Detail

Repository
rC Clang

Event Timeline

Anastasia created this revision.Mar 20 2019, 10:08 AM

I was a little bit worried about

struct top_level { int i; };

private ::top_level a;

but it should be fine because in that case we have a tok::coloncolon

Anastasia updated this revision to Diff 191665.Mar 21 2019, 4:39 AM

Updated test to use root namespace (commented by Ronan).

I was a little bit worried about

struct top_level { int i; };

private ::top_level a;

but it should be fine because in that case we have a tok::coloncolon

Yes, indeed. It parses correctly. I updated the test to demonstrate. :)

This revision is now accepted and ready to land.Mar 21 2019, 10:59 AM

Updated test to use root namespace (commented by Ronan).

Thank you for testing! :-)

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 25 2019, 4:54 AM
jsji added a subscriber: jsji.Mar 26 2019, 2:03 PM

Looks like this may cause some unexpected failures. See https://bugs.llvm.org/show_bug.cgi?id=41247 for more details.

Looks like this may cause some unexpected failures. See https://bugs.llvm.org/show_bug.cgi?id=41247 for more details.

Thanks! I have created a review for the fix: https://reviews.llvm.org/D59874