Displaying 1 result from an estimated 1 matches for "numbytessizet".
2011 Apr 06
2
[LLVMdev] Target independency using "opaque"? How to do it else?
...que types are replaced at load time by codegen::RuntimeLib
%sizet_ty = type opaque
%intptrt_ty = type opaque
; ... then in a function I do:
%sizeof_value_ty = ptrtoint %value_ty* getelementptr (%value_ty* null,
i32 1) to i32
%numBytesToAlloc = mul i32 %num, %sizeof_value_ty
%numBytesSizeT = bitcast i32 %numBytesToAlloc to %sizet_ty
%memory = call i8* @malloc(%sizet_ty %numBytesSizeT)
However, it always fails to compile this li-file to bitcode at the bitcast
instruction, and says
error: invalid cast opcode for cast from 'i32' to 'opaque'
It appears one cann...