output: remove the completely unused set_info method

Every single backend has this method set to NULL.  It is also a
rather strange interface.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin 2017-03-31 11:41:16 -07:00
parent 31a14699fb
commit ac06133ed2
14 changed files with 3 additions and 93 deletions

View File

@ -935,7 +935,6 @@ static bool process_arg(char *p, char *q, int pass)
}
switch (s) {
case OPT_PREFIX:
case OPT_POSTFIX:
{
@ -959,8 +958,7 @@ static bool process_arg(char *p, char *q, int pass)
strlcpy(lpostfix, param, POSTFIX_MAX);
break;
default:
nasm_panic(ERR_NOFILE,
"internal error");
panic();
break;
}
break;
@ -977,9 +975,8 @@ static bool process_arg(char *p, char *q, int pass)
}
default:
if (!ofmt->setinfo(GI_SWITCH, &p))
nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
"unrecognised option `-%c'", p[1]);
nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
"unrecognised option `-%c'", p[1]);
break;
}
} else if (pass == 2) {

View File

@ -696,8 +696,6 @@ typedef struct insn { /* an instruction itself */
int8_t evex_brerop; /* BR/ER/SAE operand position */
} insn;
enum geninfo { GI_SWITCH };
/* Instruction flags type: IF_* flags are defined in insns.h */
typedef uint64_t iflags_t;
@ -801,15 +799,6 @@ struct ofmt {
*/
void (*init)(void);
/*
* This procedure is called to pass generic information to the
* object file. The first parameter gives the information type
* (currently only command line switches)
* and the second parameter gives the value. This function returns
* 1 if recognized, 0 if unrecognized
*/
int (*setinfo)(enum geninfo type, char **string);
/*
* This is the modern output function, which gets passed
* a struct out_data with much more information. See the

View File

@ -35,13 +35,6 @@
#include "nasmlib.h"
#include "outlib.h"
int null_setinfo(enum geninfo type, char **string)
{
(void)type;
(void)string;
return 0;
}
enum directive_result
null_directive(enum directives directive, char *value, int pass)
{

View File

@ -914,7 +914,6 @@ const struct ofmt of_aout = {
&null_debug_form,
aout_stdmac,
aout_init,
null_setinfo,
nasm_do_legacy_output,
aout_out,
aout_deflabel,
@ -940,7 +939,6 @@ const struct ofmt of_aoutb = {
&null_debug_form,
aout_stdmac,
aoutb_init,
null_setinfo,
nasm_do_legacy_output,
aout_out,
aout_deflabel,

View File

@ -635,7 +635,6 @@ const struct ofmt of_as86 = {
&null_debug_form,
as86_stdmac,
as86_init,
null_setinfo,
nasm_do_legacy_output,
as86_out,
as86_deflabel,

View File

@ -1397,13 +1397,6 @@ static int32_t bin_segbase(int32_t segment)
return segment;
}
static int bin_set_info(enum geninfo type, char **val)
{
(void)type;
(void)val;
return 0;
}
const struct ofmt of_bin, of_ith, of_srec;
static void binfmt_init(void);
static void do_output_bin(void);
@ -1663,7 +1656,6 @@ const struct ofmt of_bin = {
&null_debug_form,
bin_stdmac,
bin_init,
bin_set_info,
nasm_do_legacy_output,
bin_out,
bin_deflabel,
@ -1685,7 +1677,6 @@ const struct ofmt of_ith = {
&null_debug_form,
bin_stdmac,
ith_init,
bin_set_info,
nasm_do_legacy_output,
bin_out,
bin_deflabel,
@ -1707,7 +1698,6 @@ const struct ofmt of_srec = {
&null_debug_form,
bin_stdmac,
srec_init,
bin_set_info,
nasm_do_legacy_output,
bin_out,
bin_deflabel,

View File

@ -1158,12 +1158,6 @@ static void coff_win32_filename(char *inname, char *outname)
extern macros_t coff_stdmac[];
static int coff_set_info(enum geninfo type, char **val)
{
(void)type;
(void)val;
return 0;
}
#endif /* defined(OF_COFF) || defined(OF_WIN32) */
#ifdef OF_COFF
@ -1177,7 +1171,6 @@ const struct ofmt of_coff = {
&null_debug_form,
coff_stdmac,
coff_std_init,
coff_set_info,
nasm_do_legacy_output,
coff_out,
coff_deflabel,
@ -1207,7 +1200,6 @@ const struct ofmt of_win32 = {
&df_cv8,
coff_stdmac,
coff_win32_init,
coff_set_info,
nasm_do_legacy_output,
coff_out,
coff_deflabel,
@ -1235,7 +1227,6 @@ const struct ofmt of_win64 = {
&df_cv8,
coff_stdmac,
coff_win64_init,
coff_set_info,
nasm_do_legacy_output,
coff_out,
coff_deflabel,

View File

@ -321,13 +321,6 @@ static void dbg_filename(char *inname, char *outname)
standard_extension(inname, outname, ".dbg");
}
static int dbg_set_info(enum geninfo type, char **val)
{
(void)type;
(void)val;
return 0;
}
static const char * const types[] = {
"unknown", "label", "byte", "word", "dword", "float", "qword", "tbyte"
};
@ -405,7 +398,6 @@ const struct ofmt of_dbg = {
&debug_debug_form,
NULL,
dbg_init,
dbg_set_info,
dbg_out,
dbg_legacy_out,
dbg_deflabel,

View File

@ -2207,13 +2207,6 @@ static void elf_filename(char *inname, char *outname)
extern macros_t elf_stdmac[];
static int elf_set_info(enum geninfo type, char **val)
{
(void)type;
(void)val;
return 0;
}
/* Claim "elf" as a pragma namespace, for the future */
static const struct pragma_facility elf_pragma_list[] =
{
@ -2260,7 +2253,6 @@ const struct ofmt of_elf32 = {
&elf32_df_stabs,
elf_stdmac,
elf_init,
elf_set_info,
nasm_do_legacy_output,
elf32_out,
elf_deflabel,
@ -2311,7 +2303,6 @@ const struct ofmt of_elf64 = {
&elf64_df_stabs,
elf_stdmac,
elf_init,
elf_set_info,
nasm_do_legacy_output,
elf64_out,
elf_deflabel,
@ -2362,7 +2353,6 @@ const struct ofmt of_elfx32 = {
&elfx32_df_stabs,
elf_stdmac,
elf_init,
elf_set_info,
nasm_do_legacy_output,
elfx32_out,
elf_deflabel,

View File

@ -224,14 +224,6 @@ static void ieee_init(void)
checksum = 0;
}
static int ieee_set_info(enum geninfo type, char **val)
{
(void)type;
(void)val;
return 0;
}
/*
* Rundown
*/
@ -1524,7 +1516,6 @@ const struct ofmt of_ieee = {
&ladsoft_debug_form,
NULL,
ieee_init,
ieee_set_info,
nasm_do_legacy_output,
ieee_out,
ieee_deflabel,

View File

@ -40,7 +40,6 @@
uint64_t realsize(enum out_type type, uint64_t size);
/* Do-nothing versions of some output routines */
int null_setinfo(enum geninfo type, char **string);
enum directive_result
null_directive(enum directives directive, char *value, int pass);
void null_sectalign(int32_t seg, unsigned int value);

View File

@ -1756,7 +1756,6 @@ const struct ofmt of_macho32 = {
&null_debug_form,
macho_stdmac,
macho32_init,
null_setinfo,
nasm_do_legacy_output,
macho_output,
macho_symdef,
@ -1805,7 +1804,6 @@ const struct ofmt of_macho64 = {
&null_debug_form,
macho_stdmac,
macho64_init,
null_setinfo,
nasm_do_legacy_output,
macho_output,
macho_symdef,

View File

@ -663,14 +663,6 @@ static void obj_init(void)
current_seg = NULL;
}
static int obj_set_info(enum geninfo type, char **val)
{
(void)type;
(void)val;
return 0;
}
static void obj_cleanup(void)
{
obj_write_file();
@ -2666,7 +2658,6 @@ const struct ofmt of_obj = {
&borland_debug_form,
obj_stdmac,
obj_init,
obj_set_info,
nasm_do_legacy_output,
obj_out,
obj_deflabel,

View File

@ -767,13 +767,6 @@ static void rdf2_filename(char *inname, char *outname)
extern macros_t rdf2_stdmac[];
static int rdf2_set_info(enum geninfo type, char **val)
{
(void)type;
(void)val;
return 0;
}
const struct ofmt of_rdf2 = {
"Relocatable Dynamic Object File Format v2.0",
"rdf",
@ -783,7 +776,6 @@ const struct ofmt of_rdf2 = {
&null_debug_form,
rdf2_stdmac,
rdf2_init,
rdf2_set_info,
nasm_do_legacy_output,
rdf2_out,
rdf2_deflabel,