[AArch64] handle -Wa,-march=
authorJian Cai <caij2003@gmail.com>
Mon, 7 Jun 2021 17:12:13 +0000 (10:12 -0700)
committerJian Cai <caij2003@gmail.com>
Mon, 7 Jun 2021 17:15:53 +0000 (10:15 -0700)
commitfd11a26d368c5a909fb88548fef2cee7a6c2c931
treea0d7692af53fbd3b50de80b7ba303b442ea24254
parent1465e7770bcacfb67ca4edc3714cf3a7e8a2a110
[AArch64] handle -Wa,-march=

This fixed PR#48894 for AArch64. The issue has been fixed for Arm in
https://reviews.llvm.org/D95872

The following rules apply to -Wa,-march with this change:
  - Only compiler options apply to non assembly files
  - Compiler and assembler options apply to assembly files
  - For assembly files, we prefer the assembler option(s) if we have both kinds of option
  - Of the options that apply (or are preferred), the last value wins (it's not additive)

Reviewed By: DavidSpickett, nickdesaulniers

Differential Revision: https://reviews.llvm.org/D103184
clang/lib/Driver/ToolChains/Arch/AArch64.cpp
clang/lib/Driver/ToolChains/Arch/AArch64.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/aarch64-target-as-march.s [new file with mode: 0644]