Compiler Optimizations
From The Oxygene Language Wiki
This is a Language topic
Feel free to add your notes to this topic below.
The compiler does several optimizations during the code generation. Among them are:
- Integer and Float constants and standard operations on them are evaluated and only the result is emitted into code.
- String and char constants are concatenated during compilation.
- Concatenating multiple strings uses the multiple parameter overloads of String.Concat.
- Calls to non-virtual empty methods are dropped.
- Private/assembly empty methods that are not called are dropped from the result.
- References that are not used are dropped from the result.
- Ret and code after an exit/break/raise are removed.
- Unreachable code is removed (and warned about).
- Inline local variables are only initialized to their default value if they are not always assigned.
- If statements with an expression that can never be true are removed.
Area: Oxygene Language
Compiler version: Oxygene 5
Language Glossary — Keywords — Types — FAQ — How To