search for: llvmstructtyp

Displaying 2 results from an estimated 2 matches for "llvmstructtyp".

Did you mean: llvmstructtype
2008 Sep 08
3
[LLVMdev] Problems when refining type
...maybe I'm way off base. ------------- #include "Core.h" int main() { LLVMTypeRef a = LLVMPointerType(LLVMOpaqueType(), 0); LLVMTypeHandleRef ha = LLVMCreateTypeHandle(a); LLVMTypeRef atypes[1] = { LLVMResolveTypeHandle(ha) }; LLVMRefineType(LLVMResolveTypeHandle(ha), LLVMStructType(atypes, 1, 0)); LLVMTypeRef b = LLVMPointerType(LLVMOpaqueType(), 0); // assert here .... } ------------- The assertion text is: Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!", file ...\llvm\include\llvm/Support/Casting.h, l...
2008 Sep 08
0
[LLVMdev] Problems when refining type
...008 at 2:45 PM, Scott Graham <scott.llvm at h4ck3r.net> wrote: > LLVMTypeRef a = LLVMPointerType(LLVMOpaqueType(), 0); > LLVMTypeHandleRef ha = LLVMCreateTypeHandle(a); > LLVMTypeRef atypes[1] = { LLVMResolveTypeHandle(ha) }; > LLVMRefineType(LLVMResolveTypeHandle(ha), LLVMStructType(atypes, 1, 0)); > > Can anyone explain what I'm doing wrong here? It looks like a bug; the type map is somehow holding onto a stale pointer to an opaque type. That said, refining a pointer type is a very unusual operation; I'd suggest sticking to refining opaque types. -Eli