Skip to content
Snippets Groups Projects
  1. May 14, 2016
    • Bruno Cardoso Lopes's avatar
      [ModuleMap][CrashReproducer] Collect headers from inner frameworks · cfb1624a
      Bruno Cardoso Lopes authored
      (1) Collect headers under inner frameworks (frameworks inside other
      other frameworks).
      (2) Make sure we also collect the right header files inside them.
      
      More info on (2):
      
      Consider a dummy framework module B, with header Frameworks/B/B.h. Now
      consider that another framework A, with header Frameworks/A/A.h, has a
      layout with a inner framework Frameworks/A/Frameworks/B/B.h, where the
      "B/B.h" part is a symlink for Frameworks/B/B.h. Also assume that
      Frameworks/A/A.h includes <B/B.h>.
      
      When parsing header Frameworks/A/A.h, framework module lookup is
      performed in search for B, and it happens that
      "Frameworks/A/Frameworks/B/B.h" path is registered in the module instead
      of real "Frameworks/B/B.h". This occurs because
      "Frameworks/A/Frameworks/B/B.h" is scanned first by the FileManager,
      when looking for inner framework modules under Frameworks/A/Frameworks.
      This makes Frameworks/A/Frameworks/B/B.h the default cached named inside
      the FileManager for the B.h file UID.
      
      This leads to modules being built without consistent paths to underlying
      header files. This is usually not a problem in regular compilation flow,
      but it's an issue when running the crash reproducer. The issue is that
      clangs collect "Frameworks/A/Frameworks/B/B.h" but not
      "Frameworks/B/B.h" into the VFS, leading to err_mmap_umbrella_clash. So
      make sure we also collect the original header.
      
      Differential Revision: http://reviews.llvm.org/D20194
      
      rdar://problem/25880368
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269502 91177308-0d34-0410-b5e6-96231b3b80d8
      cfb1624a
  2. May 07, 2016
  3. Apr 27, 2016
  4. Mar 31, 2016
    • Bruno Cardoso Lopes's avatar
      [CrashReproducer] Add a module map callback for added headers · fd80727d
      Bruno Cardoso Lopes authored
      The current ModuleDependencyCollector has a AST listener to collect
      header files present in loaded modules, but this isn't enough to collect
      all headers needed in the crash reproducer. One of the reasons is that
      the AST writer doesn't write symbolic link header paths in the pcm modules,
      this makes the listeners on the reader only able to collect the real files.
      
      Since the module maps could contain submodules that use headers which
      are symbolic links, not collecting those forbid the reproducer scripts
      to regen the modules.
      
      For instance:
      
      usr/include/module.map:
        ...
        module pthread {
          header "pthread.h"
          export *
      
          module impl {
            header "pthread_impl.h"
            export *
          }
        }
        ...
      
      usr/include/pthread/pthread_impl.h
      usr/include/pthread_impl.h -> pthread/pthread_impl.h
      
      The AST dump for the module above:
      
        <SUBMODULE_HEADER abbrevid=6/> blob data = 'pthread_impl.h'
        <SUBMODULE_TOPHEADER abbrevid=7/> blob data = '/<path_to_sdk>/usr/include/pthread/pthread_impl.h'
      
      Note that we don't have "usr/include/pthread_impl.h" which is requested
      by the module.map in case we want to reconstruct the module in the
      reproducer. The reason the original symbolic link path isn't used is
      because the headers are kept by name and requested through the
      FileManager, which unique files and returns the real path only.
      
      To fix that, add a callback to be invoked everytime a header is added
      while parsing module maps and hook that up to the module dependecy
      collector. This callback is only registered when generating the
      reproducer.
      
      Differential Revision: http://reviews.llvm.org/D18585
      
      rdar://problem/24499339
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264971 91177308-0d34-0410-b5e6-96231b3b80d8
      fd80727d
  5. Mar 14, 2016
  6. Feb 19, 2016
  7. Oct 20, 2015
  8. Aug 24, 2015
  9. Aug 19, 2015
  10. Aug 09, 2015
  11. Jul 14, 2015
  12. Jul 02, 2015
    • Ben Langmuir's avatar
      [Modules] Be consistent about finding a module for framework headers · 66f5404e
      Ben Langmuir authored
      We use findModuleForHeader() in several places, but in header search we
      were not calling it when a framework module didn't show up with the
      expected name, which would then lead to unexpected non-modular includes.
      Now we will find the module unconditionally for frameworks.  For regular
      frameworks, we use the spelling of the module name from the module map
      file, and for inferred ones we use the canonical directory name.
      
      In the future we might want to lock down framework modules sufficiently
      that these name mismatches cannot happen.
      
      rdar://problem/20465870
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241258 91177308-0d34-0410-b5e6-96231b3b80d8
      66f5404e
  13. Jun 23, 2015
  14. Jun 22, 2015
  15. Jun 10, 2015
  16. Jun 05, 2015
  17. May 16, 2015
  18. May 01, 2015
  19. Feb 15, 2015
  20. Jan 13, 2015
  21. Dec 10, 2014
    • Richard Smith's avatar
      Reinstate r223753, reverted in r223759 due to breakage of clang-tools-extra. · b247819d
      Richard Smith authored
      Original commit message:
      
      [modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.
      
      For files named by -fmodule-map-file=, and files found by 'extern module'
      directives, this flag specifies that we should resolve filenames relative to
      the current working directory rather than relative to the directory in which
      the module map file resides. This is aimed at fixing path handling, in
      particular for relative -I paths, when building modules that represent
      components of the current project (rather than libraries installed on the
      current system, which the current project has as dependencies, where we'd
      typically expect the module map files to be looked up implicitly).
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223913 91177308-0d34-0410-b5e6-96231b3b80d8
      b247819d
  22. Dec 09, 2014
  23. Dec 02, 2014
  24. Oct 24, 2014
  25. Oct 23, 2014
  26. Aug 12, 2014
  27. Aug 10, 2014
  28. Aug 09, 2014
  29. May 06, 2014
  30. May 05, 2014
  31. Apr 18, 2014
  32. Apr 14, 2014
    • Ben Langmuir's avatar
      Allow multiple modules with the same name to coexist in the module cache · ef1b5dcd
      Ben Langmuir authored
      To differentiate between two modules with the same name, we will
      consider the path the module map file that they are defined by* part of
      the ‘key’ for looking up the precompiled module (pcm file).
      Specifically, this patch renames the precompiled module (pcm) files from
        cache-path/<module hash>/Foo.pcm
      to
        cache-path/<module hash>/Foo-<hash of module map path>.pcm
      
      In addition, I’ve taught the ASTReader to re-resolve the names of
      imported modules during module loading so that if the header search
      context changes between when a module was originally built and when it
      is loaded we can rebuild it if necessary.  For example, if module A
      imports module B
      
      first time:
      clang -I /path/to/A -I /path/to/B ...
      
      second time:
      clang -I /path/to/A -I /different/path/to/B ...
      
      will now rebuild A as expected.
      
      * in the case of inferred modules, we use the module map file that
      allowed the inference, not the __inferred_module.map file, since the
      inferred file path is the same for every inferred module.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206201 91177308-0d34-0410-b5e6-96231b3b80d8
      ef1b5dcd
  33. Apr 10, 2014
  34. Apr 08, 2014
  35. Dec 20, 2013
    • Daniel Jasper's avatar
      Enable layering check in unavailable modules. · 67e05a13
      Daniel Jasper authored
      If a header file belonging to a certain module is not found on the
      filesystem, that header gets marked as unavailable. Now, the layering
      warning (-fmodules-decluse) should still warn about headers of this
      module being wrongfully included. Currently, headers belonging to those
      modules are just treated as not belonging to modules at all which means
      they can be included freely from everywhere.
      
      To implement this (somewhat) cleanly, I have moved most of the layering
      checks into the ModuleMap. This will also help with showing FixIts
      later.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197805 91177308-0d34-0410-b5e6-96231b3b80d8
      67e05a13
Loading