diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-12-10 01:36:10 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-12-10 01:36:10 +0000 |
commit | 76857f82bac72b5685d9c378d133164e1b2a98ac (patch) | |
tree | c064de78c5c2cd6d82d9926db6cb288f31dc2950 | |
parent | 6eee080450133c42ba557ae212b5e991180663f4 (diff) | |
download | bcm5719-llvm-76857f82bac72b5685d9c378d133164e1b2a98ac.tar.gz bcm5719-llvm-76857f82bac72b5685d9c378d133164e1b2a98ac.zip |
Use llvm::sys::path::append to concatenate paths
llvm-svn: 196859
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 9e43dda226b..17d518b8d85 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -549,12 +549,9 @@ const FileEntry *HeaderSearch::LookupFile( // a subsequent include of "baz.h" should resolve to "whatever/foo/baz.h". // This search is not done for <> headers. if (CurFileEnt && !isAngled && !NoCurDirSearch) { - SmallString<1024> TmpDir; // Concatenate the requested file onto the directory. - // FIXME: Portability. Filename concatenation should be in sys::Path. - TmpDir += CurFileEnt->getDir()->getName(); - TmpDir.push_back('/'); - TmpDir.append(Filename.begin(), Filename.end()); + SmallString<1024> TmpDir(CurFileEnt->getDir()->getName()); + llvm::sys::path::append(TmpDir, Filename); if (const FileEntry *FE = FileMgr.getFile(TmpDir.str(),/*openFile=*/true)) { // Leave CurDir unset. // This file is a system header or C++ unfriendly if the old file is. |