PRAGMA_INLINE (Overloading) [message #634956] |
Wed, 18 March 2015 06:33 |
|
vippysharma
Messages: 73 Registered: May 2013 Location: www
|
Member |
|
|
Hii all,
How PRAGMA INLINE behaves in case of Overloading Subprogrammes.
Ex:
-------------------------------------------------------------------------------------
procedure p1(m number); ----------
procedure p1(n char); ----------
------------------
PRAGMA INLINE(p1,'YES');
PRAGMA INLINE(p1,'NO');
PRAGMA INLINE(p1,'YES');
-------------------------------
X:=P1(2)+3; -S1------------
Y:=P1('HELLO'); -S2------------
---------------------------------------------------------------------------------------
S1 or S2 will be inlined or not ?
[Updated on: Wed, 18 March 2015 06:34] Report message to a moderator
|
|
|
|
Re: PRAGMA_INLINE (Overloading) [message #634985 is a reply to message #634956] |
Wed, 18 March 2015 11:01 |
Solomon Yakobson
Messages: 3269 Registered: January 2010 Location: Connecticut, USA
|
Senior Member |
|
|
Documentation clearly states: If the name of the subprogram (identifier) is overloaded (that is, if it belongs to more than one subprogram), the INLINE pragma applies to every subprogram with that name. Same documentation also states: PRAGMA INLINE ... 'NO' overrides PRAGMA INLINE ... 'YES' for the same subprogram, regardless of their order in the code. So answer to "S1 or S2 will be inlined or not?" is no.
SY.
|
|
|