Skip to content
  • Ted Kremenek's avatar
    IdentifierInfo: · a705b04d
    Ted Kremenek authored
    - IdentifierInfo can now (optionally) have its string data not be
      co-located with itself.  This is for use with PTH.  This aspect is a
      little gross, as getName() and getLength() now make assumptions
      about a possible alternate representation of IdentifierInfo.
      Perhaps we should make IdentifierInfo have virtual methods?
    
    IdentifierTable:
    - Added class "IdentifierInfoLookup" that can be used by
      IdentifierTable to perform "string -> IdentifierInfo" lookups using
      an auxilliary data structure.  This is used by PTH.
    - Perform tests show that IdentifierTable::get() does not slow down
      because of the extra check for the IdentiferInfoLookup object (the
      regular StringMap lookup does enough work to mitigate the impact of
      an extra null pointer check).
    - The upshot is that now that some IdentifierInfo objects might be
      owned by the IdentiferInfoLookup object.  This should be reviewed.
    
    PTH:
    - Modified PTHManager::GetIdentifierInfo to *not* insert entries in
      IdentifierTable's string map, and instead create IdentifierInfo
      objects on the fly when mapping from persistent IDs to
      IdentifierInfos.  This saves a ton of work with string copies,
      hashing, and StringMap lookup and resizing.  This change was
      motivated because when processing source files in the PTH cache we
      don't need to do any string -> IdentifierInfo lookups.
    - PTHManager now subclasses IdentifierInfoLookup, allowing clients of
      IdentifierTable to transparently use IdentifierInfo objects managed
      by the PTH file.  PTHManager resolves "string -> IdentifierInfo"
      queries by doing a binary search over a sorted table of identifier
      strings in the PTH file (the exact algorithm we use can be changed
      as needed).
    
    These changes lead to the following performance changes when using PTH on Cocoa.h:
    - fsyntax-only: 10% performance improvement
    - Eonly: 30% performance improvement
    
    llvm-svn: 62273
    a705b04d
Loading