]> granicus.if.org Git - clang/commitdiff
[CodeGenFunction] Use the StringRef::split function that takes a char separator inste...
authorCraig Topper <craig.topper@intel.com>
Thu, 3 May 2018 21:01:33 +0000 (21:01 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 3 May 2018 21:01:33 +0000 (21:01 +0000)
The char separator version should be a little better optimized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331482 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenFunction.cpp

index bf5312550b79fe5d10799cc68b63107476488fe6..6c73a8cebdc9550eafc056b80a18a918d60f0907 100644 (file)
@@ -2284,7 +2284,7 @@ static bool hasRequiredFeatures(const SmallVectorImpl<StringRef> &ReqFeatures,
   return std::all_of(
       ReqFeatures.begin(), ReqFeatures.end(), [&](StringRef Feature) {
         SmallVector<StringRef, 1> OrFeatures;
-        Feature.split(OrFeatures, "|");
+        Feature.split(OrFeatures, '|');
         return std::any_of(OrFeatures.begin(), OrFeatures.end(),
                            [&](StringRef Feature) {
                              if (!CallerFeatureMap.lookup(Feature)) {
@@ -2322,7 +2322,7 @@ void CodeGenFunction::checkTargetFeatures(const CallExpr *E,
     // Return if the builtin doesn't have any required features.
     if (!FeatureList || StringRef(FeatureList) == "")
       return;
-    StringRef(FeatureList).split(ReqFeatures, ",");
+    StringRef(FeatureList).split(ReqFeatures, ',');
     if (!hasRequiredFeatures(ReqFeatures, CGM, FD, MissingFeature))
       CGM.getDiags().Report(E->getLocStart(), diag::err_builtin_needs_feature)
           << TargetDecl->getDeclName()