[cfe-commits] [PATCH] Clean up CXX Base Specifiers in AST reader

Douglas Gregor dgregor at apple.com
Thu Jul 21 13:41:25 PDT 2011


On Jul 21, 2011, at 1:22 PM, Jonathan Turner wrote:

> 
> On Jul 21, 2011, at 12:20 PM, Douglas Gregor wrote:
> 
>> +  /// Number of CXX base specifiers currently loaded
>> +  unsigned TotalCXXBaseSizeInBits;
>> +
>>  /// Number of lexical decl contexts read/total.
>>  unsigned NumLexicalDeclContextsRead, TotalLexicalDeclContexts;
>> 
>> The comment here is incorrect, and I think this should be a uint64_t.
> 
> Fixed.
> 
>> So, I suggest making two ContinuousRangeMaps: one for actually mapping the base specifier IDs (for indexing purposes) and another for mapping from global bit numbers (a uint64_t) to local bit numbers. Loading a CXXBaseSpecifier will look in both maps (which is fine), and the second map will be useful in other places as well.
> 
> In GetCXXBaseSpecifiersOffset, we're adding the global bit size (or base size) up to the found PerFileData to an offset from the CXXBaseSpecifiersOffsets table in PerFileData.  To my understanding, it's not using a global->local map, and I *think* the only bit-related stuff it has is SizeInBits.  One solution would be to add the global bit size base (up to this AST) to the PerFileData. 

Sounds good to me.

	- Doug



More information about the cfe-commits mailing list