[OPENMP 4.0] Support for 'inbranch|noinbranch' clauses in 'declare
simd'.
Added parsing/semantic analysis for 'inbranch|notinbranch' clauses of
'#pragma omp declare simd' construct.
llvm-svn: 265287
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 6458eee..8d53dc4 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -3183,12 +3183,13 @@
Sema::DeclGroupPtrTy
Sema::ActOnOpenMPDeclareSimdDirective(DeclGroupPtrTy DG,
- SourceLocation StartLoc) {
+ OMPDeclareSimdDeclAttr::BranchStateTy BS,
+ SourceRange SR) {
if (!DG || DG.get().isNull())
return DeclGroupPtrTy();
if (!DG.get().isSingleDecl()) {
- Diag(StartLoc, diag::err_omp_single_decl_in_declare_simd);
+ Diag(SR.getBegin(), diag::err_omp_single_decl_in_declare_simd);
return DG;
}
auto *ADecl = DG.get().getSingleDecl();
@@ -3201,8 +3202,7 @@
return DeclGroupPtrTy();
}
- auto *NewAttr = OMPDeclareSimdDeclAttr::CreateImplicit(
- Context, SourceRange(StartLoc, StartLoc));
+ auto *NewAttr = OMPDeclareSimdDeclAttr::CreateImplicit(Context, BS, SR);
ADecl->addAttr(NewAttr);
return ConvertDeclToDeclGroup(ADecl);
}