]> granicus.if.org Git - clang/commitdiff
Pull initFeatureMap out of line now that it's used in multiple places.
authorEric Christopher <echristo@gmail.com>
Tue, 1 Sep 2015 18:13:20 +0000 (18:13 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 1 Sep 2015 18:13:20 +0000 (18:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246565 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/TargetInfo.h
lib/Basic/TargetInfo.cpp

index b19d57c71667e724410146c80b745effa7194569..bdae270aa846a8d0f0df8c59fbb77f7ad17b1104 100644 (file)
@@ -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(); }
index 30378a5a751ee35bf7ee1601b2c44a7d24bb7dc0..aa7385eb005da543bde5720da9c6779ef20de898 100644 (file)
@@ -311,6 +311,18 @@ void TargetInfo::adjust(const LangOptions &Opts) {
   }
 }
 
+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;
+}
+
 //===----------------------------------------------------------------------===//