Another misuse of StringRef. MSVC is very sensitive to that kind of error.
authorFrancois Pichet <pichet2000@gmail.com>
Fri, 1 Jul 2011 09:23:41 +0000 (09:23 +0000)
committerFrancois Pichet <pichet2000@gmail.com>
Fri, 1 Jul 2011 09:23:41 +0000 (09:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134236 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/SubtargetFeature.cpp

index c930baf1badc4ed37141c7304286eb88e16feffc..d72c346eea60a1fc46bd70f1aceed91a771e170a 100644 (file)
@@ -53,14 +53,14 @@ static inline bool isEnabled(const StringRef Feature) {
 
 /// PrependFlag - Return a string with a prepended flag; '+' or '-'.
 ///
-static inline StringRef PrependFlag(const StringRef Feature,
+static inline std::string PrependFlag(const StringRef Feature,
                                     bool IsEnabled) {
   assert(!Feature.empty() && "Empty string");
   if (hasFlag(Feature))
     return Feature;
   std::string Prefix = IsEnabled ? "+" : "-";
   Prefix += Feature;
-  return StringRef(Prefix);
+  return Prefix;
 }
 
 /// Split - Splits a string of comma separated items in to a vector of strings.