summaryrefslogtreecommitdiff
path: root/compiler/pass_1.pas
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-03-13 22:27:55 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-03-13 22:27:55 +0000
commitab8f27bd6dfbfa4a2105b60e0974280b93b1c005 (patch)
tree951f27126ee1fe382e0c9357b39790910a6e9046 /compiler/pass_1.pas
parent1eab1aedda302b6da25d0c313a7eb124d4263540 (diff)
downloadfpc-ab8f27bd6dfbfa4a2105b60e0974280b93b1c005.tar.gz
+ support for simplifying simple inline functions down to a single
constant node (rather than to just a blocknode with a statement assigning a constant to a temp) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@6832 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/pass_1.pas')
-rw-r--r--compiler/pass_1.pas14
1 files changed, 13 insertions, 1 deletions
diff --git a/compiler/pass_1.pas b/compiler/pass_1.pas
index 4faa88c5c7..8efd883e15 100644
--- a/compiler/pass_1.pas
+++ b/compiler/pass_1.pas
@@ -170,7 +170,19 @@ implementation
firstpass(hp);
{ switch to new node }
p:=hp;
- end;
+ end
+ else
+ begin
+ { inlining happens in pass_1 and can cause new }
+ { simplify opportunities }
+ hp:=p.simplify;
+ if assigned(hp) then
+ begin
+ p.free;
+ firstpass(hp);
+ p:=hp;
+ end;
+ end;
if codegenerror then
include(p.flags,nf_error)
else