[PATCH] D18213: Add a module Hash in the bitcode and the combined index.

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 17:01:09 PDT 2016


> On Mar 29, 2016, at 4:58 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> 
> 
>> On 2016-Mar-29, at 16:16, Mehdi AMINI <mehdi.amini at apple.com> wrote:
>> 
>> joker.eph updated this revision to Diff 52002.
>> joker.eph marked 6 inline comments as done.
>> joker.eph added a comment.
>> 
>> Taking comments into account.
>> 
>> 
>> http://reviews.llvm.org/D18213
>> 
>> Files:
>> include/llvm/Bitcode/BitstreamReader.h
>> include/llvm/Bitcode/LLVMBitCodes.h
>> include/llvm/Bitcode/ReaderWriter.h
>> include/llvm/IR/ModuleSummaryIndex.h
>> lib/Bitcode/Reader/BitcodeReader.cpp
>> lib/Bitcode/Writer/BitcodeWriter.cpp
>> lib/IR/ModuleSummaryIndex.cpp
>> lib/Transforms/IPO/FunctionImport.cpp
>> tools/llvm-as/llvm-as.cpp
>> tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
>> 
>> <D18213.52002.patch>
> 
> Found a weird spacing issue below (I haven't looked deeply; I figure
> Rafael and Teresa are already looking at this one?  Happy to look if
> need be though.)
> 
>> Index: include/llvm/Bitcode/LLVMBitCodes.h
>> ===================================================================
>> --- include/llvm/Bitcode/LLVMBitCodes.h
>> +++ include/llvm/Bitcode/LLVMBitCodes.h
>> @@ -71,43 +71,46 @@
>> enum { BITCODE_CURRENT_EPOCH = 0 };
>> 
>>   /// MODULE blocks have a number of optional fields and subblocks.
>> -  enum ModuleCodes {
>> -    MODULE_CODE_VERSION     = 1,    // VERSION:     [version#]
>> -    MODULE_CODE_TRIPLE      = 2,    // TRIPLE:      [strchr x N]
>> -    MODULE_CODE_DATALAYOUT  = 3,    // DATALAYOUT:  [strchr x N]
>> -    MODULE_CODE_ASM         = 4,    // ASM:         [strchr x N]
>> -    MODULE_CODE_SECTIONNAME = 5,    // SECTIONNAME: [strchr x N]
>> +enum ModuleCodes {
>> +  MODULE_CODE_VERSION = 1,     // VERSION:     [version#]
>> +  MODULE_CODE_TRIPLE = 2,      // TRIPLE:      [strchr x N]
>> +  MODULE_CODE_DATALAYOUT = 3,  // DATALAYOUT:  [strchr x N]
>> +  MODULE_CODE_ASM = 4,         // ASM:         [strchr x N]
>> +  MODULE_CODE_SECTIONNAME = 5, // SECTIONNAME: [strchr x N]
> 
> This spacing change seems unrelated (and inconsistent with the enums
> above and below

Oh, that's clang-format, my first iterations on the patch I took care to manually revert the formatting in this file, and then I gave up.
I can reduce the diff to the only line change on commit though.

-- 
Mehdi





> ).
> 
>> 
>> -    // FIXME: Remove DEPLIB in 4.0.
>> -    MODULE_CODE_DEPLIB      = 6,    // DEPLIB:      [strchr x N]
>> +  // FIXME: Remove DEPLIB in 4.0.
>> +  MODULE_CODE_DEPLIB = 6, // DEPLIB:      [strchr x N]
>> 
>> -    // GLOBALVAR: [pointer type, isconst, initid,
>> -    //             linkage, alignment, section, visibility, threadlocal]
>> -    MODULE_CODE_GLOBALVAR   = 7,
>> +  // GLOBALVAR: [pointer type, isconst, initid,
>> +  //             linkage, alignment, section, visibility, threadlocal]
>> +  MODULE_CODE_GLOBALVAR = 7,
>> 
>> -    // FUNCTION:  [type, callingconv, isproto, linkage, paramattrs, alignment,
>> -    //             section, visibility, gc, unnamed_addr]
>> -    MODULE_CODE_FUNCTION    = 8,
>> +  // FUNCTION:  [type, callingconv, isproto, linkage, paramattrs, alignment,
>> +  //             section, visibility, gc, unnamed_addr]
>> +  MODULE_CODE_FUNCTION = 8,
>> 
>> -    // ALIAS: [alias type, aliasee val#, linkage, visibility]
>> -    MODULE_CODE_ALIAS_OLD   = 9,
>> +  // ALIAS: [alias type, aliasee val#, linkage, visibility]
>> +  MODULE_CODE_ALIAS_OLD = 9,
>> 
>> -    // MODULE_CODE_PURGEVALS: [numvals]
>> -    MODULE_CODE_PURGEVALS   = 10,
>> +  // MODULE_CODE_PURGEVALS: [numvals]
>> +  MODULE_CODE_PURGEVALS = 10,
>> 
>> -    MODULE_CODE_GCNAME      = 11,  // GCNAME: [strchr x N]
>> -    MODULE_CODE_COMDAT      = 12,  // COMDAT: [selection_kind, name]
>> +  MODULE_CODE_GCNAME = 11, // GCNAME: [strchr x N]
>> +  MODULE_CODE_COMDAT = 12, // COMDAT: [selection_kind, name]
>> 
>> -    MODULE_CODE_VSTOFFSET   = 13,  // VSTOFFSET: [offset]
>> +  MODULE_CODE_VSTOFFSET = 13, // VSTOFFSET: [offset]
>> 
>> -    // ALIAS: [alias value type, addrspace, aliasee val#, linkage, visibility]
>> -    MODULE_CODE_ALIAS       = 14,
>> +  // ALIAS: [alias value type, addrspace, aliasee val#, linkage, visibility]
>> +  MODULE_CODE_ALIAS = 14,
>> 
>> -    MODULE_CODE_METADATA_VALUES_UNUSED = 15,
>> +  MODULE_CODE_METADATA_VALUES_UNUSED = 15,
>> 
>> -    // SOURCE_FILENAME: [namechar x N]
>> -    MODULE_CODE_SOURCE_FILENAME = 16,
>> -  };
>> +  // SOURCE_FILENAME: [namechar x N]
>> +  MODULE_CODE_SOURCE_FILENAME = 16,
>> +
>> +  // HASH: [5*i32]
>> +  MODULE_CODE_HASH = 17,
>> +};
>> 
>>   /// PARAMATTR blocks have code for defining a parameter attribute set.
>>   enum AttributeCodes {
>> @@ -182,7 +185,8 @@
>> 
>>   // The module path symbol table only has one code (MST_CODE_ENTRY).
>>   enum ModulePathSymtabCodes {
>> -    MST_CODE_ENTRY   = 1,  // MST_ENTRY: [modid, namechar x N]
>> +    MST_CODE_ENTRY = 1, // MST_ENTRY: [modid, namechar x N]
>> +    MST_CODE_HASH = 2,  // MST_HASH:  [5*i32]
>>   };
>> 
>>   // The summary section uses different codes in the per-module
> 



More information about the llvm-commits mailing list