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

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 14:39:18 PST 2015


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()?

Joerg


More information about the llvm-commits mailing list