X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Fllvm%2FTarget%2FSubtargetFeature.h;h=5cfdc023d43990dcb9cc48f81b45e32bfce599dc;hb=104cf9e02b0ed94d4173869a598af6c6972a8660;hp=70315df484b7cbfd1846915a588e630b0b6d5925;hpb=55a7ec33d7cafa703a1b6e6410d7c26d5b7ded0b;p=oota-llvm.git diff --git a/include/llvm/Target/SubtargetFeature.h b/include/llvm/Target/SubtargetFeature.h index 70315df484b..5cfdc023d43 100644 --- a/include/llvm/Target/SubtargetFeature.h +++ b/include/llvm/Target/SubtargetFeature.h @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by James M. Laskey and is distributed under the -// University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -21,6 +21,7 @@ #include #include #include +#include #include "llvm/Support/DataTypes.h" namespace llvm { @@ -34,6 +35,7 @@ struct SubtargetFeatureKV { const char *Key; // K-V key string const char *Desc; // Help descriptor uint32_t Value; // K-V integer value + uint32_t Implies; // K-V bit mask // Compare routine for std binary search bool operator<(const SubtargetFeatureKV &S) const { @@ -72,7 +74,7 @@ struct SubtargetInfoKV { class SubtargetFeatures { std::vector Features; // Subtarget features as a vector public: - SubtargetFeatures(const std::string &Initial = std::string()); + explicit SubtargetFeatures(const std::string &Initial = std::string()); /// Features string accessors. std::string getString() const; @@ -80,13 +82,13 @@ public: /// Set the CPU string. Replaces previous setting. Setting to "" clears CPU. void setCPU(const std::string &String); - - /// Get the CPU string. - const std::string &getCPU() const { return Features[0]; } - + /// Setting CPU string only if no string is set. void setCPUIfNone(const std::string &String); - + + /// Returns current CPU string. + const std::string & getCPU() const; + /// Adding Features. void AddFeature(const std::string &String, bool IsEnabled = true); @@ -101,6 +103,7 @@ public: /// Print feature string. void print(std::ostream &OS) const; + void print(std::ostream *OS) const { if (OS) print(*OS); } // Dump feature info. void dump() const;