[MinGW] Try to fix asan testing after r330244

Twines shouldn't be stored as they can refer to temporaries.

llvm-svn: 330277
This commit is contained in:
Martin Storsjo 2018-04-18 17:34:29 +00:00
parent 9de072f8ae
commit 3a83c5c9f7
1 changed files with 5 additions and 6 deletions

View File

@ -308,14 +308,13 @@ llvm::ErrorOr<std::string> toolchains::MinGW::findClangRelativeSysroot() {
Subdirs.emplace_back(getTriple().str());
Subdirs.emplace_back(getTriple().getArchName());
Subdirs[1] += "-w64-mingw32";
Twine ClangRoot =
llvm::sys::path::parent_path(getDriver().getInstalledDir()) +
llvm::sys::path::get_separator();
StringRef ClangRoot =
llvm::sys::path::parent_path(getDriver().getInstalledDir());
StringRef Sep = llvm::sys::path::get_separator();
for (StringRef CandidateSubdir : Subdirs) {
Twine Subdir = ClangRoot + CandidateSubdir;
if (llvm::sys::fs::is_directory(Subdir)) {
if (llvm::sys::fs::is_directory(ClangRoot + Sep + CandidateSubdir)) {
Arch = CandidateSubdir;
return Subdir.str();
return (ClangRoot + Sep + CandidateSubdir).str();
}
}
return make_error_code(std::errc::no_such_file_or_directory);