mirror of
https://github.com/ziglang/zig.git
synced 2025-12-24 15:13:08 +00:00
Changes: - Add `isMangledIdent` to determine if `fmtIdent` would make any edits to the identifier - Any function that has a mangled identifier is referred to using the mangled identifer within the current file, but if it is exported the first export will be with the non-mangled name. - Add `zig_import` to import a symbol under a different name - Add a level of indirection to float function names. Now, they are referred to as `zig_float_fn_<float type>_<operation>`. The definitions in zig.h are wrapped with `zig_import` to import the symbol under the real name. The specific problem that sparked this change was the combination of `zig_libc_name_f80(name) __##name##x` with the input `fma`, resulting in `__fmax`, which is a new intrinsic in recent versions of cl.exe. With the above changes in place, compiler_rt can output the following: ``` static zig_weak_linkage_fn zig_f80 zig_e___fmax(zig_f80, zig_f80, zig_f80); zig_export(zig_weak_linkage_fn zig_f80 zig_e___fmax(zig_f80, zig_f80, zig_f80), __fmax, "__fmax"); ``` Within compiler_rt, `zig_e___fmax` is used to refer to the function, but consumers will import `__fmax`, which maps to their `zig_float_fn_f80_fma` definition from zig.h.