This commit is contained in:
Бондарев Иван 2019-10-13 13:43:59 +02:00
parent 76d6021c20
commit 599d8387ed
3 changed files with 1405 additions and 1095 deletions

View file

@ -868,11 +868,91 @@ namespace PascalABCCompiler.PCU
}
//\ssyy
private void AddIndirectInteraceUsedUnits()
{
if (cun.namespaces.Count == 0)
return;
Dictionary<common_namespace_node, bool> interf_ns_dict = new Dictionary<common_namespace_node, bool>();
common_unit_node unt = null;
for (int j = 0; j < unit.InterfaceUsedUnits.Count; j++)
{
unt = unit.InterfaceUsedUnits[j] as common_unit_node;
if (unt == null) continue;
foreach (common_namespace_node ns in unt.namespaces)
{
interf_ns_dict[ns] = true;
}
}
common_namespace_node cnn = cun.namespaces[0];
foreach (common_type_node ctn in cnn.types)
{
foreach (common_method_node cmn in ctn.methods)
{
if (cmn.is_constructor && cmn.function_code != null && cmn.function_code.location == null)
{
foreach (common_parameter cp in cmn.parameters)
{
if (cp.type is common_type_node)
{
common_namespace_node comp_cnn = (cp.type as common_type_node).comprehensive_namespace;
if (comp_cnn != null && !interf_ns_dict.ContainsKey(comp_cnn))
{
unit.InterfaceUsedUnits.AddElement(comp_cnn.cont_unit);
interf_ns_dict[comp_cnn] = true;
}
}
}
}
}
}
}
private void AddIndirectImplementationUsedUnits()
{
if (cun.namespaces.Count < 2)
return;
common_unit_node unt = null;
Dictionary<common_namespace_node, bool> impl_ns_dict = new Dictionary<common_namespace_node, bool>();
for (int j = 0; j < unit.ImplementationUsedUnits.Count; j++)
{
unt = unit.ImplementationUsedUnits[j] as common_unit_node;
if (unt == null) continue;
foreach (common_namespace_node ns in unt.namespaces)
{
impl_ns_dict[ns] = true;
}
}
common_namespace_node cnn = cun.namespaces[1];
foreach (common_type_node ctn in cnn.types)
{
foreach (common_method_node cmn in ctn.methods)
{
if (cmn.is_constructor && cmn.function_code != null && cmn.function_code.location == null)
{
foreach (common_parameter cp in cmn.parameters)
{
if (cp.type is common_type_node)
{
common_namespace_node comp_cnn = (cp.type as common_type_node).comprehensive_namespace;
if (comp_cnn != null && !impl_ns_dict.ContainsKey(comp_cnn))
{
unit.ImplementationUsedUnits.AddElement(comp_cnn.cont_unit);
impl_ns_dict[comp_cnn] = true;
}
}
}
}
}
}
}
//заполнение списка подключаемых модулей
private void GetUsedUnits()
{
int num = 0;
common_unit_node unt = null;
AddIndirectInteraceUsedUnits();
AddIndirectImplementationUsedUnits();
for (int j = 0; j < unit.InterfaceUsedUnits.Count; j++)
{
unt = unit.InterfaceUsedUnits[j] as common_unit_node;
@ -887,6 +967,7 @@ namespace PascalABCCompiler.PCU
if (unt.namespaces.Count != 0)
num += 1;//unt.namespaces.Count;
}
pcu_file.incl_modules = new string[num];
int i = 0; num = 0;
for (i=0; i<unit.InterfaceUsedUnits.Count; i++)
@ -927,6 +1008,8 @@ namespace PascalABCCompiler.PCU
}*/
}
}
pcu_file.used_namespaces = cun.used_namespaces.ToArray();
}

View file

@ -2093,7 +2093,7 @@ type
static function GetEventInfo(&event: cl_event; param_name: EventInfoType; param_value_size: UIntPtr; param_value: pointer; param_value_size_ret: ^UIntPtr): ErrorCode;
external 'opencl.dll' name 'clGetEventInfo';
static function SetEventCallback(&event: cl_event; command_exec_callback_type: ErrorCode; pfn_notify: Event_Callback; user_data: pointer): ErrorCode;
static function SetEventCallback(&event: cl_event; command_exec_callback_type: CommandExecutionStatus; pfn_notify: Event_Callback; user_data: pointer): ErrorCode;
external 'opencl.dll' name 'clSetEventCallback';
static function RetainEvent(&event: cl_event): ErrorCode;

File diff suppressed because it is too large Load diff