COFF: Fix single StringRef return error
authorMartell Malone <martellmalone@gmail.com>
Sat, 20 May 2017 21:00:36 +0000 (21:00 +0000)
committerMartell Malone <martellmalone@gmail.com>
Sat, 20 May 2017 21:00:36 +0000 (21:00 +0000)
This should appease the lld build bot regression
Intrroduced by rL303490

llvm-svn: 303493

llvm/lib/Object/COFFImportFile.cpp

index d4890fe..37962d8 100644 (file)
@@ -111,8 +111,8 @@ static Expected<std::string> replace(StringRef S, StringRef From,
 
   if (Pos == StringRef::npos) {
     return make_error<StringError>(
-      Twine(S + ": replacing '" + From + "' with '" + To + "' failed")
-      .getSingleStringRef(), object_error::parse_failed);
+      StringRef(Twine(S + ": replacing '" + From +
+        "' with '" + To + "' failed").str()), object_error::parse_failed);
   }
 
   return (Twine(S.substr(0, Pos)) + To + S.substr(Pos + From.size())).str();