Skip to content

Respect --mcpu=help in the compiler#15595

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
HertzDevil:feature/llvm-cpu-help
Mar 26, 2025
Merged

Respect --mcpu=help in the compiler#15595
straight-shoota merged 1 commit intocrystal-lang:masterfrom
HertzDevil:feature/llvm-cpu-help

Conversation

@HertzDevil
Copy link
Contributor

Passing --mcpu=help when building or running any Crystal source code makes LLVM display a list of all valid CPU and feature flags for the currently selected target, but then Crystal will continue with the semantic phase before failing to create a target machine for an invalid CPU. This PR makes the CLI immediately exit instead when that happens.

--mattr=+help can be used to display the same help message without exiting the compiler nor adding an invalid feature flag; nothing needs to be done in Crystal about this.

@straight-shoota straight-shoota added this to the 1.16.0 milestone Mar 24, 2025
@straight-shoota straight-shoota merged commit d8919b6 into crystal-lang:master Mar 26, 2025
40 of 44 checks passed
@HertzDevil HertzDevil deleted the feature/llvm-cpu-help branch March 26, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants