stage2: cleanups regarding red zone CLI flags

* CLI: change to -mred-zone and -mno-red-zone to match gcc/clang.
 * build.zig: remove the double negative and make it an optional bool.
   This follows precedent from other flags, allowing the compiler CLI to
   be the decider of what is default instead of duplicating the default
   value into the build system code.
 * Compilation: make it an optional `want_red_zone` instead of a
   `no_red_zone` bool. The default is decided by a call to
   `target_util.hasRedZone`.
 * When creating a Clang command line, put -mred-zone on the command
   line if we are forcing it to be enabled.
 * Update update_clang_options.zig with respect to the recent {s}/{} format changes.
 * `zig cc` integration with red zone preference.
This commit is contained in:
Andrew Kelley
2021-01-11 22:01:16 -07:00
parent 8932c2d745
commit 5b2a79848c
16 changed files with 114 additions and 62 deletions

View File

@@ -513,8 +513,8 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) {
} else {
maybe_import_dll(g, llvm_fn, linkage);
}
if (g->no_red_zone) {
if (!g->red_zone) {
addLLVMFnAttr(llvm_fn, "noredzone");
}