Skip to content

Conversation

@LunaStev
Copy link
Member

Summary

This PR adds compile-time LLVM version detection and display in --version output, while improving help text readability with aligned column formatting.

Changes

Backend Version Reporting

  • Build-time LLVM version detection
    • Export WAVE_LLVM_MAJOR=14 via cargo:rustc-env in platform-specific linkers:
      • Linux (linux_original)
      • macOS (link_macos)
      • Windows (link_windows)
  • New backend() function in llvm_temporary/lib.rs
    • Retrieves WAVE_LLVM_MAJOR from compile-time environment
    • Returns formatted string "LLVM {version}" or None if unavailable
  • Enhanced --version output
    • Calls llvm_temporary::backend() from version_wave()
    • Displays backend version with gray color formatting
    • Falls back to "backend: unknown backend" if unavailable

Help Text Improvements

  • Consistent column alignment in print_help()
    • Standardized column widths ({:<18}, {:<22})
    • Added descriptive text for each command and option
  • Better organization
    • Grouped related options (Commands, Optimization, Debug)
    • Expanded optimization flag descriptions (-O0 through -O3, -Oz, -Ofast)
    • Clarified debug option purposes (tokens, AST, IR, MC, hex)
    • Maintained practical usage examples at bottom

Example Output

wavec 0.1.5-pre-beta (Fedora Linux 43 (Workstation Edition))
  backend: LLVM 14

Add compile-time LLVM version detection and display in --version output,
plus improve help text readability with aligned columns.

Changes:
- Set LLVM version at build time via cargo:rustc-env:
  - Export WAVE_LLVM_MAJOR=14 in all platform-specific linkers
  - Linux (linux_original), macOS (link_macos), Windows (link_windows)
- Add backend() function to llvm_temporary/lib.rs:
  - Retrieve WAVE_LLVM_MAJOR from compile-time environment
  - Return formatted string "LLVM {version}" or None
- Display backend version in --version output:
  - Call llvm_temporary::backend() from version_wave()
  - Print "backend: LLVM 14" with gray color formatting
  - Fallback to "backend: unknown backend" if unavailable
- Improve help text formatting in print_help():
  - Use consistent column width alignment ({:<18}, {:<22})
  - Add descriptive text for each command and option
  - Group related options (Commands, Optimization, Debug)
  - Expand optimization flag descriptions (-O0..-O3, -Oz, -Ofast)
  - Clarify debug option purposes (tokens, AST, IR, MC, hex)
  - Keep practical usage examples at bottom

Output example:
  wavec 0.1.5-pre-beta (Linux 6.x.x)
    backend: LLVM 14

This provides transparency about the compiler toolchain configuration
and improves CLI user experience with readable help formatting.

Signed-off-by: LunaStev <youngjae681@gmail.com>
@LunaStev LunaStev self-assigned this Dec 13, 2025
@LunaStev LunaStev merged commit 8aab8ed into wavefnd:master Dec 13, 2025
2 checks passed
@LunaStev LunaStev deleted the llvmver_helpformat branch December 13, 2025 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant