编译选项编译指示

此处列出的编译指示可用于覆盖proc/method/converter的代码生成选项。

该实现目前提供以下可能的选项(稍后可以添加各种其他选项)。

pragmaallowed valuesdescription
checkson|off Turns the code generation for all runtime checks on or off.
boundCheckson|off Turns the code generation for array bound checks on or off.
overflowCheckson|off Turns the code generation for over- or underflow checks on or off.
nilCheckson|off Turns the code generation for nil pointer checks on or off.
assertionson|off Turns the code generation for assertions on or off.
warningson|off Turns the warning messages of the compiler on or off.
hintson|off Turns the hint messages of the compiler on or off.
optimizationnone|speed|size Optimize the code for speed or size, or disable optimization.
patternson|off Turns the term rewriting templates/macros on or off.
callconvcdecl|…Specifies the default calling convention for all procedures (and procedure types) that follow.

示例:

  1. {.checks: off, optimization: speed.}
  2. # 编译时没有运行时检查并优化速度