about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-04-17 18:45:58 -0700
committerbors <bors@rust-lang.org>2013-04-17 18:45:58 -0700
commitfdb4ef321ed5eee681c2b723dcb157c280aa72f2 (patch)
tree7f38fcabd13cba2ff4577b32360abe43720490fc /src/rt/rust_builtin.cpp
parent68dea752967fa2c7e0c4b82f476086457c93fff7 (diff)
parenta5ddc009829bef149a9e2f127e80609589604443 (diff)
downloadrust-fdb4ef321ed5eee681c2b723dcb157c280aa72f2.tar.gz
rust-fdb4ef321ed5eee681c2b723dcb157c280aa72f2.zip
auto merge of #5726 : brson/rust/struct-return, r=brson
r? @nikomatsakis

This doesn't completely fix the x86 ABI for structs, but it does fix some cases. On linux, structs appear to be returned correctly now. On windows, structs are only returned by pointer when they are greater than 8 bytes. That scenario works now.

In the case where the struct is less than 8 bytes our generated code looks peculiar. When returning a pair of u16, C packs both variables into %eax to return them. Our generated code though expects to find one of the pair in %ax and the other in %dx. Similar for u8. I haven't looked into it yet.

There appears to also be struct passing problems on linux, where my `extern-pass-TwoU8s` and `extern-pass-TwoU16s` tests are failing.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp86
1 files changed, 0 insertions, 86 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 3c6cc9d9245..475c030e8f2 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -589,50 +589,6 @@ rust_log_console_off() {
     log_console_off(task->kernel->env);
 }
 
-extern "C" CDECL lock_and_signal *
-rust_dbg_lock_create() {
-    return new lock_and_signal();
-}
-
-extern "C" CDECL void
-rust_dbg_lock_destroy(lock_and_signal *lock) {
-    assert(lock);
-    delete lock;
-}
-
-extern "C" CDECL void
-rust_dbg_lock_lock(lock_and_signal *lock) {
-    assert(lock);
-    lock->lock();
-}
-
-extern "C" CDECL void
-rust_dbg_lock_unlock(lock_and_signal *lock) {
-    assert(lock);
-    lock->unlock();
-}
-
-extern "C" CDECL void
-rust_dbg_lock_wait(lock_and_signal *lock) {
-    assert(lock);
-    lock->wait();
-}
-
-extern "C" CDECL void
-rust_dbg_lock_signal(lock_and_signal *lock) {
-    assert(lock);
-    lock->signal();
-}
-
-typedef void *(*dbg_callback)(void*);
-
-extern "C" CDECL void *
-rust_dbg_call(dbg_callback cb, void *data) {
-    return cb(data);
-}
-
-extern "C" CDECL void rust_dbg_do_nothing() { }
-
 extern "C" CDECL void
 rust_dbg_breakpoint() {
     BREAKPOINT_AWESOME;
@@ -844,48 +800,6 @@ rust_readdir() {
 
 #endif
 
-// These functions are used in the unit tests for C ABI calls.
-
-extern "C" CDECL uint32_t
-rust_dbg_extern_identity_u32(uint32_t u) {
-    return u;
-}
-
-extern "C" CDECL uint64_t
-rust_dbg_extern_identity_u64(uint64_t u) {
-    return u;
-}
-
-struct TwoU64s {
-    uint64_t one;
-    uint64_t two;
-};
-
-extern "C" CDECL TwoU64s
-rust_dbg_extern_identity_TwoU64s(TwoU64s u) {
-    return u;
-}
-
-struct TwoDoubles {
-    double one;
-    double two;
-};
-
-extern "C" CDECL TwoDoubles
-rust_dbg_extern_identity_TwoDoubles(TwoDoubles u) {
-    return u;
-}
-
-extern "C" CDECL double
-rust_dbg_extern_identity_double(double u) {
-    return u;
-}
-
-extern "C" CDECL char
-rust_dbg_extern_identity_u8(char u) {
-    return u;
-}
-
 extern "C" rust_env*
 rust_get_rt_env() {
     rust_task *task = rust_get_current_task();