[llvm] 159709f - [Support] Fix implicit std::string conversions on Win32.
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 28 15:02:54 PST 2020
Author: Benjamin Kramer
Date: 2020-01-29T00:02:26+01:00
New Revision: 159709f04fa55674480da2db5c10d086c6297ca9
URL: https://github.com/llvm/llvm-project/commit/159709f04fa55674480da2db5c10d086c6297ca9
DIFF: https://github.com/llvm/llvm-project/commit/159709f04fa55674480da2db5c10d086c6297ca9.diff
LOG: [Support] Fix implicit std::string conversions on Win32.
Added:
Modified:
llvm/lib/Support/Windows/Program.inc
llvm/lib/Support/Windows/Signals.inc
Removed:
################################################################################
diff --git a/llvm/lib/Support/Windows/Program.inc b/llvm/lib/Support/Windows/Program.inc
index a1482bf17c60..7184a3bb30a7 100644
--- a/llvm/lib/Support/Windows/Program.inc
+++ b/llvm/lib/Support/Windows/Program.inc
@@ -138,7 +138,7 @@ static HANDLE RedirectIO(Optional<StringRef> Path, int fd,
if (Path->empty())
fname = "NUL";
else
- fname = *Path;
+ fname = std::string(*Path);
SECURITY_ATTRIBUTES sa;
sa.nLength = sizeof(sa);
diff --git a/llvm/lib/Support/Windows/Signals.inc b/llvm/lib/Support/Windows/Signals.inc
index 8b525f1bd4ac..a5c833d30cde 100644
--- a/llvm/lib/Support/Windows/Signals.inc
+++ b/llvm/lib/Support/Windows/Signals.inc
@@ -460,7 +460,7 @@ bool sys::RemoveFileOnSignal(StringRef Filename, std::string* ErrMsg) {
if (FilesToRemove == NULL)
FilesToRemove = new std::vector<std::string>;
- FilesToRemove->push_back(Filename);
+ FilesToRemove->push_back(std::string(Filename));
LeaveCriticalSection(&CriticalSection);
return false;
More information about the llvm-commits
mailing list