[clang][driver] Don't pass -Wunaligned-access to cc1as

This is to fix some failing assembler tests.
This commit is contained in:
Archibald Elliott 2022-01-07 10:45:26 +00:00
parent 359b4e6cdb
commit 11c67e5a4e
2 changed files with 14 additions and 7 deletions

View File

@ -467,10 +467,12 @@ fp16_fml_fallthrough:
options::OPT_munaligned_access)) {
if (A->getOption().matches(options::OPT_mno_unaligned_access)) {
Features.push_back("+strict-align");
if (!ForAS)
CmdArgs.push_back("-Wunaligned-access");
}
} else if (Triple.isOSOpenBSD()) {
Features.push_back("+strict-align");
if (!ForAS)
CmdArgs.push_back("-Wunaligned-access");
}

View File

@ -771,6 +771,7 @@ fp16_fml_fallthrough:
// Kernel code has more strict alignment requirements.
if (KernelOrKext) {
Features.push_back("+strict-align");
if (!ForAS)
CmdArgs.push_back("-Wunaligned-access");
} else if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access,
options::OPT_munaligned_access)) {
@ -784,6 +785,7 @@ fp16_fml_fallthrough:
D.Diag(diag::err_target_unsupported_unaligned) << "v8m.base";
} else {
Features.push_back("+strict-align");
if (!ForAS)
CmdArgs.push_back("-Wunaligned-access");
}
} else {
@ -806,16 +808,19 @@ fp16_fml_fallthrough:
if (VersionNum < 6 ||
Triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v6m) {
Features.push_back("+strict-align");
if (!ForAS)
CmdArgs.push_back("-Wunaligned-access");
}
} else if (Triple.isOSLinux() || Triple.isOSNaCl() ||
Triple.isOSWindows()) {
if (VersionNum < 7) {
Features.push_back("+strict-align");
if (!ForAS)
CmdArgs.push_back("-Wunaligned-access");
}
} else {
Features.push_back("+strict-align");
if (!ForAS)
CmdArgs.push_back("-Wunaligned-access");
}
}