[qfcc] Save caller to new_symbol* in symbol_t

I should go through and do this for all the structs (not looking forward
to expr_t) as it's sometimes quite handy to know who created something.
This commit is contained in:
Bill Currie 2024-12-11 02:41:13 +09:00
parent 306306fc5a
commit b2049f496b
2 changed files with 3 additions and 0 deletions

View file

@ -94,6 +94,7 @@ typedef struct symbol_s {
ex_list_t list; ///< sy_list
sy_xvalue_t xvalue; ///< sy_xvalue
};
void *return_addr;
} symbol_t;
typedef enum {

View file

@ -75,6 +75,7 @@ new_symbol (const char *name)
if (name) {
symbol->name = save_string (name);
}
symbol->return_addr = __builtin_return_address (0);
return symbol;
}
@ -84,6 +85,7 @@ new_symbol_type (const char *name, const type_t *type)
symbol_t *symbol;
symbol = new_symbol (name);
symbol->type = type;
symbol->return_addr = __builtin_return_address (0);
return symbol;
}