Skip to content

Commit e133c78

Browse files
committed
Revert "[Driver] Use forward slashes in most linker arguments"
This reverts commit r345004, as it broke tests when actually run on windows; see e.g. http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/763. This broke tests that had captured a variable containing a path with backslashes, which failed to match cases in the output where the path separators had been changed into forward slashes. llvm-svn: 345005
1 parent 965a361 commit e133c78

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -378,15 +378,15 @@ std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
378378
SmallString<128> P(LibPath);
379379
llvm::sys::path::append(P, Prefix + Twine("clang_rt.") + Component + Suffix);
380380
if (getVFS().exists(P))
381-
return llvm::sys::path::convert_to_slash(P);
381+
return P.str();
382382
}
383383

384384
StringRef Arch = getArchNameForCompilerRTLib(*this, Args);
385385
const char *Env = TT.isAndroid() ? "-android" : "";
386386
SmallString<128> Path(getCompilerRTPath());
387387
llvm::sys::path::append(Path, Prefix + Twine("clang_rt.") + Component + "-" +
388388
Arch + Env + Suffix);
389-
return llvm::sys::path::convert_to_slash(Path);
389+
return Path.str();
390390
}
391391

392392
const char *ToolChain::getCompilerRTArgString(const llvm::opt::ArgList &Args,
@@ -425,7 +425,7 @@ Tool *ToolChain::SelectTool(const JobAction &JA) const {
425425
}
426426

427427
std::string ToolChain::GetFilePath(const char *Name) const {
428-
return llvm::sys::path::convert_to_slash(D.GetFilePath(Name, *this));
428+
return D.GetFilePath(Name, *this);
429429
}
430430

431431
std::string ToolChain::GetProgramPath(const char *Name) const {
@@ -774,14 +774,12 @@ void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
774774
void ToolChain::AddFilePathLibArgs(const ArgList &Args,
775775
ArgStringList &CmdArgs) const {
776776
for (const auto &LibPath : getLibraryPaths())
777-
if (LibPath.length() > 0)
778-
CmdArgs.push_back(Args.MakeArgString(
779-
StringRef("-L") + llvm::sys::path::convert_to_slash(LibPath)));
777+
if(LibPath.length() > 0)
778+
CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath));
780779

781780
for (const auto &LibPath : getFilePaths())
782-
if (LibPath.length() > 0)
783-
CmdArgs.push_back(Args.MakeArgString(
784-
StringRef("-L") + llvm::sys::path::convert_to_slash(LibPath)));
781+
if(LibPath.length() > 0)
782+
CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath));
785783
}
786784

787785
void ToolChain::AddCCKextLibArgs(const ArgList &Args,

0 commit comments

Comments
 (0)