From 24e11afad266498ca447649b8522e01ac2073798 Mon Sep 17 00:00:00 2001 From: Francois Pichet Date: Fri, 1 Jul 2011 09:23:41 +0000 Subject: [PATCH] Another misuse of StringRef. MSVC is very sensitive to that kind of error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134236 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/SubtargetFeature.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/MC/SubtargetFeature.cpp b/lib/MC/SubtargetFeature.cpp index c930baf1bad..d72c346eea6 100644 --- a/lib/MC/SubtargetFeature.cpp +++ b/lib/MC/SubtargetFeature.cpp @@ -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. -- 2.34.1