@@ -34,15 +34,7 @@ class MCInst;
3434
3535// / Used to provide key value pairs for feature and CPU bit flags.
3636struct BasicSubtargetFeatureKV {
37- const char *Key; // /< K-V key string
38- unsigned Value; // /< K-V integer value
39- FeatureBitArray Implies; // /< K-V bit mask
40- };
41-
42- // / Used to provide key value pairs for feature and CPU bit flags.
43- struct SubtargetFeatureKV {
4437 const char *Key; // /< K-V key string
45- const char *Desc; // /< Help descriptor
4638 unsigned Value; // /< K-V integer value
4739 FeatureBitArray Implies; // /< K-V bit mask
4840
@@ -52,9 +44,19 @@ struct SubtargetFeatureKV {
5244 }
5345
5446 // / Compare routine for std::is_sorted.
55- bool operator <(const SubtargetFeatureKV &Other) const {
47+ bool operator <(const BasicSubtargetFeatureKV &Other) const {
5648 return StringRef (Key) < StringRef (Other.Key );
5749 }
50+ constexpr BasicSubtargetFeatureKV (const char *Key, unsigned Value,
51+ FeatureBitArray Implies)
52+ : Key(Key), Value(Value), Implies(Implies) {}
53+ };
54+
55+ struct SubtargetFeatureKV : BasicSubtargetFeatureKV {
56+ const char *Desc; // /< Help descriptor
57+ SubtargetFeatureKV (const char *Key, const char *Desc, unsigned Value,
58+ FeatureBitArray Implies)
59+ : BasicSubtargetFeatureKV(Key, Value, Implies), Desc(Desc) {}
5860};
5961
6062// ===----------------------------------------------------------------------===//
@@ -68,26 +70,17 @@ struct BasicSubtargetSubTypeKV {
6870 bool operator <(StringRef S) const {
6971 return StringRef (Key) < S;
7072 }
71- };
7273
73- struct SubtargetSubTypeKV {
74- const char *Key; // /< K-V key string
75- FeatureBitArray Implies; // /< K-V bit mask
76- FeatureBitArray TuneImplies; // /< K-V bit mask
77- const MCSchedModel *SchedModel;
78-
79- // / Compare routine for std::lower_bound
80- bool operator <(StringRef S) const { return StringRef (Key) < S; }
8174 // / Compare routine for std::is_sorted.
82- bool operator <(const SubtargetSubTypeKV &Other) const {
75+ bool operator <(const BasicSubtargetSubTypeKV &Other) const {
8376 return StringRef (Key) < StringRef (Other.Key );
8477 }
8578};
8679
87- std::optional<llvm::StringMap< bool >>
88- getCPUDefaultTargetFeatures (StringRef CPU,
89- ArrayRef<BasicSubtargetSubTypeKV> ProcDesc,
90- ArrayRef<BasicSubtargetFeatureKV> ProcFeatures) ;
80+ struct SubtargetSubTypeKV : BasicSubtargetSubTypeKV {
81+ FeatureBitArray TuneImplies; // /< K-V bit mask
82+ const MCSchedModel *SchedModel;
83+ } ;
9184
9285// ===----------------------------------------------------------------------===//
9386// /
0 commit comments