This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Diagnose missing cases of statements between target and teams directives
ClosedPublic

Authored by davidsh on Jun 22 2016, 12:56 PM.

Details

Summary

Clang fails to diagnose cases such as
#pragma omp target

while(0) {
  #pragma omp teams
  {}
}

Diff Detail

Event Timeline

davidsh retitled this revision from to [OpenMP] Diagnose missing cases of statements between target and teams directives.
davidsh updated this object.
davidsh added a subscriber: cfe-commits.
sfantao edited edge metadata.Jun 22 2016, 2:23 PM

Hi David,

This fix looks good but you have to add a regression test for it.

Thanks,
Samuel

davidsh edited edge metadata.
kkwli0 edited edge metadata.Jun 22 2016, 2:58 PM

The changes look fine to me. Thanks.

Thanks David,

Let's wait for Alexey to see if he has any concerns related to this patch.

Thanks again,
Samuel

ABataev accepted this revision.Jun 22 2016, 9:20 PM
ABataev edited edge metadata.

LG with a small nit

lib/Sema/SemaOpenMP.cpp
6384–6386

I'd prefer something like this:

auto *OED = dyn_cast<OMPExecutableDirective>(S);
OMPTeamsFound = OED && isOpenMPTeamsDirective(OED->getDirectiveKind());
This revision is now accepted and ready to land.Jun 22 2016, 9:20 PM
davidsh edited edge metadata.

Address a comment.

kkwli0 closed this revision.Jun 27 2016, 12:31 PM

At revision: 273908