mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 09:49:35 +02:00
* optimize shortstring concatenations if they're on the right side of an assignment to directly use the left side instead of a temporary
This commit is contained in:
parent
32261a0f6d
commit
02aac653d2
@ -3382,7 +3382,13 @@ implementation
|
|||||||
{ create the call to the concat routine both strings as arguments }
|
{ create the call to the concat routine both strings as arguments }
|
||||||
if assigned(aktassignmentnode) and
|
if assigned(aktassignmentnode) and
|
||||||
(aktassignmentnode.right=self) and
|
(aktassignmentnode.right=self) and
|
||||||
(aktassignmentnode.left.resultdef=resultdef) and
|
(
|
||||||
|
(aktassignmentnode.left.resultdef=resultdef) or
|
||||||
|
(
|
||||||
|
is_shortstring(aktassignmentnode.left.resultdef) and
|
||||||
|
is_shortstring(resultdef)
|
||||||
|
)
|
||||||
|
) and
|
||||||
valid_for_var(aktassignmentnode.left,false) then
|
valid_for_var(aktassignmentnode.left,false) then
|
||||||
begin
|
begin
|
||||||
para:=ccallparanode.create(
|
para:=ccallparanode.create(
|
||||||
|
@ -341,7 +341,13 @@ begin
|
|||||||
arrp.allow_array_constructor:=true;
|
arrp.allow_array_constructor:=true;
|
||||||
if assigned(aktassignmentnode) and
|
if assigned(aktassignmentnode) and
|
||||||
(aktassignmentnode.right=p) and
|
(aktassignmentnode.right=p) and
|
||||||
(aktassignmentnode.left.resultdef=p.resultdef) and
|
(
|
||||||
|
(aktassignmentnode.left.resultdef=p.resultdef) or
|
||||||
|
(
|
||||||
|
is_shortstring(aktassignmentnode.left.resultdef) and
|
||||||
|
is_shortstring(p.resultdef)
|
||||||
|
)
|
||||||
|
) and
|
||||||
valid_for_var(aktassignmentnode.left,false) then
|
valid_for_var(aktassignmentnode.left,false) then
|
||||||
begin
|
begin
|
||||||
para:=ccallparanode.create(
|
para:=ccallparanode.create(
|
||||||
|
Loading…
Reference in New Issue
Block a user