Re: r294879 - [Driver] Use stem() and not filename().

2018-05-18 Thread Nico Weber via cfe-commits
I think this code is probably dead since the stem is "ld.lld" for lld, not
"lld".

On Sat, Feb 11, 2017 at 7:22 PM, Davide Italiano via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> On Sat, Feb 11, 2017 at 4:19 PM, Rui Ueyama  wrote:
> > On Sat, Feb 11, 2017 at 3:44 PM, Davide Italiano via cfe-commits
> >  wrote:
> >>
> >> Author: davide
> >> Date: Sat Feb 11 17:44:37 2017
> >> New Revision: 294879
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=294879=rev
> >> Log:
> >> [Driver] Use stem() and not filename().
> >>
> >> On Windows the filename might have an extension, namely
> >> `.exe`, so the search will fail. Sorry, I don't have a
> >> good way to test this as it seems to fail only in some
> >> weird configurations. r284430 has the same modification
> >> for Fuchsia.
> >>
> >> Modified:
> >> cfe/trunk/lib/Driver/Tools.cpp
> >>
> >> Modified: cfe/trunk/lib/Driver/Tools.cpp
> >> URL:
> >> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/
> Tools.cpp?rev=294879=294878=294879=diff
> >>
> >> 
> ==
> >> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> >> +++ cfe/trunk/lib/Driver/Tools.cpp Sat Feb 11 17:44:37 2017
> >> @@ -10163,7 +10163,7 @@ void gnutools::Linker::ConstructJob(Comp
> >>Args.ClaimAllArgs(options::OPT_w);
> >>
> >>const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
> >> -  if (llvm::sys::path::filename(Exec) == "lld") {
> >> +  if (llvm::sys::path::stem(Exec) == "lld") {
> >>  CmdArgs.push_back("-flavor");
> >>  CmdArgs.push_back("old-gnu");
> >
>
> Probably not, I'm just reducing diffs with out local branch. I think
> we can remove it altogether.
>
> --
> Davide
>
> "There are no solved problems; there are only problems that are more
> or less solved" -- Henri Poincare
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r294879 - [Driver] Use stem() and not filename().

2017-02-11 Thread Davide Italiano via cfe-commits
On Sat, Feb 11, 2017 at 4:19 PM, Rui Ueyama  wrote:
> On Sat, Feb 11, 2017 at 3:44 PM, Davide Italiano via cfe-commits
>  wrote:
>>
>> Author: davide
>> Date: Sat Feb 11 17:44:37 2017
>> New Revision: 294879
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=294879=rev
>> Log:
>> [Driver] Use stem() and not filename().
>>
>> On Windows the filename might have an extension, namely
>> `.exe`, so the search will fail. Sorry, I don't have a
>> good way to test this as it seems to fail only in some
>> weird configurations. r284430 has the same modification
>> for Fuchsia.
>>
>> Modified:
>> cfe/trunk/lib/Driver/Tools.cpp
>>
>> Modified: cfe/trunk/lib/Driver/Tools.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=294879=294878=294879=diff
>>
>> ==
>> --- cfe/trunk/lib/Driver/Tools.cpp (original)
>> +++ cfe/trunk/lib/Driver/Tools.cpp Sat Feb 11 17:44:37 2017
>> @@ -10163,7 +10163,7 @@ void gnutools::Linker::ConstructJob(Comp
>>Args.ClaimAllArgs(options::OPT_w);
>>
>>const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
>> -  if (llvm::sys::path::filename(Exec) == "lld") {
>> +  if (llvm::sys::path::stem(Exec) == "lld") {
>>  CmdArgs.push_back("-flavor");
>>  CmdArgs.push_back("old-gnu");
>

Probably not, I'm just reducing diffs with out local branch. I think
we can remove it altogether.

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r294879 - [Driver] Use stem() and not filename().

2017-02-11 Thread Rui Ueyama via cfe-commits
On Sat, Feb 11, 2017 at 3:44 PM, Davide Italiano via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: davide
> Date: Sat Feb 11 17:44:37 2017
> New Revision: 294879
>
> URL: http://llvm.org/viewvc/llvm-project?rev=294879=rev
> Log:
> [Driver] Use stem() and not filename().
>
> On Windows the filename might have an extension, namely
> `.exe`, so the search will fail. Sorry, I don't have a
> good way to test this as it seems to fail only in some
> weird configurations. r284430 has the same modification
> for Fuchsia.
>
> Modified:
> cfe/trunk/lib/Driver/Tools.cpp
>
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/
> Tools.cpp?rev=294879=294878=294879=diff
> 
> ==
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Sat Feb 11 17:44:37 2017
> @@ -10163,7 +10163,7 @@ void gnutools::Linker::ConstructJob(Comp
>Args.ClaimAllArgs(options::OPT_w);
>
>const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
> -  if (llvm::sys::path::filename(Exec) == "lld") {
> +  if (llvm::sys::path::stem(Exec) == "lld") {
>  CmdArgs.push_back("-flavor");
>  CmdArgs.push_back("old-gnu");
>

This line caught my attention. I think we've removed "-flavor old-gnu" a
long time ago. Is that still live somewhere?


>  CmdArgs.push_back("-target");
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r294879 - [Driver] Use stem() and not filename().

2017-02-11 Thread Davide Italiano via cfe-commits
Author: davide
Date: Sat Feb 11 17:44:37 2017
New Revision: 294879

URL: http://llvm.org/viewvc/llvm-project?rev=294879=rev
Log:
[Driver] Use stem() and not filename().

On Windows the filename might have an extension, namely
`.exe`, so the search will fail. Sorry, I don't have a
good way to test this as it seems to fail only in some
weird configurations. r284430 has the same modification
for Fuchsia.

Modified:
cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=294879=294878=294879=diff
==
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat Feb 11 17:44:37 2017
@@ -10163,7 +10163,7 @@ void gnutools::Linker::ConstructJob(Comp
   Args.ClaimAllArgs(options::OPT_w);
 
   const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
-  if (llvm::sys::path::filename(Exec) == "lld") {
+  if (llvm::sys::path::stem(Exec) == "lld") {
 CmdArgs.push_back("-flavor");
 CmdArgs.push_back("old-gnu");
 CmdArgs.push_back("-target");


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits