diff options
| author | Patrick Walton <[email protected]> | 2010-12-01 19:03:47 -0800 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-12-01 19:03:47 -0800 |
| commit | eeecc8d0617b547520083b9db94ec05f84fbca64 (patch) | |
| tree | f175cb07047adaab21529180bd4ae2e0a9b65a15 /src/comp/lib | |
| parent | Add code to fail on non-exhaustive alt matching. Fix all cases this picked up... (diff) | |
| download | rust-eeecc8d0617b547520083b9db94ec05f84fbca64.tar.xz rust-eeecc8d0617b547520083b9db94ec05f84fbca64.zip | |
rustc: Add stub support for tag constructors in trans
Diffstat (limited to 'src/comp/lib')
| -rw-r--r-- | src/comp/lib/llvm.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/comp/lib/llvm.rs b/src/comp/lib/llvm.rs index 0db40e89..15fc68e4 100644 --- a/src/comp/lib/llvm.rs +++ b/src/comp/lib/llvm.rs @@ -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); |