diff options
author | Fangrui Song <i@maskray.me> | 2024-03-15 11:06:42 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2024-03-15 11:06:42 -0700 |
commit | bf21dc24f5bfa8434198ec6bd65eec202811dc57 (patch) | |
tree | 414b47c6d7a63c7767e7971bc0a93faf7fc9465d | |
parent | cd071253c70b3b37a0b9d113709ca9d49a83007e (diff) | |
download | llvm-users/MaskRay/spr/driveraarch64-remove-aarch32-specific-mno-unaligned-access.zip llvm-users/MaskRay/spr/driveraarch64-remove-aarch32-specific-mno-unaligned-access.tar.gz llvm-users/MaskRay/spr/driveraarch64-remove-aarch32-specific-mno-unaligned-access.tar.bz2 |
[𝘀𝗽𝗿] initial versionusers/MaskRay/spr/driveraarch64-remove-aarch32-specific-mno-unaligned-access
Created using spr 1.3.5-bogner
-rw-r--r-- | clang/docs/ReleaseNotes.rst | 2 | ||||
-rw-r--r-- | clang/lib/Driver/ToolChains/Arch/AArch64.cpp | 9 | ||||
-rw-r--r-- | clang/test/Driver/arm-alignment.c | 24 |
3 files changed, 6 insertions, 29 deletions
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index e174336..a9e3be6 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -191,7 +191,7 @@ Removed Compiler Flags ------------------------- - The ``-freroll-loops`` flag has been removed. It had no effect since Clang 13. -- ``-m[no-]unaligned-access`` is removed for RISC-V and LoongArch. +- ``-m[no-]unaligned-access`` is removed for AArch64, RISC-V, and LoongArch. ``-m[no-]strict-align``, also supported by GCC, should be used instead. (`#85350 <https://github.com/llvm/llvm-project/pull/85350>`_.) diff --git a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp index 3e6e295..cac5ab5 100644 --- a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp +++ b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp @@ -321,13 +321,8 @@ void aarch64::getAArch64TargetFeatures(const Driver &D, } } - if (Arg *A = Args.getLastArg( - options::OPT_mstrict_align, options::OPT_mno_strict_align, - options::OPT_mno_unaligned_access, options::OPT_munaligned_access)) { - if (A->getOption().matches(options::OPT_mstrict_align) || - A->getOption().matches(options::OPT_mno_unaligned_access)) - Features.push_back("+strict-align"); - } else if (Triple.isOSOpenBSD()) + if (Args.hasFlag(options::OPT_mstrict_align, options::OPT_mno_strict_align, + Triple.isOSOpenBSD())) Features.push_back("+strict-align"); if (Args.hasArg(options::OPT_ffixed_x1)) diff --git a/clang/test/Driver/arm-alignment.c b/clang/test/Driver/arm-alignment.c index 8c915477..f7db966 100644 --- a/clang/test/Driver/arm-alignment.c +++ b/clang/test/Driver/arm-alignment.c @@ -37,19 +37,13 @@ // RUN: %clang -target thumbv8m.base-none-gnueabi -### %s 2> %t // RUN: FileCheck --check-prefix CHECK-ALIGNED-ARM <%t %s -// RUN: %clang --target=aarch64 -munaligned-access -### %s 2> %t -// RUN: FileCheck --check-prefix=CHECK-UNALIGNED-AARCH64 < %t %s - -// RUN: %clang --target=aarch64 -mstrict-align -munaligned-access -### %s 2> %t -// RUN: FileCheck --check-prefix=CHECK-UNALIGNED-AARCH64 < %t %s - -// RUN: %clang --target=aarch64 -mno-unaligned-access -munaligned-access -### %s 2> %t -// RUN: FileCheck --check-prefix=CHECK-UNALIGNED-AARCH64 < %t %s +// RUN: not %clang --target=aarch64 -munaligned-access -mno-unaligned-access -### %s 2>&1 | FileCheck %s --check-prefix=ERR +// ERR: error: unsupported option '-munaligned-access' for target 'aarch64' +// ERR: error: unsupported option '-mno-unaligned-access' for target 'aarch64' // CHECK-UNALIGNED-ARM-NOT: "-target-feature" "+strict-align" // CHECK-UNALIGNED-AARCH64-NOT: "-target-feature" "+strict-align" - // RUN: %clang -target arm-none-gnueabi -mno-unaligned-access -### %s 2> %t // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s @@ -83,21 +77,9 @@ // RUN: %clang -target armv6m-netbsd-eabi -### %s 2> %t // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s -// RUN: %clang --target=aarch64 -mno-unaligned-access -### %s 2> %t -// RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s - // RUN: %clang --target=aarch64 -mstrict-align -### %s 2> %t // RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s -// RUN: %clang --target=aarch64 -munaligned-access -mno-unaligned-access -### %s 2> %t -// RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s - -// RUN: %clang --target=aarch64 -munaligned-access -mstrict-align -### %s 2> %t -// RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s - -// RUN: %clang --target=aarch64 -mkernel -mno-unaligned-access -### %s 2> %t -// RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s - // RUN: %clang -target aarch64-unknown-openbsd -### %s 2> %t // RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s |