This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix C-only clang assert on parsing use_allocator clause of target directive
ClosedPublic

Authored by carlo.bertolli on Jun 8 2021, 8:18 AM.

Details

Summary

The parser code assumes building with C++ compiler and asserts when using clang (not clang++) on C file. I made the code dependent on input language. This shows up for amdgpu target.

Diff Detail

Event Timeline

carlo.bertolli created this revision.Jun 8 2021, 8:18 AM
carlo.bertolli requested review of this revision.Jun 8 2021, 8:18 AM

Ah! I forgot to add a reference to a filed bugzilla:
https://bugs.llvm.org/show_bug.cgi?id=50619

I will add a test

cchen added a subscriber: cchen.Jun 9 2021, 9:20 AM

[OpenMP] Add test for C language of target uses_allocators clause

This revision is now accepted and ready to land.Jun 14 2021, 8:30 AM

Nice, thanks. I guess we already have an equivalent test in c++?

Nice, thanks. I guess we already have an equivalent test in c++?

Correct: check clang/test/target_uses_allocators_{messages,codegen}.cpp

@ABataev can you please merge this for me? I still have to ask for commit privileges.

This revision was landed with ongoing or failed builds.Jun 14 2021, 10:39 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2021, 10:39 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript