Skip to content
  1. Mar 21, 2013
  2. Mar 20, 2013
    • Douglas Gregor's avatar
      <rdar://problem/12368093> Extend module maps with a 'conflict' declaration,... · fb912657
      Douglas Gregor authored
      <rdar://problem/12368093> Extend module maps with a 'conflict' declaration, and warn when a newly-imported module conflicts with an already-imported module.
      
      llvm-svn: 177577
      fb912657
    • Douglas Gregor's avatar
      <rdar://problem/10796651> Introduce configuration macros into module maps. · 35b13ece
      Douglas Gregor authored
      Configuration macros are macros that are intended to alter how a
      module works, such that we need to build different module variants
      for different values of these macros. A module can declare its
      configuration macros, in which case we will complain if the definition
      of a configation macro on the command line (or lack thereof) differs
      from the current preprocessor state at the point where the module is
      imported. This should eliminate some surprises when enabling modules,
      because "#define CONFIG_MACRO ..." followed by "#include
      <module/header.h>" would silently ignore the CONFIG_MACRO setting. At
      least it will no longer be silent about it.
      
      Configuration macros are eventually intended to help reduce the number
      of module variants that need to be built. When the list of
      configuration macros for a module is exhaustive, we only need to
      consider the settings for those macros when building/finding the
      module, which can help isolate modules for various project-specific -D
      flags that should never affect how modules are build (but currently do).
      
      llvm-svn: 177466
      35b13ece
  3. Mar 19, 2013
    • Douglas Gregor's avatar
      <rdar://problem/13363214> Eliminate race condition between module rebuild and... · 7029ce1a
      Douglas Gregor authored
      <rdar://problem/13363214> Eliminate race condition between module rebuild and the global module index.
      
      The global module index was querying the file manager for each of the
      module files it knows about at load time, to prune out any out-of-date
      information. The file manager would then cache the results of the
      stat() falls used to find that module file.
      
      Later, the same translation unit could end up trying to import one of the
      module files that had previously been ignored by the module cache, but
      after some other Clang instance rebuilt the module file to bring it
      up-to-date. The stale stat() results in the file manager would
      trigger a second rebuild of the already-up-to-date module, causing
      failures down the line.
      
      The global module index now lazily resolves its module file references
      to actual AST reader module files only after the module file has been
      loaded, eliminating the stat-caching race. Moreover, the AST reader
      can communicate to its caller that a module file is missing (rather
      than simply being out-of-date), allowing us to simplify the
      module-loading logic and allowing the compiler to recover if a
      dependent module file ends up getting deleted.
      
      llvm-svn: 177367
      7029ce1a
  4. Feb 18, 2013
    • Douglas Gregor's avatar
      Ensure that the identifier chains have the most recent declaration after module deserialization. · 6168bd23
      Douglas Gregor authored
      This commit introduces a set of related changes to ensure that the
      declaration that shows up in the identifier chain after deserializing
      declarations with a given identifier is, in fact, the most recent
      declaration. The primary change involves waiting until after we
      deserialize and wire up redeclaration chains before updating the
      identifier chains. There is a minor optimization in here to avoid
      recursively deserializing names as part of looking to see whether
      top-level declarations for a given name exist.
      
      A related change that became suddenly more urgent is to property
      record a merged declaration when an entity first declared in the
      current translation unit is later deserialized from a module (that had
      not been loaded at the time of the original declaration). Since we key
      off the canonical declaration (which is parsed, not from an AST file)
      for emitted redeclarations, we simply record this as a merged
      declaration during AST writing and let the readers merge them.
      
      Re-fixes <rdar://problem/13189985>, presumably for good this time.
      
      llvm-svn: 175447
      6168bd23
  5. Feb 13, 2013
  6. Feb 12, 2013
  7. Feb 11, 2013
    • Douglas Gregor's avatar
      [Modules] Cope better with top-level declarations loaded after being declared... · dcf25087
      Douglas Gregor authored
      [Modules] Cope better with top-level declarations loaded after being declared in the current translation unit <rdar://problem/13189985>.
      
      These two related tweaks to keep the information associated with a
      given identifier correct when the identifier has been given some
      top-level information (say, a top-level declaration) and more
      information is then loaded from a module. The first ensures that an
      identifier that was "interesting" before being loaded from an AST is
      considered to be different from its on-disk counterpart. Otherwise, we
      lose such changes when writing the current translation unit as a
      module.
      
      Second, teach the code that injects AST-loaded names into the
      identifier chain for name lookup to keep the most recent declaration,
      so that we don't end up confusing our declaration chains by having a
      different declaration in there.
      
      llvm-svn: 174895
      dcf25087
  8. Feb 09, 2013
    • Douglas Gregor's avatar
      Ensure that type definitions present in just-loaded modules are · 7dab26b8
      Douglas Gregor authored
      visible.
      
      The basic problem here is that a given translation unit can use
      forward declarations to form pointers to a given type, say,
      
        class X;
        X *x;
      
      and then import a module that includes a definition of X:
      
        import XDef;
      
      We will then fail when attempting to access a member of X, e.g., 
      
        x->method()
      
      because the AST reader did not know to look for a default of a class
      named X within the new module.
      
      This implementation is a bit of a C-centric hack, because the only
      definitions that can have this property are enums, structs, unions,
      Objective-C classes, and Objective-C protocols, and all of those are
      either visible at the top-level or can't be defined later. Hence, we
      can use the out-of-date-ness of the name and the identifier-update
      mechanism to force the update.
      
      In C++, we will not be so lucky, and will need a more advanced
      solution, because the definitions could be in namespaces defined in
      two different modules, e.g.,
      
        // module 1
        namespace N { struct X; }
      
        // module 2
        namespace N { struct X { /* ... */ }; }
      
      One possible implementation here is for C++ to extend the information
      associated with each identifier table to include the declaration IDs
      of any definitions associated with that name, regardless of
      context. We would have to eagerly load those definitions.
      
      llvm-svn: 174794
      7dab26b8
  9. Feb 08, 2013
  10. Feb 07, 2013
  11. Feb 06, 2013
  12. Feb 02, 2013
  13. Jan 28, 2013
  14. Jan 25, 2013
    • NAKAMURA Takumi's avatar
      d7512b34
    • Douglas Gregor's avatar
      Implement the reader of the global module index and wire it into the · e060e57b
      Douglas Gregor authored
      AST reader.
      
      The global module index tracks all of the identifiers known to a set
      of module files. Lookup of those identifiers looks first in the global
      module index, which returns the set of module files in which that
      identifier can be found. The AST reader only needs to look into those
      module files and any module files not known to the global index (e.g.,
      because they were (re)built after the global index), reducing the
      number of on-disk hash tables to visit. For an example source I'm
      looking at, we go from 237844 total identifier lookups into on-disk
      hash tables down to 126817.
      
      Unfortunately, this does not translate into a performance advantage.
      At best, it's a wash once the global module index has been built, but
      that's ignore the cost of building the global module index (which
      is itself fairly large). Profiles show that the global module index
      code is far less efficient than it should be; optimizing it might give
      enough of an advantage to justify its continued inclusion.
      
      llvm-svn: 173405
      e060e57b
    • Douglas Gregor's avatar
      Rename the -cc1 option "-generate-module-index" to · c1bbec85
      Douglas Gregor authored
      "-fmodules-global-index" and expand its behavior to include both the
      use and generation of the global module index.
      
      llvm-svn: 173404
      c1bbec85
  15. Jan 24, 2013
  16. Jan 23, 2013
    • Douglas Gregor's avatar
      Implement the writer side of the global module index. · 5e306b12
      Douglas Gregor authored
      The global module index is a "global" index for all of the module
      files within a particular subdirectory in the module cache, which
      keeps track of all of the "interesting" identifiers and selectors
      known in each of the module files. One can perform a fast lookup in
      the index to determine which module files will have more information
      about entities with a particular name/selector. This information can
      help eliminate redundant lookups into module files (a serious
      performance problem) and help with creating auto-import/auto-include
      Fix-Its.
      
      The global module index is created or updated at the end of a
      translation unit that has triggered a (re)build of a module by
      scraping all of the .pcm files out of the module cache subdirectory,
      so it catches everything. As with module rebuilds, we use the file
      system's atomicity to synchronize.
      
      llvm-svn: 173301
      5e306b12
    • Argyrios Kyrtzidis's avatar
      [PCH] Temporarily disable the "ambiguous macro" warning that is currently bogus with a PCH · 1ffbc3a9
      Argyrios Kyrtzidis authored
      that redefined a macro without undef'ing it first.
      
      Proper reconstruction of the macro info history from modules will properly fix this in subsequent commits.
      
      rdar://13016031
      
      llvm-svn: 173281
      1ffbc3a9
  17. Jan 17, 2013
  18. Jan 16, 2013
  19. Jan 14, 2013
Loading