[ARM] Fix the extensions implied by a cpu name
authorDiogo N. Sampaio <diogo.sampaio@arm.com>
Thu, 9 May 2019 10:24:36 +0000 (10:24 +0000)
committerDiogo N. Sampaio <diogo.sampaio@arm.com>
Thu, 9 May 2019 10:24:36 +0000 (10:24 +0000)
commitbc2b7325c415dae05a7407995092e38d11be0562
treea98a0d4f8b556485a97f0ae468e05544cbc0a60c
parent4ba126ade702c14d2e52a1cceda4ca66c8fb47ad
[ARM] Fix the extensions implied by a cpu name

Summary:
When using `clang -mcpu=CPUNAME+FEATURELIST`,
the implied features defined by CPUNAME are
not obtained, as the entire string is passed.
This fixes that by spiting the cpuname
string in the first `+`, if any.

For example, when using
```clang -### --target=arm-arm-none-eabi -march=armv7-a -mcpu=cortex-a8+nocrc```
the intrinsic
```"target-feature" "+dsp"```
implied by `cortex-a8` is missing.

Reviewers: keith.walker.arm, DavidSpickett, carwil

Reviewed By: DavidSpickett

Subscribers: javed.absar, kristof.beyls, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61668

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360324 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/ToolChains/Arch/ARM.cpp
test/Driver/arm-cortex-cpus.c