From 3c74051661a91e4f954a3eda891994868f3183ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=B7=D0=B4=D0=B0=D0=B9=D1=89=D0=B8=D0=BA?= Date: Sat, 16 May 2020 00:09:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=93=D0=B5=D0=BD=D0=B5=D1=80=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=82=D0=B5=D0=BA=D1=81=D1=82=D0=BE=D0=B2=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=20=D1=81=D0=BE?= =?UTF-8?q?=C2=A0=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=BE=D0=BC=20=D1=81=D1=83?= =?UTF-8?q?=D1=84=D1=84=D0=B8=D0=BA=D1=81=D0=BE=D0=B2=20=D0=BB=D0=BE=D0=BA?= =?UTF-8?q?=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D1=85=20=D1=84=D1=83=D0=BD=D0=BA?= =?UTF-8?q?=D1=86=D0=B8=D0=B9=20(#255)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Если включена опция -OG, генерируется файл %TARGET%-locals.lst, где перечисляются суффиксы ~n, добавляемые к локальным функциям каждой единицы трансляции. Скрипты сборки Рефала-5λ перемещают эти файлы (если они есть) в соответствующие подпапки папки build. --- autotests/dynamic/D-multiple-entry/run.bat | 2 +- autotests/dynamic/D-multiple-entry/run.sh | 2 +- src/compiler/Engine.ref | 5 +++-- src/compiler/main.ref | 14 +++++++++----- src/make.bat | 1 + src/make.sh | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/autotests/dynamic/D-multiple-entry/run.bat b/autotests/dynamic/D-multiple-entry/run.bat index 8e43bf34..f3dd1e3b 100644 --- a/autotests/dynamic/D-multiple-entry/run.bat +++ b/autotests/dynamic/D-multiple-entry/run.bat @@ -16,5 +16,5 @@ if exist target.rasl-module ( exit /b 1 ) else ( echo Test OK: compiler found expected errors! - erase *.rasl-module *.rasl *.exe + erase *.rasl-module *.rasl *.exe *-locals.lst ) diff --git a/autotests/dynamic/D-multiple-entry/run.sh b/autotests/dynamic/D-multiple-entry/run.sh index 24ea7d60..88ccf63c 100755 --- a/autotests/dynamic/D-multiple-entry/run.sh +++ b/autotests/dynamic/D-multiple-entry/run.sh @@ -17,5 +17,5 @@ if [[ -e target.rasl-module ]]; then exit 1 else echo Test OK: compiler found expected errors! - rm -f *.rasl-module *.rasl caller + rm -f *.rasl-module *.rasl caller *-locals.lst fi diff --git a/src/compiler/Engine.ref b/src/compiler/Engine.ref index c4de9020..0da6b1b7 100644 --- a/src/compiler/Engine.ref +++ b/src/compiler/Engine.ref @@ -698,7 +698,7 @@ $ENTRY GlobalASTStorage-Create { /** - == t.ASTStorage^ + == t.ASTStorage^ s.Id */ $ENTRY GlobalASTStorage-AddAST { ((s.NextLocalId e.Entries) e.ASTs) e.AST @@ -733,7 +733,8 @@ $ENTRY GlobalASTStorage-AddAST { = ( ( e.Entries) e.ASTs - ); + ) + s.NextLocalId; } UpdateAccum { diff --git a/src/compiler/main.ref b/src/compiler/main.ref index d7430665..0d578b14 100644 --- a/src/compiler/main.ref +++ b/src/compiler/main.ref @@ -379,11 +379,13 @@ CompileFiles { CompileFiles-GlobalOpt { t.Config e.Files = : e.TargetName + = : s.LstFile = e.Files > + : t.ASTStorage e.Outputs = (RASL Given e.OutputName); - t.Config t.ASTStorage (s.Pos Output e.OutputName (e.NativeName)) + t.Config s.LstFile t.ASTStorage (s.Pos Output e.OutputName (e.NativeName)) = t.ASTStorage (RASL Given e.OutputName) (Native Given e.NativeName); - t.Config t.ASTStorage (s.Pos Source (s.Dialect e.Source) e.OutputName '.rasl') + t.Config s.LstFile t.ASTStorage + (s.Pos Source (s.Dialect e.Source) e.OutputName '.rasl') = : { @@ -411,8 +414,9 @@ CompileFiles-GlobalOpt-EachFile { ; Success NoNative e.AST - = : t.ASTStorage^ + = : t.ASTStorage^ s.Id = t.ASTStorage + ' -- ' e.Source> /* генерация откладывается */; Fails = t.ASTStorage Fails; diff --git a/src/make.bat b/src/make.bat index 6129d06d..098ee175 100644 --- a/src/make.bat +++ b/src/make.bat @@ -55,6 +55,7 @@ setlocal if exist *.obj erase *.obj if exist *.tds erase *.tds move *.rasl ..\..\build\%DIR% >NUL + if exist *-locals.lst move *-locals.lst ..\..\build\%DIR% >NUL if exist *.cpp move *.cpp ..\..\build\%DIR% >NUL if exist ..\common\*.rasl move ..\common\*.rasl ..\..\build\%DIR% >NUL if exist ..\common\*.cpp move ..\common\*.cpp ..\..\build\%DIR% >NUL diff --git a/src/make.sh b/src/make.sh index 0d866e7a..0e02fc76 100755 --- a/src/make.sh +++ b/src/make.sh @@ -72,7 +72,7 @@ TARGET_SUFFIX=${TARGET_SUFFIX:-} mkdir -p "../../build/$DIR" rm -f "../../build/$DIR/"* find . ../common \ - \( -name '*.rasl' -o -name '*.cpp' \) \ + \( -name '*.rasl' -o -name '*.cpp' -o -name '*-locals.lst' \) \ -exec mv '{}' "../../build/$DIR" \; cp ${PATH_TO_RLC}/lib/scratch{/exe,-rt{/debug-stubs,/exe,}}/*.{rasl,cpp} \ "../../build/$DIR"