include optimise flag.

This commit is contained in:
Vítor Santos Costa 2011-04-04 16:23:46 +01:00
parent 8f713b01c7
commit e49e59c705
3 changed files with 16 additions and 1 deletions

View File

@ -76,6 +76,11 @@ typedef struct {
atom_t *for_code[256]; /* code --> one-char-atom */
} atoms;
struct
{
int optimise; /* -O: optimised compilation */
} cmdline;
struct
{ ExtensionCell _ext_head; /* head of registered extensions */
ExtensionCell _ext_tail; /* tail of this chain */
@ -167,6 +172,7 @@ typedef struct PL_local_data {
occurs_check_t occurs_check; /* Unify and occurs check */
} feature;
source_location read_source; /* file, line, char of last term */
struct

View File

@ -994,7 +994,6 @@ initPrologFlags(void)
#if defined(HAVE_GETPID) || defined(EMULATE_GETPID)
setPrologFlag("pid", FT_INTEGER|FF_READONLY, getpid());
#endif
setPrologFlag("optimise", FT_BOOL, GD->cmdline.optimise, PLFLAG_OPTIMISE);
setPrologFlag("generate_debug_info", FT_BOOL,
truePrologFlag(PLFLAG_DEBUGINFO), PLFLAG_DEBUGINFO);
setPrologFlag("last_call_optimisation", FT_BOOL, TRUE, PLFLAG_LASTCALL);
@ -1100,6 +1099,8 @@ initPrologFlags(void)
}
#endif
#endif /* YAP_PROLOG */
/* Flags copied by YAP */
setPrologFlag("optimise", FT_BOOL, GD->cmdline.optimise, PLFLAG_OPTIMISE);
/* FLAGS used by PLStream */
setPrologFlag("tty_control", FT_BOOL|FF_READONLY,
truePrologFlag(PLFLAG_TTY_CONTROL), PLFLAG_TTY_CONTROL);

View File

@ -67,6 +67,13 @@ yap_flag(fileerrors,X) :-
yap_flag(fileerrors,X) :-
'$swi_set_prolog_flag'(fileerrors, X).
% -O optimisation
yap_flag(optimise,X) :-
var(X), !,
'$swi_current_prolog_flag'(optimise, X).
yap_flag(optimise,X) :-
'$swi_set_prolog_flag'(optimise, X).
% control garbage collection
yap_flag(gc,V) :-
var(V), !,
@ -834,6 +841,7 @@ yap_flag(dialect,yap).
'$yap_system_flag'(n_of_integer_keys_in_db).
'$yap_system_flag'(open_expands_filename).
'$yap_system_flag'(open_shared_object).
'$yap_system_flag'(optimise).
'$yap_system_flag'(profiling).
'$yap_system_flag'(prompt_alternatives_on).
'$yap_system_flag'(readline).