Commit 0b7d9693 authored by John van Groningen's avatar John van Groningen

ignore -generics command line argument

parent 6ffa3db4
......@@ -9,7 +9,6 @@ from partition import ::Component(..),::ComponentMembers
:: FrontEndOptions
= { feo_up_to_phase :: !FrontEndPhase
, feo_fusion :: !FusionOptions
, feo_generics :: !Bool
}
:: InstanceAndClassInfo
......
......@@ -22,7 +22,7 @@ frontSyntaxTree cached_dcl_macros cached_dcl_mods main_dcl_module_n predef_symbo
defaultFrontEndOptions :: FrontEndOptions
defaultFrontEndOptions
= { feo_up_to_phase = FrontEndPhaseAll, feo_generics = False,
= { feo_up_to_phase = FrontEndPhaseAll,
feo_fusion = { compile_with_fusion = False, generic_fusion = False, strip_unused = False } }
frontEndInterface :: !(Optional (*File,{#Char},{#Char})) !FrontEndOptions !Ident !SearchPaths !{#DclModule} !*{#*{#FunDef}} !(Optional Bool) !*PredefinedSymbols !*HashTable (ModTimeFunction *Files) !*Files !*File !*File !*File !(Optional *File) !*Heaps
......@@ -33,13 +33,13 @@ frontEndInterface opt_file_dir_time options mod_ident search_paths cached_dcl_mo
= (No,{},{},0,predef_symbols, hash_table, files, error, io, out, tcl_file, heaps)
# (Yes (mod_file,mod_dir,mod_time)) = opt_file_dir_time
# (ok,dynamic_type_used,mod,hash_table,error,files)
= wantModule mod_file mod_time cWantIclFile mod_ident NoPos options.feo_generics hash_table error files
= wantModule mod_file mod_time cWantIclFile mod_ident NoPos hash_table error files
| not ok
= (No,{},{},0,predef_symbols, hash_table, files, error, io, out, tcl_file, heaps)
# cached_module_idents = [dcl_mod.dcl_name \\ dcl_mod<-:cached_dcl_modules]
#! support_dynamics = case tcl_file of Yes _ -> True ; No -> False
# (ok, mod, global_fun_range, mod_functions, optional_dcl_mod, modules, dcl_module_n_in_cache,hash_table, error, files)
= scanModule mod cached_module_idents options.feo_generics support_dynamics hash_table error search_paths modtimefunction files
= scanModule mod cached_module_idents support_dynamics hash_table error search_paths modtimefunction files
// # hash_table = {hash_table & hte_entries={}}
# hash_table = remove_icl_symbols_from_hash_table hash_table
......@@ -133,13 +133,9 @@ frontEndInterface opt_file_dir_time options mod_ident search_paths cached_dcl_mo
# (ti_common_defs,dcl_mods) = copy_common_defs_from_dcl_modules dcl_mods
# (saved_main_dcl_common, ti_common_defs) = replace ti_common_defs main_dcl_module_n icl_common
#! (ti_common_defs, groups, fun_defs, td_infos, heaps, hash_table, predef_symbols, dcl_mods, cached_dcl_macros, error_admin)
= case options.feo_generics of
True
-> convertGenerics main_dcl_module_n icl_used_module_numbers ti_common_defs groups fun_defs
td_infos heaps hash_table predef_symbols dcl_mods cached_dcl_macros error_admin
False
-> (ti_common_defs, groups, fun_defs, td_infos, heaps, hash_table, predef_symbols, dcl_mods, cached_dcl_macros, error_admin)
#! (ti_common_defs,groups,fun_defs,td_infos,heaps,hash_table,predef_symbols,dcl_mods,cached_dcl_macros,error_admin)
= convertGenerics main_dcl_module_n icl_used_module_numbers ti_common_defs groups fun_defs
td_infos heaps hash_table predef_symbols dcl_mods cached_dcl_macros error_admin
# (icl_common, ti_common_defs) = replace ti_common_defs main_dcl_module_n saved_main_dcl_common
......
......@@ -10,7 +10,7 @@ import syntax, hashtable, scanner, predef
cWantIclFile :== True
cWantDclFile :== False
wantModule :: !*File !{#Char} !Bool !Ident !Position !Bool !*HashTable !*File !*Files
wantModule :: !*File !{#Char} !Bool !Ident !Position !*HashTable !*File !*Files
-> (!Bool,!Bool,!ParsedModule, !*HashTable, !*File, !*Files)
moduleCouldNotBeImportedError :: !Bool !Ident !Position !*File -> *File
......@@ -36,7 +36,6 @@ Conventions:
}
PS_SkippingMask :== 1
PS_SupportGenericsMask :==2
PS_DynamicTypeUsedMask :== 4
/*
......@@ -279,9 +278,9 @@ isMemberOrWhereOfMemberDefsContext parseContext :== parseContext bitand MemberOr
cWantIclFile :== True
cWantDclFile :== False
wantModule :: !*File !{#Char} !Bool !Ident !Position !Bool !*HashTable !*File !*Files
wantModule :: !*File !{#Char} !Bool !Ident !Position !*HashTable !*File !*Files
-> (!Bool,!Bool,!ParsedModule, !*HashTable, !*File, !*Files)
wantModule file modification_time iclmodule file_id=:{id_name} import_file_position support_generics hash_table error files
wantModule file modification_time iclmodule file_id=:{id_name} import_file_position hash_table error files
# scanState = openScanner file id_name file_name_extension
# hash_table=set_hte_mark (if iclmodule 1 0) hash_table
# (ok,dynamic_type_used,mod,hash_table,file,files) = initModule file_name modification_time scanState hash_table error files
......@@ -298,7 +297,7 @@ where
| succ
# pState = { ps_scanState = scanState
, ps_error = { pea_file = error, pea_ok = True }
, ps_flags = if support_generics PS_SupportGenericsMask 0
, ps_flags = 0
, ps_hash_table = hash_table
}
pState = verify_name mod_name id_name file_name pState
......@@ -1995,8 +1994,6 @@ optionalCoercions pState
wantGenericDefinition :: !ParseContext !Position !ParseState -> (!ParsedDefinition, !ParseState)
wantGenericDefinition parseContext pos pState
| pState.ps_flags bitand PS_SupportGenericsMask==0
= (PD_Erroneous, parseErrorSimple "generic definition" "to enable generics use the command line flag -generics" pState)
# (name, pState) = want_name pState
| name == ""
= (PD_Erroneous, pState)
......@@ -2056,8 +2053,6 @@ wantGenericDefinition parseContext pos pState
wantDeriveDefinition :: !ParseContext !Position !*ParseState -> (!ParsedDefinition, !*ParseState)
wantDeriveDefinition parseContext pos pState
| pState.ps_flags bitand PS_SupportGenericsMask==0
= (PD_Erroneous, parseErrorSimple "generic definition" "to enable generics use the command line flag -generics" pState)
# (token, pState) = nextToken TypeContext pState
= case token of
IdentToken name
......@@ -5354,8 +5349,6 @@ wantBeginGroup msg pState
// AA..
wantKind :: !ParseState -> (!TypeKind, !ParseState)
wantKind pState
| pState.ps_flags bitand PS_SupportGenericsMask==0
= (KindConst, parseErrorSimple "kind" "to enable generics use -generics command line flag" pState)
# (token, pState) = nextToken TypeContext pState
# (kind, pState) = want_simple_kind token pState
# (token, pState) = nextToken TypeContext pState
......
......@@ -4,5 +4,5 @@ import StdEnv
import syntax, parse, predef
scanModule :: !ParsedModule ![Ident] !Bool !Bool !*HashTable !*File !SearchPaths (ModTimeFunction *Files) !*Files
scanModule :: !ParsedModule ![Ident] !Bool !*HashTable !*File !SearchPaths (ModTimeFunction *Files) !*Files
-> (!Bool, !ScannedModule, !IndexRange, ![FunDef], !Optional ScannedModule, ![ScannedModule],!Int,!*HashTable, !*File, !*Files)
......@@ -1011,25 +1011,25 @@ transformArrayDenot array_kind exprs
cast_array_kind OverloadedArray array_expr = array_expr
cast_array_kind array_kind array_expr = PE_TypeSignature array_kind array_expr
scanModules :: [ParsedImport] [ScannedModule] [Ident] SearchPaths Bool Bool (ModTimeFunction *Files) *Files *CollectAdmin -> (Bool, [ScannedModule],*Files, *CollectAdmin)
scanModules [] parsed_modules cached_modules searchPaths support_generics support_dynamics modtimefunction files ca
scanModules :: [ParsedImport] [ScannedModule] [Ident] SearchPaths Bool (ModTimeFunction *Files) *Files *CollectAdmin -> (Bool, [ScannedModule],*Files, *CollectAdmin)
scanModules [] parsed_modules cached_modules searchPaths support_dynamics modtimefunction files ca
= (True, parsed_modules,files, ca)
scanModules [{import_module,import_file_position} : mods] parsed_modules cached_modules searchPaths support_generics support_dynamics modtimefunction files ca
scanModules [{import_module,import_file_position} : mods] parsed_modules cached_modules searchPaths support_dynamics modtimefunction files ca
| in_cache import_module cached_modules
= scanModules mods parsed_modules cached_modules searchPaths support_generics support_dynamics modtimefunction files ca
= scanModules mods parsed_modules cached_modules searchPaths support_dynamics modtimefunction files ca
# (found_module,mod_type) = try_to_find import_module parsed_modules
| found_module
= case mod_type of
MK_NoMainDcl
# ca = postParseError import_file_position ("main module \'"+++import_module.id_name+++"\' does not have a definition module") ca
# (_,parsed_modules,files,ca) = scanModules mods parsed_modules cached_modules searchPaths support_generics support_dynamics modtimefunction files ca
# (_,parsed_modules,files,ca) = scanModules mods parsed_modules cached_modules searchPaths support_dynamics modtimefunction files ca
-> (False,parsed_modules,files,ca)
_
-> scanModules mods parsed_modules cached_modules searchPaths support_generics support_dynamics modtimefunction files ca
-> scanModules mods parsed_modules cached_modules searchPaths support_dynamics modtimefunction files ca
# (succ, parsed_modules,files, ca)
= parseAndScanDclModule import_module import_file_position parsed_modules cached_modules searchPaths support_generics support_dynamics modtimefunction files ca
= parseAndScanDclModule import_module import_file_position parsed_modules cached_modules searchPaths support_dynamics modtimefunction files ca
(mods_succ, parsed_modules,files, ca)
= scanModules mods parsed_modules cached_modules searchPaths support_generics support_dynamics modtimefunction files ca
= scanModules mods parsed_modules cached_modules searchPaths support_dynamics modtimefunction files ca
= (succ && mods_succ, parsed_modules,files, ca)
where
in_cache mod_id []
......@@ -1053,9 +1053,9 @@ MakeEmptyModule name mod_type
def_macros=[],def_members = [], def_funtypes = [], def_instances = [],
def_generics = [], def_generic_cases = []} }
parseAndScanDclModule :: !Ident !Position ![ScannedModule] ![Ident] !SearchPaths !Bool Bool (ModTimeFunction *Files) !*Files !*CollectAdmin
parseAndScanDclModule :: !Ident !Position ![ScannedModule] ![Ident] !SearchPaths !Bool (ModTimeFunction *Files) !*Files !*CollectAdmin
-> *(!Bool, ![ScannedModule],!*Files, !*CollectAdmin)
parseAndScanDclModule dcl_module import_file_position parsed_modules cached_modules searchPaths support_generics support_dynamics modtimefunction files ca
parseAndScanDclModule dcl_module import_file_position parsed_modules cached_modules searchPaths support_dynamics modtimefunction files ca
# {ca_error, ca_hash_table} = ca
# (opt_file_dir_time,files) = fopenInSearchPaths dcl_module.id_name ".dcl" searchPaths FReadData modtimefunction files
| case opt_file_dir_time of No -> True; _ -> False
......@@ -1064,7 +1064,7 @@ parseAndScanDclModule dcl_module import_file_position parsed_modules cached_modu
= (False, [MakeEmptyModule dcl_module MK_None: parsed_modules],files, ca)
# (Yes (mod_file,mod_dir,mod_time)) = opt_file_dir_time
# (parse_ok,dynamic_type_used,mod, ca_hash_table, err_file, files)
= wantModule mod_file mod_time cWantDclFile dcl_module import_file_position support_generics ca_hash_table ca_error.pea_file files
= wantModule mod_file mod_time cWantDclFile dcl_module import_file_position ca_hash_table ca_error.pea_file files
# ca = {ca & ca_hash_table=ca_hash_table, ca_error={pea_file=err_file,pea_ok=True} }
| parse_ok
= scan_dcl_module dcl_module mod parsed_modules searchPaths modtimefunction files ca
......@@ -1083,12 +1083,12 @@ where
ca = {ca & ca_rev_fun_defs=[]}
mod = { mod & mod_imports = imports, mod_imported_objects = imported_objects, mod_defs = { defs & def_macros=def_macros,def_macro_indices = range }}
(import_ok, parsed_modules,files, ca)
= scanModules imports [mod : parsed_modules] cached_modules searchPaths support_generics support_dynamics modtimefunction files ca
= scanModules imports [mod : parsed_modules] cached_modules searchPaths support_dynamics modtimefunction files ca
= (pea_ok && import_ok, parsed_modules,files, ca)
scanModule :: !ParsedModule ![Ident] !Bool !Bool !*HashTable !*File !SearchPaths (ModTimeFunction *Files) !*Files
scanModule :: !ParsedModule ![Ident] !Bool !*HashTable !*File !SearchPaths (ModTimeFunction *Files) !*Files
-> (!Bool, !ScannedModule, !IndexRange, ![FunDef], !Optional ScannedModule, ![ScannedModule],!Int,!*HashTable, !*File, !*Files)
scanModule mod=:{mod_ident,mod_type,mod_defs = pdefs} cached_modules support_generics support_dynamics hash_table err_file searchPaths /*predefs*/ modtimefunction files
scanModule mod=:{mod_ident,mod_type,mod_defs = pdefs} cached_modules support_dynamics hash_table err_file searchPaths /*predefs*/ modtimefunction files
# predefIdents = predefined_idents
# ca = { ca_error = {pea_file = err_file, pea_ok = True}
, ca_fun_count = 0
......@@ -1102,7 +1102,7 @@ scanModule mod=:{mod_ident,mod_type,mod_defs = pdefs} cached_modules support_gen
(import_dcl_ok, optional_parsed_dcl_mod,dcl_module_n,parsed_modules, cached_modules,files, ca)
= scan_main_dcl_module mod_ident mod_type modtimefunction files ca
(import_dcls_ok, parsed_modules, files, ca)
= scanModules imports parsed_modules cached_modules searchPaths support_generics support_dynamics modtimefunction files ca
= scanModules imports parsed_modules cached_modules searchPaths support_dynamics modtimefunction files ca
(pea_dcl_ok,optional_dcl_mod,ca) = collect_main_dcl_module optional_parsed_dcl_mod dcl_module_n ca
......@@ -1161,7 +1161,7 @@ where
= (False, No,NoIndex, [],cached_modules, files, ca)
# (Yes (mod_file,mod_dir,mod_time)) = opt_file_dir_time
# (parse_ok,dynamic_type_used,mod, hash_table, err_file, files)
= wantModule mod_file mod_time cWantDclFile mod_ident NoPos support_generics ca_hash_table ca_error.pea_file files
= wantModule mod_file mod_time cWantDclFile mod_ident NoPos ca_hash_table ca_error.pea_file files
# ca = {ca & ca_hash_table=hash_table, ca_error={pea_file=err_file,pea_ok=True}}
| not parse_ok
= (False, No,NoIndex, [],cached_modules, files, ca)
......@@ -1169,7 +1169,7 @@ where
# (_, defs, imports, imported_objects,foreign_exports,ca) = reorganiseDefinitionsAndAddTypes mod_ident support_dynamics False pdefs ca
# mod = { mod & mod_imports = imports, mod_imported_objects = imported_objects, mod_defs = defs}
# cached_modules = [mod.mod_ident:cached_modules]
# (import_ok, parsed_modules,files, ca) = scanModules imports [] cached_modules searchPaths support_generics support_dynamics modtimefunction files ca
# (import_ok, parsed_modules,files, ca) = scanModules imports [] cached_modules searchPaths support_dynamics modtimefunction files ca
= (import_ok, Yes mod, NoIndex,parsed_modules, cached_modules,files, ca)
collect_main_dcl_module (Yes mod=:{mod_defs=defs}) dcl_module_n ca
......
......@@ -118,7 +118,6 @@ abc_file_name_in_clean_system_files_folder mod_dir mod_name error files
, fusion_options :: !FusionOptions
, compile_for_dynamics :: !Bool
, dump_core :: !Bool
, compile_with_generics :: !Bool
}
StdErrPathName :== "_stderr_"
......@@ -137,7 +136,6 @@ InitialCoclOptions =
, fusion_options = {compile_with_fusion = False, generic_fusion = False, strip_unused = False}
, compile_for_dynamics = False
, dump_core = False
, compile_with_generics = True
}
:: DclCache = {
......@@ -205,7 +203,7 @@ parseCommandLine [arg1=:"-strip":args] options
= parseCommandLine args {options & fusion_options.strip_unused = True}
parseCommandLine ["-generics":args] options
// enable generics
= parseCommandLine args {options & compile_with_generics = True}
= parseCommandLine args options
parseCommandLine ["-lattr":args] options
= parseCommandLine args {options & listTypes.lto_showAttributes = False}
parseCommandLine ["-lt":args] options
......@@ -309,7 +307,6 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede
# (optionalSyntaxTree,cached_functions_and_macros,cached_dcl_mods,main_dcl_module_n,predef_symbols, hash_table, files, error, io, out,tcl_file,heaps)
= frontEndInterface opt_file_dir_time
{feo_up_to_phase=FrontEndPhaseAll
,feo_generics=options.compile_with_generics
,feo_fusion=options.fusion_options
} moduleIdent options.searchPaths dcl_modules functions_and_macros list_inferred_types predef_symbols hash_table fmodificationtime files error io out tcl_file heaps
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment