Can anyone tell me where my blunder is in the following program?
llvm-as reports:
llvm-as: testit.ll:11: Can't store 'opaque *' into space of type
'opaque
*'!
Which doesn't seem to make sense to me. What is it that is illegal about
storing a pointer to opaque in a space that is of type pointer to
opaque? Is it just that you can't store pointers to opaque?
%path = internal constant [11 x sbyte] c"/some/path\00"
implementation ; Functions:
declare opaque* %open(sbyte*)
internal int %testme(int, sbyte**) {
%stdout = alloca opaque*
%pathp = getelementptr [11 x sbyte]* %path, uint 0, uint 0
%handle = call opaque* %open( sbyte* %pathp )
store opaque* %handle, opaque* %stdout ; This
is line 11
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20060609/8e35674f/attachment.sig>
On Fri, 9 Jun 2006, Reid Spencer wrote:> Can anyone tell me where my blunder is in the following program? > llvm-as reports: > llvm-as: testit.ll:11: Can't store 'opaque *' into space of type 'opaque > *'! > > Which doesn't seem to make sense to me. What is it that is illegal about > storing a pointer to opaque in a space that is of type pointer to > opaque? Is it just that you can't store pointers to opaque?The problem is that all instances of the string "opaque" are different types in .ll files. Try using something like: %opaque1 = type opaque %opaque2 = type opaque at the top, then use %opaque1/%opaque2/.. whereever you need them (or use even better names). This way, each distinct opaque type is only "mentioned" once and you are explicit about which opaque type you are using. -Chris> %path = internal constant [11 x sbyte] c"/some/path\00" > > implementation ; Functions: > > declare opaque* %open(sbyte*) > > internal int %testme(int, sbyte**) { > %stdout = alloca opaque* > %pathp = getelementptr [11 x sbyte]* %path, uint 0, uint 0 > %handle = call opaque* %open( sbyte* %pathp ) > store opaque* %handle, opaque* %stdout ; This > is line 11 > } > >-Chris -- http://nondot.org/sabre/ http://llvm.org/
Reasonably Related Threads
- [PATCH v13 4/5] mm: support reporting free page blocks
- [PATCH v13 4/5] mm: support reporting free page blocks
- [PATCH v12 6/8] mm: support reporting free page blocks
- [PATCH v12 6/8] mm: support reporting free page blocks
- [PATCH v12 6/8] mm: support reporting free page blocks