Quellcode durchsuchen

+ new pio_inline_forbidden flag to indicate that while parsing the
implementation the compiler determined the routine must never be
inlined
o difference with po_noinline: can also be set in the implementation
o difference with pio_inline_not_possible: it indicates that e.g.
LLVM must not inline the routine either

git-svn-id: trunk@44065 -

Jonas Maebe vor 5 Jahren
Ursprung
Commit
254b85c352
4 geänderte Dateien mit 10 neuen und 3 gelöschten Zeilen
  1. 2 1
      compiler/llvm/agllvm.pas
  2. 3 0
      compiler/psub.pas
  3. 3 1
      compiler/symconst.pas
  4. 2 1
      compiler/utils/ppuutils/ppudump.pp

+ 2 - 1
compiler/llvm/agllvm.pas

@@ -1010,7 +1010,8 @@ implementation
             writer.AsmWrite(' returns_twice');
             writer.AsmWrite(' returns_twice');
           if po_inline in pd.procoptions then
           if po_inline in pd.procoptions then
             writer.AsmWrite(' inlinehint');
             writer.AsmWrite(' inlinehint');
-          if po_noinline in pd.procoptions then
+          if (po_noinline in pd.procoptions) or
+             (pio_inline_forbidden in pd.implprocoptions) then
             writer.AsmWrite(' noinline');
             writer.AsmWrite(' noinline');
           { ensure that functions that happen to have the same name as a
           { ensure that functions that happen to have the same name as a
             standard C library function, but which are implemented in Pascal,
             standard C library function, but which are implemented in Pascal,

+ 3 - 0
compiler/psub.pas

@@ -211,6 +211,9 @@ implementation
         if pi_uses_get_frame in current_procinfo.flags then
         if pi_uses_get_frame in current_procinfo.flags then
           begin
           begin
             _no_inline('get_frame');
             _no_inline('get_frame');
+            { for LLVM: it can inline things that FPC can't, but it mustn't
+              inline this one }
+            include(current_procinfo.procdef.implprocoptions,pio_inline_forbidden);
             exit;
             exit;
           end;
           end;
 
 

+ 3 - 1
compiler/symconst.pas

@@ -442,7 +442,9 @@ type
     { a stub/thunk }
     { a stub/thunk }
     pio_thunk,
     pio_thunk,
     { compiled with fastmath enabled }
     { compiled with fastmath enabled }
-    pio_fastmath
+    pio_fastmath,
+    { inline is forbidden (calls get_frame) }
+    pio_inline_forbidden
   );
   );
   timplprocoptions = set of timplprocoption;
   timplprocoptions = set of timplprocoption;
 
 

+ 2 - 1
compiler/utils/ppuutils/ppudump.pp

@@ -3218,7 +3218,8 @@ const
     (mask:pio_inline_not_possible; str:'InlineNotPossible'),
     (mask:pio_inline_not_possible; str:'InlineNotPossible'),
     (mask:pio_nested_access; str:'NestedAccess'),
     (mask:pio_nested_access; str:'NestedAccess'),
     (mask:pio_thunk; str:'Thunk'),
     (mask:pio_thunk; str:'Thunk'),
-    (mask:pio_fastmath; str:'FastMath')
+    (mask:pio_fastmath; str:'FastMath'),
+    (mask:pio_inline_forbidden; str:'InlineForbidden')
   );
   );
 var
 var
   i: timplprocoption;
   i: timplprocoption;