Paste: LLVM type resolution bug(?)
Author: | yuuki |
Mode: | c |
Date: | Thu, 25 Jun 2009 15:57:51 |
Plain Text |
#include <llvm-c/Core.h>
int main (int argc, const char * argv[]) {
LLVMTypeHandleRef handle;
LLVMTypeRef concrete;
LLVMTypeRef back1star = LLVMPointerType(LLVMOpaqueType(), 0);
concrete = LLVMPointerType(back1star, 0);
handle = LLVMCreateTypeHandle(back1star);
LLVMRefineType(back1star, concrete);
back1star = LLVMResolveTypeHandle(handle);
LLVMDisposeTypeHandle(handle);
LLVMTypeRef inner_back1star = LLVMPointerType(LLVMOpaqueType(), 0);
LLVMTypeRef struct_back1star = LLVMStructType(&inner_back1star, 1, 0);
LLVMTypeRef inner_concrete = LLVMPointerType(inner_back1star, 0);
concrete = LLVMStructType(&inner_concrete, 1, 0);
handle = LLVMCreateTypeHandle(struct_back1star);
LLVMRefineType(struct_back1star, concrete);
struct_back1star = LLVMResolveTypeHandle(handle);
LLVMDisposeTypeHandle(handle);
LLVMModuleRef m = LLVMModuleCreateWithName("type-info");
LLVMAddTypeName(m, "back1star", back1star);
LLVMAddTypeName(m, "struct_back1star", struct_back1star);
LLVMDumpModule(m);
LLVMDisposeModule(m);
}
New Annotation