summaryrefslogtreecommitdiff
path: root/flang/lib/Semantics/check-directive-structure.h
diff options
context:
space:
mode:
authorYashaswini <yhegde@gmail.com>2021-01-14 18:34:09 +0530
committerYashaswini <yhegde@gmail.com>2021-01-14 18:34:09 +0530
commita176ffa6248a37a84439cc311e7faf60f17ea78c (patch)
treeef39c15bac90163d565fb043d04e1f3509b023ac /flang/lib/Semantics/check-directive-structure.h
parent2b1e25befefc20f012aa49011f46e11e8530ee21 (diff)
downloadllvm-maste.tar.gz
Add Semantic check for Flang OpenMP 4.5 - 2.7.1 Do Loop restrictions on single directive and firstprivate clause.maste
Semantic checks added to check the worksharing 'single' region closely nested inside a worksharing 'do' region. And also to check whether the DO iteration variable is a variable in Firstprivate clause. Files: check-directive-structure.h check-omp-structure.h check-omp-structure.cpp Testcases: omp-do01-positivecase.f90 omp-do01.f90 omp-do05-positivecase.f90 omp-do05.f90 Reviewed by: Kiran Chandramohan @kiranchandramohan , Valentin Clement @clementval Differential Revision: https://reviews.llvm.org/D93205
Diffstat (limited to 'flang/lib/Semantics/check-directive-structure.h')
-rw-r--r--flang/lib/Semantics/check-directive-structure.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/flang/lib/Semantics/check-directive-structure.h b/flang/lib/Semantics/check-directive-structure.h
index 1075087feb4f..b93287e8c8dd 100644
--- a/flang/lib/Semantics/check-directive-structure.h
+++ b/flang/lib/Semantics/check-directive-structure.h
@@ -139,8 +139,11 @@ protected:
const PC *clause{nullptr};
std::multimap<C, const PC *> clauseInfo;
std::list<C> actualClauses;
+ Symbol *loopIV{nullptr};
};
+ void SetLoopIv(Symbol *symbol) { GetContext().loopIV = symbol; }
+
// back() is the top of the stack
DirectiveContext &GetContext() {
CHECK(!dirContext_.empty());
@@ -160,6 +163,7 @@ protected:
GetContext().allowedExclusiveClauses = {};
GetContext().requiredClauses = {};
GetContext().clauseInfo = {};
+ GetContext().loopIV = {nullptr};
}
void SetContextDirectiveSource(const parser::CharBlock &directive) {