diff options
author | simpal01 <simi.pallipurath@arm.com> | 2024-11-07 09:54:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-07 09:54:41 +0000 |
commit | f9fecab1fd4e2aec74b864b1ee81679b14f13f5c (patch) | |
tree | 443944b9e7098fc1d73aff3feee5a854d9708730 /clang/lib/Driver/ToolChain.cpp | |
parent | 1b01064faad2cd93c516341cfaf047b7a0f8da42 (diff) | |
download | llvm-f9fecab1fd4e2aec74b864b1ee81679b14f13f5c.zip llvm-f9fecab1fd4e2aec74b864b1ee81679b14f13f5c.tar.gz llvm-f9fecab1fd4e2aec74b864b1ee81679b14f13f5c.tar.bz2 |
Add -mno-unaligned-access and -mbig-endian to ARM and AArch64 multilib flags (#114782)
This adds -mno-unaligned-access and -mbig-endian command line
options to the set of flags used by the multilib selection for ARM and
AArch64 targets.
Diffstat (limited to 'clang/lib/Driver/ToolChain.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChain.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index 9774d3f..646dbc0 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -230,6 +230,20 @@ static void getAArch64MultilibFlags(const Driver &D, Result.push_back(BranchProtectionArg->getAsString(Args)); } + if (Arg *AlignArg = Args.getLastArg( + options::OPT_mstrict_align, options::OPT_mno_strict_align, + options::OPT_mno_unaligned_access, options::OPT_munaligned_access)) { + if (AlignArg->getOption().matches(options::OPT_mstrict_align) || + AlignArg->getOption().matches(options::OPT_mno_unaligned_access)) + Result.push_back(AlignArg->getAsString(Args)); + } + + if (Arg *Endian = Args.getLastArg(options::OPT_mbig_endian, + options::OPT_mlittle_endian)) { + if (Endian->getOption().matches(options::OPT_mbig_endian)) + Result.push_back(Endian->getAsString(Args)); + } + const Arg *ABIArg = Args.getLastArgNoClaim(options::OPT_mabi_EQ); if (ABIArg) { Result.push_back(ABIArg->getAsString(Args)); @@ -287,6 +301,20 @@ static void getARMMultilibFlags(const Driver &D, if (BranchProtectionArg) { Result.push_back(BranchProtectionArg->getAsString(Args)); } + + if (Arg *AlignArg = Args.getLastArg( + options::OPT_mstrict_align, options::OPT_mno_strict_align, + options::OPT_mno_unaligned_access, options::OPT_munaligned_access)) { + if (AlignArg->getOption().matches(options::OPT_mstrict_align) || + AlignArg->getOption().matches(options::OPT_mno_unaligned_access)) + Result.push_back(AlignArg->getAsString(Args)); + } + + if (Arg *Endian = Args.getLastArg(options::OPT_mbig_endian, + options::OPT_mlittle_endian)) { + if (Endian->getOption().matches(options::OPT_mbig_endian)) + Result.push_back(Endian->getAsString(Args)); + } } static void getRISCVMultilibFlags(const Driver &D, const llvm::Triple &Triple, |