Skip to content
Snippets Groups Projects
  • Duncan P. N. Exon Smith's avatar
    d15b1db6
    Modules: Use hash of PCM content for SIGNATURE · d15b1db6
    Duncan P. N. Exon Smith authored
    Change ASTFileSignature from a random 32-bit number to the hash of the
    PCM content.
    
      - Move definition ASTFileSignature to Basic/Module.h so Module and
        ASTSourceDescriptor can use it.
    
      - Change the signature from uint64_t to std::array<uint32_t,5>.
    
      - Stop using (saving/reading) the size and modification time of PCM
        files when there is a valid SIGNATURE.
    
      - Add UNHASHED_CONTROL_BLOCK, and use it to store the SIGNATURE record
        and other records that shouldn't affect the hash.  Because implicit
        modules reuses the same file for multiple levels of -Werror, this
        includes DIAGNOSTIC_OPTIONS and DIAG_PRAGMA_MAPPINGS.
    
    This helps to solve a PCH + implicit Modules dependency issue: PCH files
    are handled by the external build system, whereas implicit modules are
    handled by internal compiler build system.  This prevents invalidating a
    PCH when the compiler overwrites a PCM file with the same content
    (modulo the diagnostic differences).
    
    Design and original patch by Manman Ren!
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297655 91177308-0d34-0410-b5e6-96231b3b80d8
    d15b1db6
    History
    Modules: Use hash of PCM content for SIGNATURE
    Duncan P. N. Exon Smith authored
    Change ASTFileSignature from a random 32-bit number to the hash of the
    PCM content.
    
      - Move definition ASTFileSignature to Basic/Module.h so Module and
        ASTSourceDescriptor can use it.
    
      - Change the signature from uint64_t to std::array<uint32_t,5>.
    
      - Stop using (saving/reading) the size and modification time of PCM
        files when there is a valid SIGNATURE.
    
      - Add UNHASHED_CONTROL_BLOCK, and use it to store the SIGNATURE record
        and other records that shouldn't affect the hash.  Because implicit
        modules reuses the same file for multiple levels of -Werror, this
        includes DIAGNOSTIC_OPTIONS and DIAG_PRAGMA_MAPPINGS.
    
    This helps to solve a PCH + implicit Modules dependency issue: PCH files
    are handled by the external build system, whereas implicit modules are
    handled by internal compiler build system.  This prevents invalidating a
    PCH when the compiler overwrites a PCM file with the same content
    (modulo the diagnostic differences).
    
    Design and original patch by Manman Ren!
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297655 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.