rustc: Add stub support for tag constructors in trans

This commit is contained in:
Patrick Walton
2010-12-01 19:03:47 -08:00
parent 98a63bd1f9
commit eeecc8d061
3 changed files with 139 additions and 1 deletions

View File

@@ -1106,6 +1106,19 @@ obj builder(BuilderRef B) {
}
}
/* Memory-managed object interface to type handles. */
obj type_handle_dtor(TypeHandleRef TH) {
drop { llvm.LLVMDisposeTypeHandle(TH); }
}
type type_handle = rec(TypeHandleRef llth, type_handle_dtor dtor);
fn mk_type_handle() -> type_handle {
auto th = llvm.LLVMCreateTypeHandle(llvm.LLVMOpaqueType());
ret rec(llth=th, dtor=type_handle_dtor(th));
}
fn type_to_str(TypeRef ty) -> str {
let int kind = llvm.LLVMGetTypeKind(ty);