- 编译选项编译指示
编译选项编译指示
此处列出的编译指示可用于覆盖proc/method/converter的代码生成选项。
该实现目前提供以下可能的选项(稍后可以添加各种其他选项)。
| pragma | allowed values | description |
|---|---|---|
| checks | on|off | Turns the code generation for all runtime checks on or off. |
| boundChecks | on|off | Turns the code generation for array bound checks on or off. |
| overflowChecks | on|off | Turns the code generation for over- or underflow checks on or off. |
| nilChecks | on|off | Turns the code generation for nil pointer checks on or off. |
| assertions | on|off | Turns the code generation for assertions on or off. |
| warnings | on|off | Turns the warning messages of the compiler on or off. |
| hints | on|off | Turns the hint messages of the compiler on or off. |
| optimization | none|speed|size | Optimize the code for speed or size, or disable optimization. |
| patterns | on|off | Turns the term rewriting templates/macros on or off. |
| callconv | cdecl|… | Specifies the default calling convention for all procedures (and procedure types) that follow. |
示例:
- {.checks: off, optimization: speed.}
- # 编译时没有运行时检查并优化速度
