move some global variables into TCCState

This commit is contained in:
grischka
2009-05-11 18:45:44 +02:00
parent 5c6509578e
commit f9181416f6
9 changed files with 91 additions and 86 deletions

View File

@ -183,7 +183,7 @@ int tcc_output_coff(TCCState *s1, FILE *f)
coff_sec->s_nlnno = 0;
coff_sec->s_lnnoptr = 0;
if (do_debug && tcc_sect == stext) {
if (s1->do_debug && tcc_sect == stext) {
// count how many line nos data
// also find association between source file name and function
@ -311,7 +311,7 @@ int tcc_output_coff(TCCState *s1, FILE *f)
file_hdr.f_symptr = file_pointer; /* file pointer to symtab */
if (do_debug)
if (s1->do_debug)
file_hdr.f_nsyms = coff_nb_syms; /* number of symtab entries */
else
file_hdr.f_nsyms = 0;
@ -362,7 +362,7 @@ int tcc_output_coff(TCCState *s1, FILE *f)
// group the symbols in order of filename, func1, func2, etc
// finally global symbols
if (do_debug)
if (s1->do_debug)
SortSymbolTable();
// write line no data
@ -371,7 +371,7 @@ int tcc_output_coff(TCCState *s1, FILE *f)
coff_sec = &section_header[i];
tcc_sect = s1->sections[i];
if (do_debug && tcc_sect == stext) {
if (s1->do_debug && tcc_sect == stext) {
// count how many line nos data
@ -499,7 +499,7 @@ int tcc_output_coff(TCCState *s1, FILE *f)
}
// write symbol table
if (do_debug) {
if (s1->do_debug) {
int k;
struct syment csym;
AUXFUNC auxfunc;
@ -670,7 +670,7 @@ int tcc_output_coff(TCCState *s1, FILE *f)
}
}
if (do_debug) {
if (s1->do_debug) {
// write string table
// first write the size