Просмотр исходного кода

* store/load tloopnode.loopflags to/from ppu files so that for/repeat/while
loops are correctly inlined (mantis #17493)

git-svn-id: trunk@16106 -

Jonas Maebe 15 лет назад
Родитель
Сommit
92997a0249
5 измененных файлов с 35 добавлено и 1 удалено
  1. 2 0
      .gitattributes
  2. 2 0
      compiler/nflw.pas
  3. 1 1
      compiler/ppu.pas
  4. 10 0
      tests/webtbs/tw17493.pp
  5. 20 0
      tests/webtbs/uw17493.pp

+ 2 - 0
.gitattributes

@@ -10690,6 +10690,7 @@ tests/webtbs/tw17413.pp svneol=native#text/plain
 tests/webtbs/tw17430.pp svneol=native#text/plain
 tests/webtbs/tw1744.pp svneol=native#text/plain
 tests/webtbs/tw17458.pp svneol=native#text/plain
+tests/webtbs/tw17493.pp svneol=native#text/plain
 tests/webtbs/tw17514.pp svneol=native#text/plain
 tests/webtbs/tw17546.pp svneol=native#text/plain
 tests/webtbs/tw1754c.pp svneol=native#text/plain
@@ -11549,6 +11550,7 @@ tests/webtbs/uw14958.pp svneol=native#text/plain
 tests/webtbs/uw15909.pp svneol=native#text/plain
 tests/webtbs/uw17220.pp svneol=native#text/plain
 tests/webtbs/uw17220a.pp svneol=native#text/plain
+tests/webtbs/uw17493.pp svneol=native#text/plain
 tests/webtbs/uw2004.inc svneol=native#text/plain
 tests/webtbs/uw2040.pp svneol=native#text/plain
 tests/webtbs/uw2266a.inc svneol=native#text/plain

+ 2 - 0
compiler/nflw.pas

@@ -934,6 +934,7 @@ implementation
         inherited ppuload(t,ppufile);
         t1:=ppuloadnode(ppufile);
         t2:=ppuloadnode(ppufile);
+        ppufile.getsmallset(loopflags);
       end;
 
 
@@ -942,6 +943,7 @@ implementation
         inherited ppuwrite(ppufile);
         ppuwritenode(ppufile,t1);
         ppuwritenode(ppufile,t2);
+        ppufile.putsmallset(loopflags);
       end;
 
 

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion = 120;
+  CurrentPPUVersion = 121;
 
 { buffer sizes }
   maxentrysize = 1024;

+ 10 - 0
tests/webtbs/tw17493.pp

@@ -0,0 +1,10 @@
+{ %recompile }
+
+{$inline on}
+
+uses
+  uw17493;
+
+begin
+  test;
+end.

+ 20 - 0
tests/webtbs/uw17493.pp

@@ -0,0 +1,20 @@
+{$inline on}
+
+unit uw17493;
+
+interface
+
+procedure test; inline;
+
+implementation
+
+procedure test; inline;
+var
+  a: boolean;
+begin
+  a:=paramcount>100;
+  while a do
+    halt(1);
+end;
+
+end.