소스 검색

Improve inlining of generic routines (no matter whether they belong to a generic type or a generics themselves).

psub.pas, read_proc_body: 
  * also try to generate pending specializations before generating a routine's code so that these might be inlined as well

git-svn-id: trunk@33827 -
svenbarth 9 년 전
부모
커밋
ac95dcd7fa
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      compiler/psub.pas

+ 6 - 1
compiler/psub.pas

@@ -2028,7 +2028,12 @@ implementation
         if not isnestedproc then
         if not isnestedproc then
           begin
           begin
             if not(df_generic in current_procinfo.procdef.defoptions) then
             if not(df_generic in current_procinfo.procdef.defoptions) then
-              tcgprocinfo(current_procinfo).generate_code_tree;
+              begin
+                { also generate the bodies for all previously done
+                  specializations so that we might inline them }
+                generate_specialization_procs;
+                tcgprocinfo(current_procinfo).generate_code_tree;
+              end;
           end;
           end;
 
 
         { reset _FAIL as _SELF normal }
         { reset _FAIL as _SELF normal }