This commit is contained in:
Mikhalkovich Stanislav 2019-06-21 19:43:01 +03:00
parent 5b3d5b417f
commit fe19dfabee
10 changed files with 51 additions and 9 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "5";
public const string Build = "0";
public const string Revision = "2133";
public const string Revision = "2134";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%MINOR%=5
%REVISION%=2133
%COREVERSION%=0
%REVISION%=2134
%MINOR%=5
%MAJOR%=3

Binary file not shown.

View file

@ -1 +1 @@
!define VERSION '3.5.0.2133'
!define VERSION '3.5.0.2134'

View file

@ -0,0 +1,17 @@
procedure p1();
begin
{$omp parallel for}
for var i:=1 to 10 do
begin
var a: array of integer;
//a := ArrGen(i,x->x);
end;
{$omp parallel sections}
begin
var a: array of integer;
a := ArrGen(2, x -> 0);
end;
end;
begin
end.

View file

@ -0,0 +1,17 @@
procedure p1();
begin
{$omp parallel for}
for var i:=1 to 10 do
begin
var a: array of integer;
//a := ArrGen(i,x->x);
end;
{$omp parallel sections}
begin
var a: array of integer;
a := ArrGen(2, x -> 0);
end;
end;
begin
end.

View file

@ -1,4 +1,5 @@
using System;
using System.Linq;
using PascalABCCompiler.SemanticTree;
using PascalABCCompiler.SyntaxTree;
using PascalABCCompiler.TreeRealization;
@ -180,6 +181,10 @@ namespace PascalABCCompiler.TreeConverter
CurrentParallelPosition = ParallelPosition.Outside;
if (stl != null)
{
var f = _for_node.DescendantNodes().OfType<function_lambda_definition>().FirstOrDefault();
if (f != null)
AddError(get_location(f), "OPENMP_CONTROLLED_CONSTRUCTIONS_CANNOT_CONTAIN_LAMBDAS");
OpenMP.LoopVariables.Pop();
return_value(stl);
return;

View file

@ -17153,9 +17153,12 @@ namespace PascalABCCompiler.TreeConverter
//перед этим узлом есть директива parallel sections
if (CurrentParallelPosition == ParallelPosition.Outside) //входим в самый внешний параллельный sections
{
var f = _statement_list.DescendantNodes().OfType<function_lambda_definition>().FirstOrDefault();
if (f != null)
AddError(get_location(f), "OPENMP_CONTROLLED_CONSTRUCTIONS_CANNOT_CONTAIN_LAMBDAS");
//сгенерировать сначала последовательную ветку, затем параллельную
//устанавливаем флаг и продолжаем конвертирование, считая, что конвертируем последовательную ветку
isGenerateParallel = true;
isGenerateParallel = true;
CurrentParallelPosition = ParallelPosition.InsideSequential;
//в конце за счет флага вернем состояние обратно и сгенерируем и параллельную ветку тоже
}
@ -20358,7 +20361,5 @@ namespace PascalABCCompiler.TreeConverter
visit(mc);*/
}
}
}

View file

@ -25,4 +25,5 @@ UNNAMED_RECORD_CANNOT_IMPLEMENT_INTERFACE=Unnamed records can not implement inte
UNNAMED_RECORD_CANNOT_CONTAIN_METHODS=Unnamed records can not contain methods
UNNAMED_RECORD_CANNOT_CONTAIN_CONSTRUCTORS=Unnamed records can not contain constructors
UNNAMED_RECORD_CAN_CONTAIN_ONLY_ONE_PUBLIC_VISIBILITY_SECTION=Unnamed records can contain only one section with public visibility
UNNAMED_RECORD_CANNOT_CONTAIN_SEVERAL_VISIBILITY_SECTIONS=Unnamed records can not contain several visibility section
UNNAMED_RECORD_CANNOT_CONTAIN_SEVERAL_VISIBILITY_SECTIONS=Unnamed records can not contain several visibility section
OPENMP_CONTROLLED_CONSTRUCTIONS_CANNOT_CONTAIN_LAMBDAS=OpenMP-directive-based constructions cannot contain lambdas

View file

@ -26,4 +26,5 @@ UNNAMED_RECORD_CANNOT_IMPLEMENT_INTERFACE=Безымянные записи не
UNNAMED_RECORD_CANNOT_CONTAIN_METHODS=Безымянные записи не могут содержать методы
UNNAMED_RECORD_CANNOT_CONTAIN_CONSTRUCTORS=Безымянные записи не могут содержать конструкторы
UNNAMED_RECORD_CAN_CONTAIN_ONLY_ONE_PUBLIC_VISIBILITY_SECTION=Безымянные записи могут содержать лишь одну секцию с public-видимостью
UNNAMED_RECORD_CANNOT_CONTAIN_SEVERAL_VISIBILITY_SECTIONS=Безымянные записи не могут содержать несколько секций видимости
UNNAMED_RECORD_CANNOT_CONTAIN_SEVERAL_VISIBILITY_SECTIONS=Безымянные записи не могут содержать несколько секций видимости
OPENMP_CONTROLLED_CONSTRUCTIONS_CANNOT_CONTAIN_LAMBDAS=Лямбда-выражения не могут содержаться внутри конструкций под управлением OpenMP-директив