]> granicus.if.org Git - clang/commitdiff
Revert "[Modules] Make header inclusion order from umbrella dirs deterministic"
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Mon, 12 Dec 2016 23:22:30 +0000 (23:22 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Mon, 12 Dec 2016 23:22:30 +0000 (23:22 +0000)
Reverts commit r289478.

This broke
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/2070
(and maybe
http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/builds/2246)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289494 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/FrontendActions.cpp

index ef008d1428f9e510936dc1f467a97da41d5d7874..eb91940cbbfc8078ad05eecf314ec8edbe62a144 100644 (file)
@@ -233,7 +233,6 @@ collectModuleHeaderIncludes(const LangOptions &LangOpts, FileManager &FileMgr,
     llvm::sys::path::native(UmbrellaDir.Entry->getName(), DirNative);
 
     vfs::FileSystem &FS = *FileMgr.getVirtualFileSystem();
-    SmallVector<std::pair<std::string, const FileEntry *>, 8> Headers;
     for (vfs::recursive_directory_iterator Dir(FS, DirNative, EC), End;
          Dir != End && !EC; Dir.increment(EC)) {
       // Check whether this entry has an extension typically associated with 
@@ -264,20 +263,13 @@ collectModuleHeaderIncludes(const LangOptions &LangOpts, FileManager &FileMgr,
            ++It)
         llvm::sys::path::append(RelativeHeader, *It);
 
-      Headers.push_back(std::make_pair(RelativeHeader.str(), Header));
+      // Include this header as part of the umbrella directory.
+      Module->addTopHeader(Header);
+      addHeaderInclude(RelativeHeader, Includes, LangOpts, Module->IsExternC);
     }
 
     if (EC)
       return EC;
-
-    // Sort header paths and make the header inclusion order deterministic
-    // across different OSs and filesystems.
-    llvm::array_pod_sort(Headers.begin(), Headers.end());
-    for (auto &H : Headers) {
-      // Include this header as part of the umbrella directory.
-      Module->addTopHeader(H.second);
-      addHeaderInclude(H.first, Includes, LangOpts, Module->IsExternC);
-    }
   }
 
   // Recurse into submodules.