[fpc-pascal] Inline and defines

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Jan 24 10:49:07 CET 2007


On 23 Jan 2007, at 17:19, Alexander Todorov wrote:

> What is the name of the conditional when we have inline on?
> I thought I can do {$IFDEF HASINLINE} but it doesn't work?

HASINLINE is simply a temporary internal compiler define which was  
introduced to indicate that the compiler supports the "inline"  
directive. It is not to be used your own code, since it will be  
removed from the compiler (it even has already been removed from  
2.1.1, and may not even exist anymore in 2.0.4).

I don't think the compiler defines a symbol when inlining is turned  
on. As of 2.1.1, it won't matter anymore either since the compiler  
will always accept the inline specifier, but only actually do  
something with it if inlining is turned on.

> Also another question about inline:
> In the attached test project when compiled with
> fpc -XX -a test.pas small code is generated for the MyProc procedure
> that does nothing in this case (MORE_CODE is not defined).
> I do not uderstand assembler code very well but I see there some
> instructions when entering the procedure and when  returning from it:

That is not about inlining, but about stackframes. Stackframe  
optimization is implemented in 2.1.1 as well.


Jonas





More information about the fpc-pascal mailing list