[LLVMdev] RefineAbstractType

David Greene dag at cray.com
Fri Nov 14 16:31:06 PST 2008

On Thursday 13 November 2008 18:27, David Greene wrote:
> On Wednesday 12 November 2008 19:13, Chris Lattner wrote:
> > You shouldn't be refining the pointer, you should use:
> >
> > t1->refineAbstractType(t2)
> Ok, I tried this and I get further.  But the type system seems to have
> trouble when refining multiple types and those types resolve to the same
> thing. I turned on DEBUG_MERGE_TYPES to illustrate:

Attached is some code that illustrates what I think is the problem.

Compile with 
g++ -D__STDC_LIMIT_MACROS -I<path to LLVM headers> -L<path to LLVM libraries> 
-lLLVMCore -lLLVMSupport -lLLVMSystem -ldl

(I built with LLVM 2.4)


i32 (\1)
opaque (i32)

This looks totally wrong.  Am I using refineAbstractTypeTo incorrectly?

I think what's happening is the internal type confusion exhibited in the 
output above is propagating through our compiler and eventually causes
bad stuff to happen.  When I step through in the debugger I see weird
unrelated types like the opaque (i32) above.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: refine.cc
Type: text/x-c++src
Size: 983 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081114/d5b04336/attachment.cc>

More information about the llvm-dev mailing list