diff options
author | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2007-06-03 10:33:50 +0000 |
---|---|---|
committer | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2007-06-03 10:33:50 +0000 |
commit | efe396ed069916fe59120b516320e2515dcd0572 (patch) | |
tree | 83033703097e2286db910cad92d50d7a321f5de6 /compiler/optutils.pas | |
parent | b8ebd3e7bb61e0b52ac0508adabfbeaa23681e2d (diff) | |
download | fpc-efe396ed069916fe59120b516320e2515dcd0572.tar.gz |
+ dfa for more node types
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@7560 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/optutils.pas')
-rw-r--r-- | compiler/optutils.pas | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/compiler/optutils.pas b/compiler/optutils.pas index 4b2171426a..e0fb9dcd02 100644 --- a/compiler/optutils.pas +++ b/compiler/optutils.pas @@ -47,7 +47,7 @@ unit optutils; uses verbose, optbase, - nbas,nflw,nutils; + nbas,nflw,nutils,nset; function TIndexedNodeSet.Add(node : tnode) : boolean; var @@ -142,6 +142,7 @@ unit optutils; function DoSet(p : tnode;succ : tnode) : tnode; var hp1,hp2 : tnode; + i : longint; begin result:=nil; if p=nil then @@ -245,15 +246,36 @@ unit optutils; result:=p; p.successor:=nil; end; - inlinen, - calln, + casen: + begin + result:=p; + DoSet(tcasenode(p).elseblock,succ); + for i:=0 to tcasenode(p).blocks.count-1 do + DoSet(pcaseblock(tcasenode(p).blocks[i])^.statement,succ); + p.successor:=succ; + end; + calln: + begin + { not sure if this is enough (FK) } + result:=p; + p.successor:=succ; + end; + inlinen: + begin + { not sure if this is enough (FK) } + result:=p; + p.successor:=succ; + end; + nothingn: + begin + result:=p; + p.successor:=succ; + end; withn, - casen, tryexceptn, raisen, tryfinallyn, - onn, - nothingn: + onn: internalerror(2007050501); end; end; |