odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.13k stars 551 forks source link

Add compilation-related constants #3721

Closed Feoramund closed 3 weeks ago

Feoramund commented 3 weeks ago

ODIN_VERSION_HASH is the git SHA hash of the commit the Odin compiler was built with.

ODIN_MICROARCH_STRING is the string passed to -microarch when the program was built.

ODIN_OPTIMIZATION_MODE is an enum value of which optimization mode was used to build the program.

Resolves #2240

(ODIN_NO_BOUNDS_CHECK already exists at this time, compared to the then-proposed ODIN_DISABLE_BOUNDS_CHECK.)

Kelimion commented 3 weeks ago

The microarch string should probably use get_final_microarchitecture so we know what it is other than native?

Feoramund commented 3 weeks ago

I can fix that.