Skip to content

Commit

Permalink
kernel: remove unused kernel func COMPILE_FUNC
Browse files Browse the repository at this point in the history
It is undocumented and nothing calls it. There used to be a file
`lib/compiler.g` that wrapped it, but that code also was
undocumented and not used by anything, so we removed it in 2018.
  • Loading branch information
fingolfin committed Jan 2, 2025
1 parent d746ad8 commit a3ca9fc
Showing 1 changed file with 0 additions and 83 deletions.
83 changes: 0 additions & 83 deletions src/compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -5344,88 +5344,11 @@ Int CompileFunc(Obj filename, Obj func, Obj name, Int crc, Obj magic2)
}


/****************************************************************************
**
*F FuncCOMPILE_FUNC( <self>, <output>, <func>, <name>, <crc>, <magic2> )
*/
static Obj FuncCOMPILE_FUNC(Obj self, Obj arg)
{
Obj output;
Obj func;
Obj name;
Obj crc;
Obj magic2;
Int nr;
Int len;

// unravel the arguments
len = LEN_LIST(arg);
if ( len < 5 ) {
ErrorQuit( "usage: COMPILE_FUNC( <output>, <func>, <name>, "
"<crc>, <magic2>, ... )", 0, 0 );
}
output = ELM_LIST( arg, 1 );
func = ELM_LIST( arg, 2 );
name = ELM_LIST( arg, 3 );
crc = ELM_LIST( arg, 4 );
magic2 = ELM_LIST( arg, 5 );

RequireStringRep(SELF_NAME, output);
RequireFunction(SELF_NAME, func);
RequireStringRep(SELF_NAME, name);
RequireSmallInt(SELF_NAME, crc);
RequireStringRep(SELF_NAME, magic2);

// possible optimiser flags
CompFastIntArith = 1;
CompFastPlainLists = 1;
CompFastListFuncs = 1;
CompCheckTypes = 1;
CompCheckListElements = 1;

if ( 6 <= len ) {
CompFastIntArith = EQ( ELM_LIST( arg, 6 ), True );
}
if ( 7 <= len ) {
CompFastPlainLists = EQ( ELM_LIST( arg, 7 ), True );
}
if ( 8 <= len ) {
CompFastListFuncs = EQ( ELM_LIST( arg, 8 ), True );
}
if ( 9 <= len ) {
CompCheckTypes = EQ( ELM_LIST( arg, 9 ), True );
}
if ( 10 <= len ) {
CompCheckListElements = EQ( ELM_LIST( arg, 10 ), True );
}

// compile the function
nr = CompileFunc(
output, func, name,
INT_INTOBJ(crc), magic2 );


return INTOBJ_INT(nr);
}


/****************************************************************************
**
*F * * * * * * * * * * * * * initialize module * * * * * * * * * * * * * * *
*/

/****************************************************************************
**
*V GVarFuncs . . . . . . . . . . . . . . . . . . list of functions to export
*/
static StructGVarFunc GVarFuncs[] = {

GVAR_FUNC_XARGS(COMPILE_FUNC, -1, "arg"),
{ 0, 0, 0, 0, 0 }

};


/****************************************************************************
**
*F InitKernel( <module> ) . . . . . . . . initialise kernel data structures
Expand All @@ -5442,9 +5365,6 @@ static Int InitKernel (
CompCheckListElements = 1;
CompPass = 0;

// init filters and functions
InitHdlrFuncsFromTable( GVarFuncs );

// announce the global variables
InitGlobalBag( &CompInfoGVar, "src/compiler.c:CompInfoGVar" );
InitGlobalBag( &CompInfoRNam, "src/compiler.c:CompInfoRNam" );
Expand Down Expand Up @@ -5639,9 +5559,6 @@ static Int PostRestore (
static Int InitLibrary (
StructInitInfo * module )
{
// init filters and functions
InitGVarFuncsFromTable( GVarFuncs );

return PostRestore( module );
}

Expand Down

0 comments on commit a3ca9fc

Please sign in to comment.