r246565 - Pull initFeatureMap out of line now that it's used in multiple places.

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 1 11:13:20 PDT 2015


Author: echristo
Date: Tue Sep  1 13:13:20 2015
New Revision: 246565

URL: http://llvm.org/viewvc/llvm-project?rev=246565&view=rev
Log:
Pull initFeatureMap out of line now that it's used in multiple places.

Modified:
    cfe/trunk/include/clang/Basic/TargetInfo.h
    cfe/trunk/lib/Basic/TargetInfo.cpp

Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=246565&r1=246564&r2=246565&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Tue Sep  1 13:13:20 2015
@@ -746,15 +746,7 @@ public:
   /// \return False on error (invalid features).
   virtual bool initFeatureMap(llvm::StringMap<bool> &Features,
                               DiagnosticsEngine &Diags, StringRef CPU,
-                              std::vector<std::string> &FeatureVec) const {
-    for (const auto &F : FeatureVec) {
-      const char *Name = F.c_str();
-      // Apply the feature via the target.
-      bool Enabled = Name[0] == '+';
-      setFeatureEnabled(Features, Name + 1, Enabled);
-    }
-    return true;
-  }
+                              std::vector<std::string> &FeatureVec) const;
 
   /// \brief Get the ABI currently in use.
   virtual StringRef getABI() const { return StringRef(); }

Modified: cfe/trunk/lib/Basic/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/TargetInfo.cpp?rev=246565&r1=246564&r2=246565&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/TargetInfo.cpp (original)
+++ cfe/trunk/lib/Basic/TargetInfo.cpp Tue Sep  1 13:13:20 2015
@@ -311,6 +311,18 @@ void TargetInfo::adjust(const LangOption
   }
 }
 
+bool TargetInfo::initFeatureMap(llvm::StringMap<bool> &Features,
+                                DiagnosticsEngine &Diags, StringRef CPU,
+                                std::vector<std::string> &FeatureVec) const {
+  for (const auto &F : FeatureVec) {
+    const char *Name = F.c_str();
+    // Apply the feature via the target.
+    bool Enabled = Name[0] == '+';
+    setFeatureEnabled(Features, Name + 1, Enabled);
+  }
+  return true;
+}
+
 //===----------------------------------------------------------------------===//
 
 




More information about the cfe-commits mailing list