[ScalarEvolution] Guard dump() with #if
[oota-llvm.git] / include / llvm / MC / SubtargetFeature.h
index ad7fec53ac3ec9dcbfc5e86fe16209fe9fa00de3..bfecb8ba6ab0a22dba299302c1faa480c4295ff9 100644 (file)
@@ -18,9 +18,9 @@
 #ifndef LLVM_MC_SUBTARGETFEATURE_H
 #define LLVM_MC_SUBTARGETFEATURE_H
 
+#include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/Triple.h"
 #include "llvm/Support/DataTypes.h"
-#include <vector>
 
 namespace llvm {
   class raw_ostream;
@@ -72,26 +72,23 @@ struct SubtargetInfoKV {
 class SubtargetFeatures {
   std::vector<std::string> Features;    // Subtarget features as a vector
 public:
-  explicit SubtargetFeatures(const StringRef Initial = "");
+  explicit SubtargetFeatures(StringRef Initial = "");
 
   /// Features string accessors.
   std::string getString() const;
 
   /// Adding Features.
-  void AddFeature(const StringRef String, bool IsEnabled = true);
+  void AddFeature(StringRef String);
 
   /// ToggleFeature - Toggle a feature and returns the newly updated feature
   /// bits.
-  uint64_t ToggleFeature(uint64_t Bits, const StringRef String,
-                         const SubtargetFeatureKV *FeatureTable,
-                         size_t FeatureTableSize);
+  uint64_t ToggleFeature(uint64_t Bits, StringRef String,
+                         ArrayRef<SubtargetFeatureKV> FeatureTable);
 
   /// Get feature bits of a CPU.
-  uint64_t getFeatureBits(const StringRef CPU,
-                          const SubtargetFeatureKV *CPUTable,
-                          size_t CPUTableSize,
-                          const SubtargetFeatureKV *FeatureTable,
-                          size_t FeatureTableSize);
+  uint64_t getFeatureBits(StringRef CPU,
+                          ArrayRef<SubtargetFeatureKV> CPUTable,
+                          ArrayRef<SubtargetFeatureKV> FeatureTable);
 
   /// Print feature string.
   void print(raw_ostream &OS) const;
@@ -101,12 +98,6 @@ public:
 
   /// Adds the default features for the specified target triple.
   void getDefaultSubtargetFeatures(const Triple& Triple);
-
-  /// Find KV in array using binary search.
-  /// T should be either SubtargetFeatureKV or SubtargetInfoKV
-  template<typename T>
-  static const T *Find(StringRef Key, const T *Array, size_t Length,
-                       const char* KeyType);
 };
 
 } // End namespace llvm