[fpc-pascal] Inline and defines
Alexander Todorov
alexx.todorov at gmail.com
Tue Jan 23 17:19:08 CET 2007
Hello,
What is the name of the conditional when we have inline on?
I thought I can do {$IFDEF HASINLINE} but it doesn't work?
Can you point me to some documentation please?
At http://community.freepascal.org:10000/docs-html/prog/progap7.html#x308-310000G
I don't see conditionals for the inline option.
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:
.type P$TEST_MYPROC, at function
P$TEST_MYPROC:
pushl %ebp
movl %esp,%ebp
leave
ret
.Le0:
.size P$TEST_MYPROC, .Le0 - P$TEST_MYPROC
Wouldn't it be a better optimization if the compiler does not generate any code?
Any explanation and/or comments are welcome.
Greeting to all.
Alexander.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.pas
Type: text/x-pascal
Size: 179 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20070123/a8f5d316/attachment.pas>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.s.MORE_CODE
Type: application/octet-stream
Size: 2830 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20070123/a8f5d316/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.s.NO_MORE_CODE
Type: application/octet-stream
Size: 2282 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20070123/a8f5d316/attachment-0001.obj>
More information about the fpc-pascal
mailing list