r206342 - Fixed problem with exclude header. The exclude header argument needs to be relative to the module.map file.

John Thompson John.Thompson.JTSoftware at gmail.com
Tue Apr 15 17:07:06 PDT 2014


Author: jtsoftware
Date: Tue Apr 15 19:07:06 2014
New Revision: 206342

URL: http://llvm.org/viewvc/llvm-project?rev=206342&view=rev
Log:
Fixed problem with exclude header. The exclude header argument needs to be relative to the module.map file.

Modified:
    cfe/trunk/lib/Lex/ModuleMap.cpp
    cfe/trunk/test/Modules/Inputs/exclude-header/module.map

Modified: cfe/trunk/lib/Lex/ModuleMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ModuleMap.cpp?rev=206342&r1=206341&r2=206342&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ModuleMap.cpp (original)
+++ cfe/trunk/lib/Lex/ModuleMap.cpp Tue Apr 15 19:07:06 2014
@@ -1006,8 +1006,6 @@ namespace clang {
     void parseConflict();
     void parseInferredModuleDecl(bool Framework, bool Explicit);
     bool parseOptionalAttributes(Attributes &Attrs);
-
-    const DirectoryEntry *getOverriddenHeaderSearchDir();
     
   public:
     explicit ModuleMapParser(Lexer &L, SourceManager &SourceMgr, 
@@ -1628,10 +1626,6 @@ void ModuleMapParser::parseHeaderDecl(MM
   if (llvm::sys::path::is_absolute(Header.FileName)) {
     PathName = Header.FileName;
     File = SourceMgr.getFileManager().getFile(PathName);
-  } else if (const DirectoryEntry *Dir = getOverriddenHeaderSearchDir()) {
-    PathName = Dir->getName();
-    llvm::sys::path::append(PathName, Header.FileName);
-    File = SourceMgr.getFileManager().getFile(PathName);
   } else {
     // Search for the header file within the search directory.
     PathName = Directory->getName();
@@ -2184,22 +2178,6 @@ bool ModuleMapParser::parseOptionalAttri
   return HadError;
 }
 
-/// \brief If there is a specific header search directory due the presence
-/// of an umbrella directory, retrieve that directory. Otherwise, returns null.
-const DirectoryEntry *ModuleMapParser::getOverriddenHeaderSearchDir() {
-  for (Module *Mod = ActiveModule; Mod; Mod = Mod->Parent) {
-    // If we have an umbrella directory, use that.
-    if (Mod->hasUmbrellaDir())
-      return Mod->getUmbrellaDir();
-    
-    // If we have a framework directory, stop looking.
-    if (Mod->IsFramework)
-      return 0;
-  }
-  
-  return 0;
-}
-
 /// \brief Parse a module map file.
 ///
 ///   module-map-file:

Modified: cfe/trunk/test/Modules/Inputs/exclude-header/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/exclude-header/module.map?rev=206342&r1=206341&r2=206342&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/exclude-header/module.map (original)
+++ cfe/trunk/test/Modules/Inputs/exclude-header/module.map Tue Apr 15 19:07:06 2014
@@ -1,3 +1,3 @@
-module x { umbrella "x" exclude header "x/bad.h" exclude header "y/b.h" module * {} }
+module x { umbrella "x" exclude header "x/bad.h" module * {} }
 module y { umbrella "y" module * {} }
 module bad { header "x/bad.h" }





More information about the cfe-commits mailing list