]> granicus.if.org Git - clang/commitdiff
Tweak the module auto-import heuristics a bit
authorDouglas Gregor <dgregor@apple.com>
Fri, 16 Sep 2011 00:22:46 +0000 (00:22 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 16 Sep 2011 00:22:46 +0000 (00:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139887 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/HeaderSearch.cpp

index 8a35080fe04f4f22345bcaecad75e32a978b6c86..ca641d4c0dc313f189bc2797d35d5ffde1155635 100644 (file)
@@ -289,7 +289,8 @@ const FileEntry *DirectoryLookup::DoFrameworkLookup(
 
   /// Determine whether this is the module we're building or not.
   bool AutomaticImport = SuggestedModule &&
-    (BuildingModule != StringRef(Filename.begin(), SlashPos));
+    (BuildingModule != StringRef(Filename.begin(), SlashPos)) &&
+    !Filename.substr(SlashPos + 1).startswith("..");
   
   FrameworkName.append(Filename.begin()+SlashPos+1, Filename.end());
   if (const FileEntry *FE = FileMgr.getFile(FrameworkName.str(),