diff options
author | Kresten Krab Thorup <krab@gcc.gnu.org> | 1993-08-24 10:00:49 +0000 |
---|---|---|
committer | Kresten Krab Thorup <krab@gcc.gnu.org> | 1993-08-24 10:00:49 +0000 |
commit | 2224b8ccb3168be658d6462abd66900aa496ff7d (patch) | |
tree | 9ab75e61f20fda30e95c802f881175434b222e42 /gcc | |
parent | 62b9a7120685798499b35a04a5d24af7d85400b5 (diff) | |
download | gcc-2224b8ccb3168be658d6462abd66900aa496ff7d.zip gcc-2224b8ccb3168be658d6462abd66900aa496ff7d.tar.gz gcc-2224b8ccb3168be658d6462abd66900aa496ff7d.tar.bz2 |
(nil_method): Don't define it, import it from sendmsg.c.
(arglist_t): Data-definition changed.
From-SVN: r5204
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/objc/objc.h | 47 |
1 files changed, 17 insertions, 30 deletions
diff --git a/gcc/objc/objc.h b/gcc/objc/objc.h index 4bb9da3..6f0f3ae 100644 --- a/gcc/objc/objc.h +++ b/gcc/objc/objc.h @@ -123,51 +123,38 @@ typedef struct objc_protocol { struct objc_method_description_list *instance_methods, *class_methods; } Protocol; -#else - +#else /* __OBJC__ */ @class Protocol; #endif typedef void* retval_t; /* return value */ typedef void(*apply_t)(void); /* function pointer */ +typedef union { + char *arg_ptr; + char arg_regs[sizeof (char*)]; +} *arglist_t; /* argument frame */ -#if defined(REG_ARGS) || defined(STACK_ARGS) - -typedef struct { - char* arg_pointer; -#ifdef STRUCT_RETURN - void* struct_return; -#endif -#ifdef REG_ARGS - void* regs[2]; -#endif -} *arglist_t; - -#ifdef REG_ARGS -#define __objc_frame_receiver(FRAME) (FRAME)->regs[0] -#define __objc_frame_selector(FRAME) ((SEL)(FRAME)->regs[1]) - -#else -#define __objc_frame_receiver(FRAME) ((id*)(FRAME)->arg_pointer)[0] -#define __objc_frame_selector(FRAME) ((SEL*)(FRAME)->arg_pointer)[1] -#endif -#else - -typedef void* arglist_t; - -#endif #if defined(__OBJC__) - #include "objc/sarray.h" -static id nil_method(id rcv, SEL op, ...) { return rcv; } +/* + This is the function called when messages are send to nil. You may + set a breakpoint in your debugger at this function to catch messages + too nil. +*/ +extern id nil_method(id rcv, SEL op, ...); +/* + The messager is inlined, thus it is defined here directly. The + inlining is quite time-consuming when optimizing. This will be + taken care of later by hand-coding the messager in the compiler. +*/ extern __inline__ IMP objc_msg_lookup(id receiver, SEL op) { if(receiver) - return sarray_get(receiver->class_pointer->dtable, (size_t) op); + return sarray_get(receiver->class_pointer->dtable, (size_t)(op)); else return nil_method; } |