[clang-tools-extra] r223914 - Update to match clang r223913.

Richard Smith richard-llvm at metafoo.co.uk
Tue Dec 9 19:10:06 PST 2014


Author: rsmith
Date: Tue Dec  9 21:10:06 2014
New Revision: 223914

URL: http://llvm.org/viewvc/llvm-project?rev=223914&view=rev
Log:
Update to match clang r223913.

Modified:
    clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp

Modified: clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp?rev=223914&r1=223913&r2=223914&view=diff
==============================================================================
--- clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp (original)
+++ clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp Tue Dec  9 21:10:06 2014
@@ -292,8 +292,21 @@ bool ModuleMapChecker::loadModuleMap() {
   // which doesn't forward the BeginSourceFile call, we do it explicitly here.
   DC.BeginSourceFile(*LangOpts, nullptr);
 
+  // Figure out the home directory for the module map file.
+  // FIXME: Add an option to specify this.
+  const DirectoryEntry *Dir = ModuleMapEntry->getDir();
+  StringRef DirName(Dir->getName());
+  if (llvm::sys::path::filename(DirName) == "Modules") {
+    DirName = llvm::sys::path::parent_path(DirName);
+    if (DirName.endswith(".framework"))
+      Dir = FileMgr->getDirectory(DirName);
+    // FIXME: This assert can fail if there's a race between the above check
+    // and the removal of the directory.
+    assert(Dir && "parent must exist");
+  }
+
   // Parse module.map file into module map.
-  if (ModMap->parseModuleMapFile(ModuleMapEntry, false))
+  if (ModMap->parseModuleMapFile(ModuleMapEntry, false, Dir))
     return false;
 
   // Do matching end call.





More information about the cfe-commits mailing list