Extract handling of user defined features into a function so we can
specialize it on the targets.

llvm-svn: 245935
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index b78e281..5c4a016 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -7565,12 +7565,8 @@
   Target->initDefaultFeatures(Features);
 
   // Apply the user specified deltas.
-  for (const auto &F : Opts->FeaturesAsWritten) {
-    const char *Name = F.c_str();
-    // Apply the feature via the target.
-    bool Enabled = Name[0] == '+';
-    Target->setFeatureEnabled(Features, Name + 1, Enabled);
-  }
+  if (!Target->handleUserFeatures(Features, Opts->FeaturesAsWritten, Diags))
+      return nullptr;
 
   // Add the features to the compile options.
   //