]> granicus.if.org Git - clang/commitdiff
Use llvm::sys::path::append to concatenate paths
authorDmitri Gribenko <gribozavr@gmail.com>
Tue, 10 Dec 2013 01:36:10 +0000 (01:36 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Tue, 10 Dec 2013 01:36:10 +0000 (01:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196859 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/HeaderSearch.cpp

index 9e43dda226bf47837fcb402cca677479f0b958ca..17d518b8d85b8bfc1835b2cd0d3dae8a5060e397 100644 (file)
@@ -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.