From a20bb946f60c647c8ad97b8dc0ca1f6a717989dd Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 8 Oct 2002 22:35:37 +0000 Subject: [PATCH] type.[ch]: provide a vector structure def so vector.[xyz] can be implemented def.c: record the return address in get_temp to aid debugging --- tools/qfcc/include/type.h | 2 ++ tools/qfcc/source/def.c | 1 + tools/qfcc/source/type.c | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/tools/qfcc/include/type.h b/tools/qfcc/include/type.h index cddcc2529..c9ae8370b 100644 --- a/tools/qfcc/include/type.h +++ b/tools/qfcc/include/type.h @@ -73,6 +73,8 @@ extern type_t *type_category; extern type_t *type_ivar; extern type_t *type_module; +extern type_t *vector_struct; + struct dstring_s; type_t *new_type (void); diff --git a/tools/qfcc/source/def.c b/tools/qfcc/source/def.c index db06397f1..586d5bc4f 100644 --- a/tools/qfcc/source/def.c +++ b/tools/qfcc/source/def.c @@ -387,6 +387,7 @@ get_tempdef (type_t *type, scope_t *scope) def->type = type; } else { def = new_def (type, 0, scope); + def->return_addr = __builtin_return_address (0); def->ofs = new_location (type, scope->space); } def->freed = def->removed = def->users = 0; diff --git a/tools/qfcc/source/type.c b/tools/qfcc/source/type.c index 194e257ea..ceb2fb7d2 100644 --- a/tools/qfcc/source/type.c +++ b/tools/qfcc/source/type.c @@ -91,6 +91,8 @@ type_t *type_category; type_t *type_ivar; type_t *type_module; +type_t *vector_struct; + type_t type_floatfield = { ev_field, ".float", NULL, &type_float }; static type_t *free_types; @@ -584,6 +586,11 @@ init_types (void) if (options.traditional) return; + type = vector_struct = new_struct (0); + new_struct_field (type, &type_float, "x", vis_public); + new_struct_field (type, &type_float, "y", vis_public); + new_struct_field (type, &type_float, "z", vis_public); + type = type_SEL.aux_type = new_struct (0); new_struct_field (type, &type_string, "sel_id", vis_public); new_struct_field (type, &type_string, "sel_types", vis_public);