Rather than silently disabling unaligned accesses for v6m targets as
in the previous patch to llvm, instead produce a warning saying that
this architecture doesn't support unaligned accesses.
Patch by Ben Foster
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215531
91177308-0d34-0410-b5e6-
96231b3b80d8
def err_target_unknown_fpmath : Error<"unknown FP unit '%0'">;
def err_target_unsupported_fpmath : Error<
"the '%0' unit is not supported with this instruction set">;
+def err_target_unsupported_unaligned : Error<
+ "the %0 sub-architecture does not support unaligned accesses">;
// Source manager
def err_cannot_open_file : Error<"cannot open file '%0': %1">, DefaultFatal;
CmdArgs.push_back("-backend-option");
if (A->getOption().matches(options::OPT_mno_unaligned_access))
CmdArgs.push_back("-arm-strict-align");
- else
+ else {
+ if (getToolChain().getTriple().getSubArch() ==
+ llvm::Triple::SubArchType::ARMSubArch_v6m)
+ D.Diag(diag::err_target_unsupported_unaligned) << "v6m";
CmdArgs.push_back("-arm-no-strict-align");
+ }
}
}