Recent

Author Topic: [SOLVED] Why warning message : marked as inline is not inlined  (Read 2741 times)

heejit

  • Full Member
  • ***
  • Posts: 245
Why this warning message and how to correct it.

Is anything am I doing wrong??

Code: Pascal  [Select][+][-]
  1.   AIntegerList = specialize TFPGList<longint>;
  2.  
  3.   a_list := AIntegerList.Create;
  4.   a_list.Add(120); <-- warning message
  5.   a_list.Add(770); <-- warning message
  6.  
  7.   Warning Message:
  8.     Call to subroutine "function TFPGList<System.LongInt>.Add(const Item:LongInt):LongInt;" marked as inline is not inlined
  9.  
  10.  
« Last Edit: August 06, 2018, 12:46:20 pm by jshah »

Thaddy

  • Hero Member
  • *****
  • Posts: 10557
Re: Why warning message : marked as inline is not inlined
« Reply #1 on: August 05, 2018, 09:29:31 pm »
It is not a warning but a hint: the compiler simply tells you it is impossible to inline that code. You can ignore it. Just remember: it is not inlined.
In the future some of these hints may be inlined with compiler improvements. Hence the FGL already has many routines marked as inline.
« Last Edit: August 05, 2018, 09:34:37 pm by Thaddy »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8880
  • FPC developer.
Re: Why warning message : marked as inline is not inlined
« Reply #2 on: August 05, 2018, 09:33:56 pm »
If AIntegerList is defined in a different unit than TFPGLIST<> also try to import the unit with TFPGLIST<> (fgl)

engkin

  • Hero Member
  • *****
  • Posts: 2513
Re: Why warning message : marked as inline is not inlined
« Reply #3 on: August 05, 2018, 11:15:22 pm »
inline directive is handled in psub.pas.

According to tcgprocinfo.generate_code:
Number of nodes generated for the procedure is <= 10
Should not be a nested proc, constructor, destructor

According to checknodeinlining:
It should not have "assembler block", "global goto", or "nested exit"
should not be "inherited"
none of its parameters can be "array of const", "open array", or "out, var, const, constref of formal parameter"

Edit:
In your code, the compiler gave:
Hint: "inherited" not yet supported inside inline procedure/function
« Last Edit: August 05, 2018, 11:25:58 pm by engkin »

heejit

  • Full Member
  • ***
  • Posts: 245
[SOLVED] Re: Why warning message : marked as inline is not inlined
« Reply #4 on: August 06, 2018, 12:46:02 pm »
Thanks for reply

Thaddy

  • Hero Member
  • *****
  • Posts: 10557
Re: Why warning message : marked as inline is not inlined
« Reply #5 on: August 06, 2018, 01:01:17 pm »
Edit:
In your code, the compiler gave:
Hint: "inherited" not yet supported inside inline procedure/function
I am glad you spotted that. That was my answer.

ϻαϻɾΣɀО

  • Jr. Member
  • **
  • Posts: 54
  • MaMrEzO
Re: [SOLVED] Why warning message : marked as inline is not inlined
« Reply #6 on: September 10, 2018, 04:03:28 am »
Just for Note:
Calling an inlined method inside a class with demonstrated conditions in the FreePascal documentations is allowed,
But what happens when calling that method in derived classes?
It seems that not inlined and will call naturally...

Can anyone confirm this?
If yes why not declared anywhere? Like here: https://www.freepascal.org/docs-html/ref/refsu73.html#x191-21300014.10.4

I'd just experienced it tonight when I attempted to figure out why and what calls to an inlined method not inlined, Then I found two calls
without warnings in the base class and other calls in derived classes marked with the warning... 
Debio-Sql is a new brand of GUI Database tool for the Firebird RDBMS.
http://debio-sql.ariaian.com/

 

TinyPortal © 2005-2018