<div dir="ltr">On Tue, Apr 30, 2013 at 2:24 PM, Rafael Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank" class="cremed">rafael.espindola@gmail.com</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Tue Apr 30 07:24:40 2013<br>
New Revision: 180783<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=180783&view=rev" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project?rev=180783&view=rev</a><br>
Log:<br>
Always use / when computing mips specific paths.<br>
<br>
We were getting paths with both / and \ in them. This should fix mips-cs-ld.c<br>
on the windows bots.<br></blockquote><div><br></div><div style>You also removed a bunch of '.str()' method calls here, which is good but should be mentioned in the commit or committed in a separate patch.</div><div style>
<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
cfe/trunk/lib/Driver/ToolChains.cpp<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=180783&r1=180782&r2=180783&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=180783&r1=180782&r2=180783&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains.cpp Tue Apr 30 07:24:40 2013<br>
@@ -1298,20 +1298,20 @@ static bool hasMipsN32ABIArg(const ArgLi<br>
return A && (A->getValue() == StringRef("n32"));<br>
}<br>
<br>
-static void appendMipsTargetSuffix(SmallVectorImpl<char> &Path,<br>
+static void appendMipsTargetSuffix(std::string &Path,<br>
llvm::Triple::ArchType TargetArch,<br>
const ArgList &Args) {<br>
if (isMips16(Args))<br>
- llvm::sys::path::append(Path, "/mips16");<br>
+ Path += "/mips16";<br>
else if (isMicroMips(Args))<br>
- llvm::sys::path::append(Path, "/micromips");<br>
+ Path += "/micromips";<br>
<br>
if (isSoftFloatABI(Args))<br>
- llvm::sys::path::append(Path, "/soft-float");<br>
+ Path += "/soft-float";<br>
<br>
if (TargetArch == llvm::Triple::mipsel ||<br>
TargetArch == llvm::Triple::mips64el)<br>
- llvm::sys::path::append(Path, "/el");<br>
+ Path += "/el";<br>
}<br>
<br>
static StringRef getMipsTargetABISuffix(llvm::Triple::ArchType TargetArch,<br>
@@ -1323,7 +1323,7 @@ static StringRef getMipsTargetABISuffix(<br>
return "/32";<br>
}<br>
<br>
-static bool findTargetMultiarchSuffix(SmallString<32> &Suffix,<br>
+static bool findTargetMultiarchSuffix(std::string &Suffix,<br>
StringRef Path,<br>
llvm::Triple::ArchType TargetArch,<br>
const ArgList &Args) {<br>
@@ -1337,15 +1337,15 @@ static bool findTargetMultiarchSuffix(Sm<br>
<br>
if (TargetArch == llvm::Triple::mips64 ||<br>
TargetArch == llvm::Triple::mips64el)<br>
- llvm::sys::path::append(Suffix, ABISuffix);<br>
+ Suffix += ABISuffix;<br>
<br>
- if (llvm::sys::fs::exists(Path + Suffix.str() + "/crtbegin.o"))<br>
+ if (llvm::sys::fs::exists(Path + Suffix + "/crtbegin.o"))<br>
return true;<br>
<br>
// Then fall back and probe a simple case like<br>
// mips-linux-gnu/4.7/32/crtbegin.o<br>
Suffix = ABISuffix;<br>
- return llvm::sys::fs::exists(Path + Suffix.str() + "/crtbegin.o");<br>
+ return llvm::sys::fs::exists(Path + Suffix + "/crtbegin.o");<br>
}<br>
<br>
if (TargetArch == llvm::Triple::x86_64 ||<br>
@@ -1354,7 +1354,7 @@ static bool findTargetMultiarchSuffix(Sm<br>
else<br>
Suffix = "/32";<br>
<br>
- return llvm::sys::fs::exists(Path + Suffix.str() + "/crtbegin.o");<br>
+ return llvm::sys::fs::exists(Path + Suffix + "/crtbegin.o");<br>
}<br>
<br>
void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(<br>
@@ -1407,10 +1407,10 @@ void Generic_GCC::GCCInstallationDetecto<br>
// we use that. If not, and if not a multiarch triple, we look for<br>
// crtbegin.o without the subdirectory.<br>
<br>
- SmallString<32> MultiarchSuffix;<br>
+ std::string MultiarchSuffix;<br>
if (findTargetMultiarchSuffix(MultiarchSuffix,<br>
LI->path(), TargetArch, Args)) {<br>
- GCCMultiarchSuffix = MultiarchSuffix.str();<br>
+ GCCMultiarchSuffix = MultiarchSuffix;<br>
} else {<br>
if (NeedsMultiarchSuffix ||<br>
!llvm::sys::fs::exists(LI->path() + "/crtbegin.o"))<br>
@@ -2295,10 +2295,10 @@ Linux::Linux(const Driver &D, const llvm<br>
// Sourcery CodeBench MIPS toolchain holds some libraries under<br>
// the parent prefix of the GCC installation.<br>
if (IsMips) {<br>
- SmallString<128> Suffix;<br>
+ std::string Suffix;<br>
appendMipsTargetSuffix(Suffix, Arch, Args);<br>
addPathIfExists(LibPath + "/../" + GCCTriple.str() + "/lib/../" +<br>
- Multilib + Suffix.str(),<br>
+ Multilib + Suffix,<br>
Paths);<br>
}<br>
}<br>
@@ -2363,14 +2363,12 @@ std::string Linux::computeSysRoot(const<br>
if (!GCCInstallation.isValid() || !isMipsArch(getTriple().getArch()))<br>
return std::string();<br>
<br>
- SmallString<128> Path;<br>
- llvm::sys::path::append(Path, GCCInstallation.getInstallPath(),<br>
- "../../../..",<br>
- GCCInstallation.getTriple().str(),<br>
- "libc");<br>
+ std::string Path =<br>
+ (GCCInstallation.getInstallPath() +<br>
+ "/../../../../" + GCCInstallation.getTriple().str() + "/libc").str();<br>
appendMipsTargetSuffix(Path, getTriple().getArch(), Args);<br>
<br>
- return llvm::sys::fs::exists(Path.str()) ? Path.str() : "";<br>
+ return llvm::sys::fs::exists(Path) ? Path : "";<br>
}<br>
<br>
void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" class="cremed">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>