must store instructions really have the exact same type pointer?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

must store instructions really have the exact same type pointer?

edA-qa mort-ora-y
I'm getting frustrated by assertions whenever I create a store inst (via
builder CreateStore). I get the error "Ptr must be a pointer to Val
type!" My destination is a pointer to an equivalent to the source type.
The problem is that the types were created via different generation
paths and the underlying structure is a distinct object (with the exact
same fields).

I seem to recall that IR actually merges equivalent types, so I'm always
confused about this error. My type manager already has lots of extra
code just trying to merge types, but I seem to have missed one.  If the
assert were removed would the code actually work? Could the assert
perhaps do a more logical check of equivalence?

--
edA-qa mort-ora-y
Leaf Creator

Leaf - the language we always wanted
http://leaflang.org/
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: must store instructions really have the exact same type pointer?

Jeremy Lakeman
Named structure types are no longer merged, though they used to be.



On Tue, Dec 3, 2013 at 4:41 AM, edA-qa mort-ora-y <[hidden email]> wrote:
I'm getting frustrated by assertions whenever I create a store inst (via
builder CreateStore). I get the error "Ptr must be a pointer to Val
type!" My destination is a pointer to an equivalent to the source type.
The problem is that the types were created via different generation
paths and the underlying structure is a distinct object (with the exact
same fields).

I seem to recall that IR actually merges equivalent types, so I'm always
confused about this error. My type manager already has lots of extra
code just trying to merge types, but I seem to have missed one.  If the
assert were removed would the code actually work? Could the assert
perhaps do a more logical check of equivalence?

--
edA-qa mort-ora-y
Leaf Creator

Leaf - the language we always wanted
http://leaflang.org/
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev