This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP50]Basic support for uses_allocators clause.
ClosedPublic

Authored by ABataev on Apr 21 2020, 10:57 AM.

Details

Summary

Added parsing/sema/serialization supoprt for uses_allocators clause.

Diff Detail

Event Timeline

ABataev created this revision.Apr 21 2020, 10:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2020, 10:57 AM
jdoerfert added a subscriber: rnk.Apr 22 2020, 9:30 AM
jdoerfert added inline comments.
clang/include/clang/Sema/Sema.h
33

I think @rnk might not be happy with this include as it might be costly.

ABataev updated this revision to Diff 259400.Apr 22 2020, 2:31 PM

Avoid inclusion of OpenMPClause.h in Sema.h

jdoerfert accepted this revision.Apr 30 2020, 9:06 AM

A few nits and one question/concern below. Once/If that one is addressed this LGTM.

clang/lib/Sema/SemaOpenMP.cpp
4809

Note: We should keep the OpenMP context available all the time and ask it for required clauses. That has to be done later though.

18604

Nit: Typo

18614

Nit: I guess after the condition below these three lines can be placed as bool IsPredefinedAllocator = PredefinedAllocators.count(DRE->getDecl());

clang/test/OpenMP/target_uses_allocators_messages.cpp
55

Do we handle/test the case where the trait array is empty?

omp_alloctrait_t empty_traits[0];

I guess that doesn't mean much and we should error out?

This revision is now accepted and ready to land.Apr 30 2020, 9:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 30 2020, 9:06 AM
ABataev marked 5 inline comments as done.Apr 30 2020, 12:20 PM
ABataev added inline comments.
clang/lib/Sema/SemaOpenMP.cpp
18614

IsPredefinedAllocator is used in the condition itself

clang/test/OpenMP/target_uses_allocators_messages.cpp
55

Runtime supports it, returns default allocator in this case.

This revision was automatically updated to reflect the committed changes.
ABataev marked 2 inline comments as done.