Commit 2b5770a7 authored by John van Groningen's avatar John van Groningen

refactor, change type of field ins_member_types_and_functions, use...

refactor, change type of field ins_member_types_and_functions, use DclInstanceMemberTypeAndFunctions instead of [DclInstanceMemberTypeAndFunction]
parent 3ea14d5b
This diff is collapsed.
......@@ -2,7 +2,7 @@ definition module check_instances
from syntax import
::Global,::Index,
::CommonDefs,::CommonDefsR,::DclInstanceMemberTypeAndFunction,
::CommonDefs,::CommonDefsR,::DclInstanceMemberTypeAndFunctions,
::TypeVarHeap,::Heap,::TypeVarInfo
from overloading import ::ClassInstanceInfo,::InstanceTree(..)
from checksupport import ::ErrorAdmin
......
......@@ -259,17 +259,17 @@ where
= member_types_equal dcl_instance_def.ins_member_types_and_functions icl_instance_def.ins_members 0 icl_functions comp_st
= (icl_instance_defs,icl_functions,comp_st)
member_types_equal :: [DclInstanceMemberTypeAndFunction] {#ClassInstanceMember} Int *{#FunDef} *CompareState -> (!*{#FunDef},!*CompareState)
member_types_equal [] icl_instance_members icl_member_n icl_functions comp_st
member_types_equal :: DclInstanceMemberTypeAndFunctions {#ClassInstanceMember} Int *{#FunDef} *CompareState -> (!*{#FunDef},!*CompareState)
member_types_equal NoDclInstanceMemberTypes icl_instance_members icl_member_n icl_functions comp_st
| icl_member_n<size icl_instance_members
# function_index = icl_instance_members.[icl_member_n].cim_index
| icl_functions.[function_index].fun_info.fi_properties bitand FI_MemberInstanceRequiresTypeInDefMod<>0
# ({fun_ident,fun_pos},icl_functions) = icl_functions![function_index]
# comp_st = instance_def_conflicts_error fun_ident fun_pos comp_st
= member_types_equal [] icl_instance_members (icl_member_n+1) icl_functions comp_st
= member_types_equal [] icl_instance_members (icl_member_n+1) icl_functions comp_st
= member_types_equal NoDclInstanceMemberTypes icl_instance_members (icl_member_n+1) icl_functions comp_st
= member_types_equal NoDclInstanceMemberTypes icl_instance_members (icl_member_n+1) icl_functions comp_st
= (icl_functions,comp_st)
member_types_equal [{dim_type=instance_member_type}:instance_member_types] icl_instance_members icl_member_n icl_functions comp_st
member_types_equal (DclInstanceMemberTypes instance_member_type instance_member_types) icl_instance_members icl_member_n icl_functions comp_st
= member_type_and_types_equal instance_member_type instance_member_types icl_instance_members icl_member_n icl_functions comp_st
where
member_type_and_types_equal instance_member_type=:{ft_ident,ft_type,ft_pos} instance_member_types icl_instance_members icl_member_n icl_functions comp_st
......
......@@ -2575,7 +2575,7 @@ where
, ins_class_ident = {ci_ident=Ident class_ident, ci_arity=1}
, ins_ident = class_ident
, ins_type = ins_type
, ins_member_types_and_functions = []
, ins_member_types_and_functions = NoDclInstanceMemberTypes
, ins_members = {{cim_ident=ds_ident,cim_arity=ds_arity,cim_index=ds_index}}
, ins_specials = SP_None
, ins_pos = gc_pos
......@@ -2712,7 +2712,7 @@ where
, ins_class_ident = {ci_ident=Ident class_ident, ci_arity=1}
, ins_ident = class_ident
, ins_type = ins_type
, ins_member_types_and_functions = []
, ins_member_types_and_functions = NoDclInstanceMemberTypes
, ins_members = {class_instance_member}
, ins_specials = SP_None
, ins_pos = gc_pos
......
......@@ -203,7 +203,7 @@ instance == FunctionOrMacroIndex
, def_generic_cases :: ![GenericCaseDef]
}
:: CommonDefs :== CommonDefsR DclInstanceMemberTypeAndFunction
:: CommonDefs :== CommonDefsR DclInstanceMemberTypeAndFunctions
:: CommonDefsR member_types_and_functions =
{ com_type_defs :: !.{# CheckedTypeDef}
......@@ -321,9 +321,9 @@ cNameLocationDependent :== True
, sim_member_types :: ![FunType] // for .dcl
}
:: DclInstanceMemberTypeAndFunction = {
dim_type :: !FunType
}
:: DclInstanceMemberTypeAndFunctions
= DclInstanceMemberTypes !FunType !DclInstanceMemberTypeAndFunctions
| NoDclInstanceMemberTypes
:: IdentOrQualifiedIdent
= Ident !Ident
......@@ -511,14 +511,14 @@ instance == GenericDependency
, it_context :: ![TypeContext]
}
:: ClassInstance :== ClassInstanceR DclInstanceMemberTypeAndFunction
:: ClassInstance :== ClassInstanceR DclInstanceMemberTypeAndFunctions
:: ClassInstanceR member_types_and_functions =
{ ins_class_index :: !GlobalIndex
, ins_class_ident :: !ClassIdent
, ins_ident :: !Ident
, ins_type :: !InstanceType
, ins_member_types_and_functions :: ![member_types_and_functions]
, ins_member_types_and_functions :: !member_types_and_functions
, ins_members :: !{#ClassInstanceMember}
, ins_specials :: !Specials
, ins_pos :: !Position
......
implementation module trans
import StdEnv, StdStrictLists
import StdEnv
import syntax, transform, checksupport, compare_types, utilities, expand_types, unitype, type
import classify, partition
......@@ -4384,7 +4384,7 @@ mark_fused_members_of_specialized_instances {dcl_module_kind=MK_None} main_dcl_m
mark_fused_members_of_specialized_instances {dcl_common={com_instance_defs},dcl_sizes} main_dcl_module_n instances common_defs fun_heap fun_defs
= mark_fused_members_of_instances dcl_sizes.[cInstanceDefs] com_instance_defs instances common_defs fun_heap fun_defs
where
mark_fused_members_of_instances :: !Int !{#ClassInstanceR .DclInstanceMemberTypeAndFunction} !{!InstanceInfo} !{#CommonDefs} !FunctionHeap !*{#FunDef} -> *{#FunDef}
mark_fused_members_of_instances :: !Int !{#ClassInstance} !{!InstanceInfo} !{#CommonDefs} !FunctionHeap !*{#FunDef} -> *{#FunDef}
mark_fused_members_of_instances instance_i instance_defs instances common_defs fun_heap fun_defs
| instance_i<size instance_defs
# instance_def=:{ins_specials} = instance_defs.[instance_i]
......
......@@ -4,7 +4,7 @@ from general import ::Optional
from syntax import
::Ident, ::FunDef, ::IndexRange, ::TypeHeaps,
::SymbolTable, ::SymbolTableEntry, ::Heap,
::CommonDefsR,::DclInstanceMemberTypeAndFunction,
::CommonDefsR,::DclInstanceMemberTypeAndFunctions,
::DclModule, ::CommonDefs, ::CheckedTypeDef, ::TypeDef, ::TypeRhs, ::ClassDef, ::VarHeap, ::VarInfo
from predef import
::PredefinedSymbols, ::PredefinedSymbol
......
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