[llvm-commits] [llvm-gcc-4.2] r45757 - in /llvm-gcc-4.2/trunk/gcc: llvm-types.cpp tree.c tree.h

Devang Patel dpatel at apple.com
Tue Jan 8 16:16:26 PST 2008


On Jan 8, 2008, at 2:36 PM, Dale Johannesen wrote:

>
> On Jan 8, 2008, at 2:28 PM, Chris Lattner wrote:
>
>> On Jan 8, 2008, at 1:08 PM, Dale Johannesen wrote:
>>> URL: http://llvm.org/viewvc/llvm-project?rev=45757&view=rev
>>> Log:
>>> Fix gcc->llvm translation for virtual base classes.  pr1746
>>
>> Yay, very nice Dale.
>>
>>> +/// Mapping from type to type-used-as-base-class and back.
>>> +static DenseMap<tree, tree> BaseTypesMap;
>>
>> Does this play well with PCH?  Please add a comment above this that  
>> says that the trees are kept pinned for the GC by the  
>> llvm_types_used map.
>>
>> If this doesn't work with PCH (Devang, thoughts?) it might be  
>> better to use the GCC splay tree or whatever they use for tree- 
>> >tree mappings.
>
> I haven't tried it (except that there are no failures in the PCH  
> part of the gcc testsuite, which probably doesn't prove much).
> It should be OK for the map to be zeroes after a PCH read; all that  
> will happen is some trees get rebuilt when this might be avoidable.


> It should also be OK for it to contain tree's, since all such trees  
> are referred to from GTY'd storage.

BaseTypeMap is empty at the beginning. PCH reading does not insert any  
entries so this map will be empty after PCH read. If LLVM types refers  
to mapped tree nodes then it is OK because such tree nodes are GTY'd.

As long as it is safe to rebuilt some trees for BaseTypeMap this patch  
looks OK.

-
Devang






More information about the llvm-commits mailing list