[lld] r254032 - ELF2: Factor out isUnderSysroot from readLinkerScript. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 14:45:31 PST 2015


On Tue, Nov 24, 2015 at 2:39 PM, Joerg Sonnenberger via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> On Tue, Nov 24, 2015 at 10:26:33PM -0000, Rui Ueyama via llvm-commits
> wrote:
> > Modified: lld/trunk/ELF/LinkerScript.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=254032&r1=254031&r2=254032&view=diff
> >
> ==============================================================================
> > --- lld/trunk/ELF/LinkerScript.cpp (original)
> > +++ lld/trunk/ELF/LinkerScript.cpp Tue Nov 24 16:26:33 2015
> > @@ -297,14 +297,17 @@ void LinkerScript::readOutputSectionDesc
> >    }
> >  }
> >
> > +static bool isUnderSysroot(StringRef Path) {
> > +  if (Config->Sysroot == "")
> > +    return false;
> > +  for (; !Path.empty(); Path = sys::path::parent_path(Path))
> > +    if (sys::fs::equivalent(Config->Sysroot, Path))
> > +      return true;
> > +  return false;
> > +}
>
> Can you change it back to use .empty()?
>

Is that preferred? I changed that since Config::Sysroot type is not very
obvious in this context (I thought for a while about whether it is a vector
or a StringRef). I thought that this would improve readability.


>
> Joerg
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151124/9719cb16/attachment.html>


More information about the llvm-commits mailing list