已开启
feat: update description of --lto-keep-pkg-visibility #501
wangyang594创建于 5月11日
feat: update description of --lto-keep-pkg-visibility #501
已开启
共 2 个文件变更+12-12
| @@ -560,20 +560,20 @@ This option is deprecated and will be removed in a future version. Please use `- | |||
| 560 | 560 | ||
| 561 | ### `--lto-keep-pkg-visibility=<value>` | 561 | ### `--lto-keep-pkg-visibility=<value>` |
| 562 | 562 | ||
| 563 | -Specifies package names whose symbol visibility is preserved in LTO mode. Symbols from unspecified packages will be hidden, enabling LLVM to perform more aggressive dead code elimination. | 563 | +Specifies package names whose symbol visibility is preserved during LTO. Symbols from unspecified packages will be marked as hidden, enabling LLVM to perform more aggressive dead code elimination. |
| 564 | 564 | ||
| 565 | **Parameter Description:** | 565 | **Parameter Description:** |
| 566 | 566 | ||
| 567 | - `<value>` is a list of package names, separated by commas | 567 | - `<value>` is a list of package names, separated by commas |
| 568 | - `--lto-keep-pkg-visibility` can be used multiple times, with cumulative effect | 568 | - `--lto-keep-pkg-visibility` can be used multiple times, with cumulative effect |
| 569 | -- `<value>` can be an empty string `""`, which means hiding symbols from all packages | 569 | +- `<value>` can be an empty string `""`, which hides symbols from all packages during LTO |
| 570 | 570 | ||
| 571 | **Note:** | 571 | **Note:** |
| 572 | 572 | ||
| 573 | -- Only effective when --lto is enabled, otherwise an error will be reported | 573 | +- Only effective in LTO mode: `--lto=full` provides ideal results, while `--lto=thin` does not fully guarantee functionality |
| 574 | -- Cannot be used together with --compile-as-exe, otherwise an error will be reported | 574 | +- Cannot be combined with `--compile-as-exe`, otherwise a semantic conflict error will be reported |
| 575 | -- Only effective when compiling dynamic libraries (--output-type=dylib), otherwise a warning will be issued | 575 | +- Only effective when compiling dynamic libraries (`--output-type=dylib`) |
| 576 | -- Windows and macOS platforms do not support LTO, so this option is ineffective on these platforms | 576 | +- Windows and macOS platforms do not support LTO, so this option has no effect on these platforms |
| 577 | 577 | ||
| 578 | **Usage Example:** | 578 | **Usage Example:** |
| 579 | 579 | ||
| @@ -550,20 +550,20 @@ cjc --scan-dependency pkgA.cjo | |||
| 550 | 550 | ||
| 551 | ### `--lto-keep-pkg-visibility=<value>` | 551 | ### `--lto-keep-pkg-visibility=<value>` |
| 552 | 552 | ||
| 553 | -指定 LTO 模式下保持符号可见性的包名。未指定的包符号将被隐藏,LLVM 可据此执行更激进的无用代码删除。 | 553 | +指定在 LTO 过程中保持符号可见性的包名。未指定包的符号将被标记为隐藏,LLVM 可据此执行更激进的无用代码删除。 |
| 554 | 554 | ||
| 555 | **参数说明:** | 555 | **参数说明:** |
| 556 | 556 | ||
| 557 | - `<value>` 为包名列表,多个包名用逗号分隔 | 557 | - `<value>` 为包名列表,多个包名用逗号分隔 |
| 558 | - `--lto-keep-pkg-visibility` 可以被多次使用,效果累加 | 558 | - `--lto-keep-pkg-visibility` 可以被多次使用,效果累加 |
| 559 | -- `<value>` 可以为空字符串`""`, 表示隐藏所有包的符号 | 559 | +- `<value>` 可以为空字符串 `""`,表示隐藏 LTO 过程中所有包的符号 |
| 560 | 560 | ||
| 561 | **注意:** | 561 | **注意:** |
| 562 | 562 | ||
| 563 | -- 仅在开启 `--lto` 时有效,否则将报错 | 563 | +- 仅在 LTO 模式下生效:`--lto=full` 可达到理想效果,`--lto=thin` 下功能保障不完全 |
| 564 | -- 不能与 `--compile-as-exe` 同时使用,否则将报错 | 564 | +- 若指定包可见的同时也指定了 `--compile-as-exe`,会因语义冲突而报错 |
| 565 | -- 仅在编译动态库(`--output-type=dylib`)时有效,否则会告警 | 565 | +- 仅在编译动态库(`--output-type=dylib`)时生效 |
| 566 | -- Windows 和 macOS 平台不支持 LTO 功能,因此该选项在这些平台无效 | 566 | +- Windows 和 macOS 平台暂不支持 LTO 功能,因此该选项在这些平台无效 |
| 567 | 567 | ||
| 568 | **使用示例:** | 568 | **使用示例:** |
| 569 | 569 | ||