Commit 0edf7f03 authored by rpenacob's avatar rpenacob
Browse files

In this release label is ignored and reduction throws an error

parent 09b1d65e
......@@ -1216,6 +1216,8 @@ def err_openclcxx_virtual_function : Error<
"virtual functions are not supported in C++ for OpenCL">;
// OmpSs support.
def warn_oss_ignoring_clause : Warning<
"unsupported OmpSs-2 clause '%0' in directive '#pragma oss %1' - ignoring">;
def warn_pragma_oss_ignored : Warning<
"unexpected '#pragma oss ...' in program">, InGroup<SourceUsesOmpSs>, DefaultIgnore;
def err_oss_unexpected_directive : Error<
......
......@@ -100,7 +100,7 @@ OMPSS_TASK_CLAUSE(private)
OMPSS_TASK_CLAUSE(firstprivate)
OMPSS_TASK_CLAUSE(shared)
OMPSS_TASK_CLAUSE(depend)
OMPSS_TASK_CLAUSE(reduction)
// OMPSS_TASK_CLAUSE(reduction)
OMPSS_TASK_CLAUSE(in)
OMPSS_TASK_CLAUSE(out)
OMPSS_TASK_CLAUSE(inout)
......@@ -110,7 +110,7 @@ OMPSS_TASK_CLAUSE(weakin)
OMPSS_TASK_CLAUSE(weakout)
OMPSS_TASK_CLAUSE(weakinout)
OMPSS_TASK_CLAUSE(weakcommutative)
OMPSS_TASK_CLAUSE(weakreduction)
// OMPSS_TASK_CLAUSE(weakreduction)
// Clauses allowed for OmpSs directive 'taskwait'.
OMPSS_TASKWAIT_CLAUSE(depend)
......
......@@ -434,6 +434,7 @@ public:
const TargetInfo &getTargetInfo() const { return PP.getTargetInfo(); }
Preprocessor &getPreprocessor() const { return PP; }
Sema &getActions() const { return Actions; }
DiagnosticsEngine &getDiags() const { return Diags; }
AttributeFactory &getAttrFactory() { return AttrFactory; }
const Token &getCurToken() const { return Tok; }
......
......@@ -273,7 +273,12 @@ static bool parseDeclareTaskClauses(
case OSSC_priority:
case OSSC_label: {
P.ConsumeToken();
if (FirstClauses[CKind]) {
bool IsLabel = CKind == OSSC_label;
if (IsLabel) {
P.Diag(Tok, diag::warn_oss_ignoring_clause)
<< getOmpSsClauseName(CKind) << getOmpSsDirectiveName(OSSD_declare_task);
}
if (FirstClauses[CKind] && !IsLabel) {
P.Diag(Tok, diag::err_oss_more_one_clause)
<< getOmpSsDirectiveName(OSSD_declare_task) << getOmpSsClauseName(CKind) << 0;
IsError = true;
......@@ -282,9 +287,11 @@ static bool parseDeclareTaskClauses(
SingleClause = getSingleClause(CKind, IfRes, FinalRes,
CostRes, PriorityRes,
LabelRes);
P.getDiags().setSuppressAllDiagnostics(IsLabel);
*SingleClause = P.ParseOmpSsParensExpr(getOmpSsClauseName(CKind), RLoc);
P.getDiags().setSuppressAllDiagnostics(false);
if (SingleClause->isInvalid())
if (SingleClause->isInvalid() && !IsLabel)
IsError = true;
FirstClauses[CKind] = true;
......@@ -714,14 +721,22 @@ OSSClause *Parser::ParseOmpSsClause(OmpSsDirectiveKind DKind,
case OSSC_final:
case OSSC_cost:
case OSSC_priority:
case OSSC_label:
if (!FirstClause) {
case OSSC_label: {
bool IsLabel = CKind == OSSC_label;
if (IsLabel) {
Diag(Tok, diag::warn_oss_ignoring_clause)
<< getOmpSsClauseName(CKind) << getOmpSsDirectiveName(OSSD_task);
}
if (!FirstClause && !IsLabel) {
Diag(Tok, diag::err_oss_more_one_clause)
<< getOmpSsDirectiveName(DKind) << getOmpSsClauseName(CKind) << 0;
ErrorFound = true;
}
Diags.setSuppressAllDiagnostics(IsLabel);
Clause = ParseOmpSsSingleExprClause(CKind, WrongDirective);
Diags.setSuppressAllDiagnostics(false);
break;
}
case OSSC_wait:
if (!FirstClause) {
Diag(Tok, diag::err_oss_more_one_clause)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment