[LLVMdev] Problems when refining type
Eli Friedman
eli.friedman at gmail.com
Mon Sep 8 16:24:53 PDT 2008
On Mon, Sep 8, 2008 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
More information about the llvm-dev
mailing list