mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 00:28:23 +02:00
* detect static data use by record methods and methods of nested classes/
records, so we avoid inlining them (mantis #25598) git-svn-id: trunk@26617 -
This commit is contained in:
parent
b611882337
commit
c05da62b0e
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -13796,6 +13796,7 @@ tests/webtbs/tw2536.pp svneol=native#text/plain
|
||||
tests/webtbs/tw25361.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2540.pp svneol=native#text/plain
|
||||
tests/webtbs/tw25551.pp svneol=native#text/plain
|
||||
tests/webtbs/tw25598.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2561.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2588.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2589.pp svneol=native#text/plain
|
||||
@ -14572,6 +14573,7 @@ tests/webtbs/uw25059.pp svneol=native#text/pascal
|
||||
tests/webtbs/uw25059.test.pp svneol=native#text/pascal
|
||||
tests/webtbs/uw25059.withdot.pp svneol=native#text/pascal
|
||||
tests/webtbs/uw25132.pp svneol=native#text/pascal
|
||||
tests/webtbs/uw25598.pp svneol=native#text/plain
|
||||
tests/webtbs/uw2706a.pp svneol=native#text/plain
|
||||
tests/webtbs/uw2706b.pp svneol=native#text/plain
|
||||
tests/webtbs/uw2731.pp svneol=native#text/plain
|
||||
|
@ -3449,7 +3449,7 @@ implementation
|
||||
{ Check if we can inline the procedure when it references proc/var that
|
||||
are not in the globally available }
|
||||
st:=procdefinition.owner;
|
||||
if (st.symtabletype=ObjectSymtable) then
|
||||
while (st.symtabletype in [ObjectSymtable,recordsymtable]) do
|
||||
st:=st.defowner.owner;
|
||||
if (pi_uses_static_symtable in tprocdef(procdefinition).inlininginfo^.flags) and
|
||||
(st.symtabletype=globalsymtable) and
|
||||
|
6
tests/webtbs/tw25598.pp
Normal file
6
tests/webtbs/tw25598.pp
Normal file
@ -0,0 +1,6 @@
|
||||
uses uw25598;
|
||||
|
||||
begin
|
||||
TR.Foo; // Error: Undefined symbol: TC_$R03U01_$$_C
|
||||
end.
|
||||
|
22
tests/webtbs/uw25598.pp
Normal file
22
tests/webtbs/uw25598.pp
Normal file
@ -0,0 +1,22 @@
|
||||
unit uw25598;
|
||||
|
||||
{$mode delphi}
|
||||
|
||||
interface
|
||||
|
||||
type
|
||||
TR = record
|
||||
class function Foo: Integer; static; inline;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
const
|
||||
C: array[0..0] of byte = (0);
|
||||
|
||||
class function TR.Foo: Integer; inline;
|
||||
begin
|
||||
Result := C[0];
|
||||
end;
|
||||
|
||||
end.
|
Loading…
Reference in New Issue
Block a user