[LLVMdev] Replacing types, use of refineAbstractType

Chris Lattner clattner at apple.com
Mon Aug 9 17:56:23 PDT 2010


On Aug 3, 2010, at 8:07 AM, Eric McCorkle wrote:

> I'm working on a personal project which involves lowering a superset of 
> LLVM to "vanilla" LLVM.  Part of this involves rewriting types.  I'm 
> working off of the 2.6 code base, so this may have been addressed in a bug 
> fix.

Hi Eric,

Make sure you read this:
http://llvm.org/docs/ProgrammersManual.html#TypeResolve

If that doesn't help, please try upgrading to mainline.  If that doesn't help, we'll need a bug with some way to reproduce it.

-Chris

> 
> I'm having trouble with refineAbstractType and recursive types. 
> Specifically, I'm creating opaque types to serve as placeholders for the 
> final recursive type, then using refineAbstractType to replace the 
> placeholders with the actual type.  However, pointers to the opaque type 
> aren't being replaced with pointers to the actual type, which causes 
> errors further down the line.
> 
> For instance, if I had a type:
> 
> %t = { %t*, ... }
> 
> My pass would begin constructing a new type, say %t_1, and would replace 
> all instances of %t with an opaque type, so...
> 
> $t_0 = opaque
> %t_1 = { %t_0*, ... }
> 
> At the end, it calls t_1->refineAbstracType(t_0, t_1) to replace instances 
> of t_0 with t_1.  But the resulting type I get is still
> 
> %t_1 = { %t_0*, ... }
> 
> Is this a bug, or is it supposed to work this way, and I need to do 
> something else to accomplish what I'm trying to accomplish?
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list