[LLVMdev] RefineAbstractType

Chris Lattner clattner at apple.com
Wed Nov 12 17:13:08 PST 2008


On Nov 12, 2008, at 5:07 PM, David Greene wrote:

> On Wednesday 12 November 2008 18:58, Chris Lattner wrote:
>> On Nov 12, 2008, at 3:37 PM, David Greene wrote:
>>>>> Unfortunately, calling FunctionType::refineAbstractType(opaque,  
>>>>> void
>>>>> (...))
>>>>> doesn't work because RefineAbstractType doesn't recurse down into
>>>>> the
>>>>> pointee types.
>>>>
>>>> What types are you starting out with?  If you had the equivalent  
>>>> of:
>>>>
>>>> %t1 = type opaque
>>>> %t2 = type void(%t1*)
>>>>
>>>> and you refine t1 -> t2, it should work.
>>>
>>> I'm not sure it will.  %t1* is the "contained" type inside the
>>> FunctionType.
>>> RefineAbstractTypes expects the OldType (%t1 in this case) to be in
>>> the
>>> contained type set.  Since a _pointer_ to %t1 is in the contained
>>> set, it
>>> doesn't see it.
>>
>> How is this any different than the struct case of {\2*} ?
>
> I don't know.  All I know is when I called %t2- 
> >refineAbstractType(%t1, %t2)
> it didn't work.  That was the pointer of the question.   
> RefineAbstractTypes
> doesn't "see" beyond the pointer type.

You shouldn't be refining the pointer, you should use:

t1->refineAbstractType(t2)

-Chris




More information about the llvm-dev mailing list