Commit d7a0ac39 authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl
Browse files

remove tests for BEArraySelectFun or BEArrayUpdateFun in function BESpecialArrayFunctionSymbol

parent feb4a221
......@@ -553,10 +553,8 @@ void BEBindSpecialType (int special_type_n,int type_index,int module_index)
BESymbolP
BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, int moduleIndex)
{
Bool isSpecialArrayFunction;
BEModuleP module;
SymbolP functionSymbol;
SymbDefP sdef;
SymbolP functionSymbol,previousFunctionSymbol;
SymbDefP originalsdef;
TypeAlt *typeAlt;
TypeNode elementType, arrayType;
......@@ -572,61 +570,44 @@ BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, in
originalsdef = functionSymbol->symb_def;
typeAlt = originalsdef->sdef_rule_type->rule_type_rule;
isSpecialArrayFunction = False;
switch (arrayFunKind)
{
case BEArraySelectFun:
Assert (originalsdef->sdef_arfun == BEArraySelectFun || originalsdef->sdef_arfun == BEUnqArraySelectFun);
break;
case BE_UnqArraySelectFun:
case BE_UnqArraySelectLastFun:
Assert (typeAlt->type_alt_lhs->type_node_arity == 2);
elementType = typeAlt->type_alt_rhs;
arrayType = typeAlt->type_alt_lhs->type_node_arguments->type_arg_node;
isSpecialArrayFunction = True;
Assert (originalsdef->sdef_arfun == BEArraySelectFun);
break;
case BE_ArrayUpdateFun:
isSpecialArrayFunction = True;
elementType = typeAlt->type_alt_lhs->type_node_arguments->type_arg_next->type_arg_next->type_arg_node;
arrayType = typeAlt->type_alt_lhs->type_node_arguments->type_arg_node;
/* fall through! */
case BEArrayUpdateFun:
Assert (originalsdef->sdef_arfun == BEArrayUpdateFun);
break;
default:
Assert (False);
break;
return (functionSymbol);
}
if (isSpecialArrayFunction)
{
SymbolP previousFunctionSymbol;
Bool allreadyCreated;
previousFunctionSymbol = functionSymbol;
functionSymbol = functionSymbol->symb_next;
allreadyCreated = False;
if (functionSymbol != NULL && functionSymbol->symb_kind == definition)
{
sdef = functionSymbol->symb_def;
allreadyCreated = sdef->sdef_arfun == (ArrayFunKind) arrayFunKind;
if (!allreadyCreated && arrayFunKind == BE_UnqArraySelectLastFun && sdef->sdef_arfun == BE_UnqArraySelectFun)
{
if (functionSymbol != NULL && functionSymbol->symb_kind == definition){
if (functionSymbol->symb_def->sdef_arfun == (ArrayFunKind) arrayFunKind)
return functionSymbol;
if (arrayFunKind == BE_UnqArraySelectLastFun && functionSymbol->symb_def->sdef_arfun == BE_UnqArraySelectFun){
previousFunctionSymbol = functionSymbol;
functionSymbol = functionSymbol->symb_next;
if (functionSymbol != NULL && functionSymbol->symb_kind == definition)
if (functionSymbol != NULL && functionSymbol->symb_kind == definition &&
functionSymbol->symb_def->sdef_arfun == (ArrayFunKind) arrayFunKind)
{
sdef = functionSymbol->symb_def;
allreadyCreated = sdef->sdef_arfun == (ArrayFunKind) arrayFunKind;
return functionSymbol;
}
}
}
if (!allreadyCreated)
{
char *functionName, *functionPrefix;
TypeAlt *newTypeAlt;
......@@ -738,8 +719,6 @@ BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, in
functionSymbol = newFunctionSymbol;
}
}
return (functionSymbol);
} /* BESpecialArrayFunctionSymbol */
......
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