[PATCH] D51378: [OPENMP] Add support for nested 'declare target' directives

Patrick Lyster via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 30 11:45:26 PDT 2018


patricklyster added a comment.

In https://reviews.llvm.org/D51378#1219474, @RaviNarayanaswamy wrote:

> I did not see the code where check is done if Nestingdepth is 0 at end of compilation.


Sorry I should clarify. You will get an error if you have an unmatched `#pragma omp declare target` once you reach the end of the compilation unit (not the header file) because execution will exit the while loop in ParseOpenMP.cpp:774 when it encounters a `tok::eof` and fall into the `else` statement on ParseOpenMP.cpp:812 which emits the diagnostic. So it is not explicitly checking if DeclareTargetNestingLevel > 0 but you will see an appropriate diagnostic anyways.


Repository:
  rC Clang

https://reviews.llvm.org/D51378





More information about the cfe-commits mailing list