X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FMC%2FSubtargetFeature.h;h=75d1e7997119d67e7c83a60dfc65815e2609d7d2;hb=ada56848f5ff516cb5754215b265cd0ef78092b7;hp=02c9e82ad3a618e427416c81a8a2d5e5350f8e28;hpb=2e0fe4b9e9951831f349f58715f3e8c481f7136d;p=oota-llvm.git diff --git a/include/llvm/MC/SubtargetFeature.h b/include/llvm/MC/SubtargetFeature.h index 02c9e82ad3a..75d1e799711 100644 --- a/include/llvm/MC/SubtargetFeature.h +++ b/include/llvm/MC/SubtargetFeature.h @@ -59,6 +59,11 @@ struct SubtargetFeatureKV { bool operator<(StringRef S) const { return StringRef(Key) < S; } + + // Compare routine for std::is_sorted. + bool operator<(const SubtargetFeatureKV &Other) const { + return StringRef(Key) < StringRef(Other.Key); + } }; //===----------------------------------------------------------------------===// @@ -98,14 +103,13 @@ public: /// Adding Features. void AddFeature(StringRef String, bool Enable = true); - /// ToggleFeature - Toggle a feature and returns the newly updated feature - /// bits. - FeatureBitset ToggleFeature(FeatureBitset Bits, StringRef String, - ArrayRef FeatureTable); + /// ToggleFeature - Toggle a feature and update the feature bits. + static void ToggleFeature(FeatureBitset &Bits, StringRef String, + ArrayRef FeatureTable); - /// Apply the feature flag and return the newly updated feature bits. - FeatureBitset ApplyFeatureFlag(FeatureBitset Bits, StringRef Feature, - ArrayRef FeatureTable); + /// Apply the feature flag and update the feature bits. + static void ApplyFeatureFlag(FeatureBitset &Bits, StringRef Feature, + ArrayRef FeatureTable); /// Get feature bits of a CPU. FeatureBitset getFeatureBits(StringRef CPU,