tccgen: nocode_wanted alternatively
tccgen.c: remove any 'nocode_wanted' checks, except in - greloca(), disables output elf symbols and relocs - get_reg(), will return just the first suitable reg) - save_regs(), will do nothing Some minor adjustments were made where nocode_wanted is set. xxx-gen.c: disable code output directly where it happens in functions: - g(), output disabled - gjmp(), will do nothing - gtst(), dto.
This commit is contained in:
7
tccasm.c
7
tccasm.c
@ -915,8 +915,12 @@ static void asm_parse_directive(TCCState *s1)
|
||||
/* assemble a file */
|
||||
static int tcc_assemble_internal(TCCState *s1, int do_preprocess)
|
||||
{
|
||||
int saved_nocode_wanted;
|
||||
int opcode;
|
||||
|
||||
saved_nocode_wanted = nocode_wanted;
|
||||
nocode_wanted = 0;
|
||||
|
||||
/* XXX: undefine C labels */
|
||||
|
||||
ch = file->buf_ptr[0];
|
||||
@ -960,7 +964,7 @@ static int tcc_assemble_internal(TCCState *s1, int do_preprocess)
|
||||
/* handle "extern void vide(void); __asm__("vide: ret");" as
|
||||
"__asm__("globl vide\nvide: ret");" */
|
||||
Sym *sym = sym_find(opcode);
|
||||
if (sym && (sym->type.t & VT_EXTERN) && nocode_wanted) {
|
||||
if (sym && (sym->type.t & VT_EXTERN) && saved_nocode_wanted) {
|
||||
sym = label_find(opcode);
|
||||
if (!sym) {
|
||||
sym = label_push(&s1->asm_labels, opcode, 0);
|
||||
@ -989,6 +993,7 @@ static int tcc_assemble_internal(TCCState *s1, int do_preprocess)
|
||||
|
||||
asm_free_labels(s1);
|
||||
|
||||
nocode_wanted = saved_nocode_wanted;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user