r196865 - Revert r196859, "Use llvm::sys::path::append to concatenate paths", to appease FileManager.
NAKAMURA Takumi
geek4civic at gmail.com
Mon Dec 9 18:36:28 PST 2013
Author: chapuni
Date: Mon Dec 9 20:36:28 2013
New Revision: 196865
URL: http://llvm.org/viewvc/llvm-project?rev=196865&view=rev
Log:
Revert r196859, "Use llvm::sys::path::append to concatenate paths", to appease FileManager.
Modified:
cfe/trunk/lib/Lex/HeaderSearch.cpp
Modified: cfe/trunk/lib/Lex/HeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/HeaderSearch.cpp?rev=196865&r1=196864&r2=196865&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/HeaderSearch.cpp (original)
+++ cfe/trunk/lib/Lex/HeaderSearch.cpp Mon Dec 9 20:36:28 2013
@@ -549,9 +549,12 @@ const FileEntry *HeaderSearch::LookupFil
// 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.
- SmallString<1024> TmpDir(CurFileEnt->getDir()->getName());
- llvm::sys::path::append(TmpDir, Filename);
+ // FIXME: Portability. Filename concatenation should be in sys::Path.
+ TmpDir += CurFileEnt->getDir()->getName();
+ TmpDir.push_back('/');
+ TmpDir.append(Filename.begin(), Filename.end());
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.
More information about the cfe-commits
mailing list