18.09.2012, 13:24
The compiler is single-threaded, unfortunately, which means a faster clock speed on the processor and faster RAM memory would be the only way to increase its speed (hardware folks, feel free to correct me on this one).
The first thing the compiler does, as indicated by the name, is pre-process your code. It will basically start from the main file you chose to compile, replace all #include by their actual code (unless #endinput or file already included).
After that, it will go from top to bottom and replace macros. It will never go backwards and replace macros, and it won't do it again (only in the same position).
You can see this output by compiling with the -l (capital L) flag, which generates a single, pre-processed file (can be useful for macro debugging).
After that, it will work that single file from top to bottom, storing all enums, global variables, functions, and such.
If everything checks out, all used functions/variables will then be generated into AMX opcodes (those you write with #emit). Function names and variables becomes mere memory addresses. Constants become single values.
After the AMX opcodes are generated, it start writing the names of public functions/variables/tags and their respective addresses into the AMX file. Also other stuff that I don't feel the need to go into detail on. You can read about this in the PAWN Implementer's Guide if interested.
After writing the initial info, the AMX opcodes will be written, as raw data (not in text like #emit).
If you compiled with -d2/3, debug information will be written at the end of the file. The debug information basically contains names of all functions/variables and what addresses they point to - this is what crashdetect uses to help you find errors.
I didn't go into depth because it'd probably be too overwhelming, and this information was just written off the top of my head so it might not be completely accurate. Ask some questions and I'll try to answer them!
The first thing the compiler does, as indicated by the name, is pre-process your code. It will basically start from the main file you chose to compile, replace all #include by their actual code (unless #endinput or file already included).
After that, it will go from top to bottom and replace macros. It will never go backwards and replace macros, and it won't do it again (only in the same position).
You can see this output by compiling with the -l (capital L) flag, which generates a single, pre-processed file (can be useful for macro debugging).
After that, it will work that single file from top to bottom, storing all enums, global variables, functions, and such.
If everything checks out, all used functions/variables will then be generated into AMX opcodes (those you write with #emit). Function names and variables becomes mere memory addresses. Constants become single values.
After the AMX opcodes are generated, it start writing the names of public functions/variables/tags and their respective addresses into the AMX file. Also other stuff that I don't feel the need to go into detail on. You can read about this in the PAWN Implementer's Guide if interested.
After writing the initial info, the AMX opcodes will be written, as raw data (not in text like #emit).
If you compiled with -d2/3, debug information will be written at the end of the file. The debug information basically contains names of all functions/variables and what addresses they point to - this is what crashdetect uses to help you find errors.
I didn't go into depth because it'd probably be too overwhelming, and this information was just written off the top of my head so it might not be completely accurate. Ask some questions and I'll try to answer them!