mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
cbe: Implement support for -fno-builtin and @disableIntrinsics().
This commit is contained in:
parent
6ba785584a
commit
e11ac02662
2 changed files with 17 additions and 2 deletions
|
|
@ -223,6 +223,12 @@
|
|||
#define zig_restrict
|
||||
#endif
|
||||
|
||||
#if zig_has_attribute(no_builtin)
|
||||
#define zig_no_builtin __attribute__((no_builtin))
|
||||
#else
|
||||
#define zig_no_builtin
|
||||
#endif
|
||||
|
||||
#if zig_has_attribute(aligned) || defined(zig_tinyc)
|
||||
#define zig_under_align(alignment) __attribute__((aligned(alignment)))
|
||||
#elif defined(zig_msvc)
|
||||
|
|
|
|||
|
|
@ -1859,8 +1859,17 @@ pub const DeclGen = struct {
|
|||
else => unreachable,
|
||||
}
|
||||
}
|
||||
if (fn_val.getFunction(zcu)) |func| if (func.analysisUnordered(ip).branch_hint == .cold)
|
||||
|
||||
if (fn_val.getFunction(zcu)) |func| {
|
||||
const func_analysis = func.analysisUnordered(ip);
|
||||
|
||||
if (func_analysis.branch_hint == .cold)
|
||||
try w.writeAll("zig_cold ");
|
||||
|
||||
if (kind == .complete and func_analysis.disable_intrinsics or dg.mod.no_builtin)
|
||||
try w.writeAll("zig_no_builtin ");
|
||||
}
|
||||
|
||||
if (fn_info.return_type == .noreturn_type) try w.writeAll("zig_noreturn ");
|
||||
|
||||
var trailing = try renderTypePrefix(dg.pass, &dg.ctype_pool, zcu, w, fn_ctype, .suffix, .{});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue