[PATCH] D63936: [ARM] Minor fixes in command line option parsing

Alexandros Lamprineas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 28 09:17:41 PDT 2019


labrinea created this revision.
labrinea added reviewers: simon_tatham, SjoerdMeijer, ostannard.
Herald added subscribers: dmgreen, hiraditya, kristof.beyls, javed.absar.
Herald added projects: clang, LLVM.

When processing the command line options `march`, `mcpu` and `mfpu`,  we store the implied target features on a vector.  The change D62998 <https://reviews.llvm.org/D62998> introduced a temporary vector, where the processed features get accumulated. When calling `DecodeARMFeaturesFromCPU`, which sets the default features for the specified CPU, we certainly don't want to override the features that have been explicitly specified on the command line. Therefore, the default features should appear first in the final vector. This problem became evident once I added the missing (unhandled) target features in `ARM::getExtensionFeatures` and I am fixing it with this patch.

The second change this patch makes is that it teaches `ARM::appendArchExtFeatures` to account dependencies when processing target features: i.e. when you say `-march=armv8.1-m.main+mve.fp+nofp` it means `mve.fp` should get discarded too.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63936

Files:
  clang/lib/Driver/ToolChains/Arch/ARM.cpp
  clang/test/CodeGen/arm-target-features.c
  clang/test/Preprocessor/arm-target-features.c
  llvm/include/llvm/Support/ARMTargetParser.def
  llvm/lib/Support/ARMTargetParser.cpp
  llvm/unittests/Support/TargetParserTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63936.207071.patch
Type: text/x-patch
Size: 7903 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190628/5533a4ca/attachment-0001.bin>


More information about the cfe-commits mailing list