diff options
author | Igor Kudrin <ikudrin.dev@gmail.com> | 2015-09-30 10:39:37 +0000 |
---|---|---|
committer | Igor Kudrin <ikudrin.dev@gmail.com> | 2015-09-30 10:39:37 +0000 |
commit | f03d2b4d1cbcee4abfb2dd8ada90725198f67ccd (patch) | |
tree | 744d114a3ea22577c9cfaebd71e913c273d8138e | |
parent | 8a3ec2aec2a7ddc94df3443fa759dfaf0667ff9b (diff) | |
download | bcm5719-llvm-f03d2b4d1cbcee4abfb2dd8ada90725198f67ccd.tar.gz bcm5719-llvm-f03d2b4d1cbcee4abfb2dd8ada90725198f67ccd.zip |
[ELF2] Simplify buildSysrootedPath()
Reviewed by: rafael
llvm-svn: 248885
-rw-r--r-- | lld/ELF/Driver.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 921de4cd6ba..bcc8a6ab578 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -61,17 +61,14 @@ static std::unique_ptr<InputFile> createFile(MemoryBufferRef MB) { } // Makes a path by concatenating Dir and File. -// If Dir starts with "=" the result will be preceded by SysRoot, +// If Dir starts with '=' the result will be preceded by Sysroot, // which can be set with --sysroot command line switch. static std::string buildSysrootedPath(StringRef Dir, StringRef File) { SmallString<128> Path; - if (Dir.startswith("=")) { - Path.assign(Config->Sysroot); - sys::path::append(Path, Dir.substr(1), File); - } else { - Path.assign(Dir); - sys::path::append(Path, File); - } + if (Dir.startswith("=")) + sys::path::append(Path, Config->Sysroot, Dir.substr(1), File); + else + sys::path::append(Path, Dir, File); return Path.str().str(); } |