aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/TargetParserTest.cpp
diff options
context:
space:
mode:
authorTomas Matheson <tomas.matheson@arm.com>2022-10-24 14:25:37 +0100
committerTomas Matheson <tomas.matheson@arm.com>2022-11-17 18:44:06 +0000
commit70dbd7bb12e6af2e2c7ff3759c011cfe5bc36c11 (patch)
treeab43121ec5ad68431a60d16a03b1db023cb2d6c1 /llvm/unittests/Support/TargetParserTest.cpp
parentcd58333a62142d47c8571eacc07685251c5a0825 (diff)
downloadllvm-70dbd7bb12e6af2e2c7ff3759c011cfe5bc36c11.zip
llvm-70dbd7bb12e6af2e2c7ff3759c011cfe5bc36c11.tar.gz
llvm-70dbd7bb12e6af2e2c7ff3759c011cfe5bc36c11.tar.bz2
[ARM][AArch64] Use StringRef in TargetParser structs
The invalid case is now represented by an empty StringRef rather than a nullptr. Previously ARCH_FEATURE was build from SUB_ARCH by prepending "+". This is now reverse, so that the "+arch-feature" is now visible in the .def, which is a bit clearer. This meant converting one StringSwitch into a loop. Removed getters which are now mostly unnecessary. Removed some old FIXMEs. Differential Revision: https://reviews.llvm.org/D138026
Diffstat (limited to 'llvm/unittests/Support/TargetParserTest.cpp')
-rw-r--r--llvm/unittests/Support/TargetParserTest.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/unittests/Support/TargetParserTest.cpp b/llvm/unittests/Support/TargetParserTest.cpp
index 8f48c63..6d43e6c4 100644
--- a/llvm/unittests/Support/TargetParserTest.cpp
+++ b/llvm/unittests/Support/TargetParserTest.cpp
@@ -683,9 +683,8 @@ TEST(TargetParserTest, ARMExtensionFeatures) {
std::map<uint64_t, std::vector<StringRef>> Extensions;
for (auto &Ext : ARM::ARCHExtNames) {
- if (Ext.Feature && Ext.NegFeature)
- Extensions[Ext.ID] = { StringRef(Ext.Feature),
- StringRef(Ext.NegFeature) };
+ if (!Ext.Feature.empty() && !Ext.NegFeature.empty())
+ Extensions[Ext.ID] = {Ext.Feature, Ext.NegFeature};
}
Extensions[ARM::AEK_HWDIVARM] = { "+hwdiv-arm", "-hwdiv-arm" };