[Hexagon] Avoid creating an empty target feature
If the CPU string is empty, the target feature map may end up having an empty string inserted to it. The symptom of the problem is a warning message: '+' is not a recognized feature for this target (ignoring feature) Also, the target-features attribute in the module will have an empty string in it.
This commit is contained in:
parent
0b7f125219
commit
7406eb4f6a
|
@ -98,7 +98,8 @@ bool HexagonTargetInfo::initFeatureMap(
|
|||
StringRef CPUFeature = CPU;
|
||||
CPUFeature.consume_front("hexagon");
|
||||
CPUFeature.consume_back("t");
|
||||
Features[CPUFeature] = true;
|
||||
if (!CPUFeature.empty())
|
||||
Features[CPUFeature] = true;
|
||||
|
||||
Features["long-calls"] = false;
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
// RUN: %clang_cc1 %s -triple hexagon-unknown-elf -emit-llvm -o - 2>&1 | FileCheck %s
|
||||
// CHECK-NOT: '+' is not a recognized feature for this target
|
||||
|
||||
// Empty
|
Loading…
Reference in New Issue