aboutsummaryrefslogtreecommitdiff
path: root/src/comp/lib
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-12-01 19:03:47 -0800
committerPatrick Walton <[email protected]>2010-12-01 19:03:47 -0800
commiteeecc8d0617b547520083b9db94ec05f84fbca64 (patch)
treef175cb07047adaab21529180bd4ae2e0a9b65a15 /src/comp/lib
parentAdd code to fail on non-exhaustive alt matching. Fix all cases this picked up... (diff)
downloadrust-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.rs13
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);