Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Remove unused templates
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel authored and OpenModelica-Hudson committed Mar 29, 2017
1 parent 4ba7588 commit b78943f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 53 deletions.
16 changes: 0 additions & 16 deletions Compiler/Template/CodegenCFunctions.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6385,22 +6385,6 @@ template daeExpCallPre(Exp exp, Context context, Text &preExp, Text &varDecls, T
error(sourceInfo(), 'Code generation does not support pre(<%ExpressionDumpTpl.dumpExp(exp,"\"")%>)')
end daeExpCallPre;
template daeExpCallStart(Exp exp, Context context, Text &preExp,
Text &varDecls, Text &auxFunction)
"Generates code for an asub of a cref, which becomes cref + offset."
::=
match exp
case cr as CREF(__) then
'<%crefAttributes(cr.componentRef)%>.start'
case ASUB(exp = cr as CREF(__), sub = {sub_exp}) then
let offset = daeExp(sub_exp, context, &preExp, &varDecls, &auxFunction)
let cref = cref(cr.componentRef)
'*(&<%crefAttributes(cr.componentRef)%>.start + <%offset%>)'
else
error(sourceInfo(), 'Code generation does not support start(<%ExpressionDumpTpl.dumpExp(exp,"\"")%>)')
end daeExpCallStart;
template daeExpSize(Exp exp, Context context, Text &preExp,
Text &varDecls, Text &auxFunction)
"Generates code for a size expression."
Expand Down
17 changes: 0 additions & 17 deletions Compiler/Template/CodegenCSharp.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1588,23 +1588,6 @@ template old2Cref(ComponentRef cr, SimCode simCode) ::=
end old2Cref;
***/

//this one should be used only in InitialResidual( ..., double[][] startValues)
template startCref(ComponentRef cr, SimCode simCode) ::=
//'/*start(<%crefStr(cr, simCode)%>)*/start<%representationCref(cr, simCode)%>'

match cref2simvar(cr, simCode)
case sv as SIMVAR(__) then
let fviIndex =
match varKind
case STATE(__) then "State"
case STATE_DER(__) then "StateDer"
case VARIABLE(__) then "Algebraic"
case PARAM(__) then "Parameter"
else /*error(sourceInfo(),*/ "UNEXPECTED_variable_varKind_in_startCref_template" //)
'startValues[(int)SimVarType.<%fviIndex%>][<%sv.index%>]'
end startCref;


//TODO: a HACK ? ... used in mixed system only
template crefToReal(ComponentRef cr, SimCode simCode) ::=
<</*(double)<% crefStr(cr, simCode)
Expand Down
20 changes: 0 additions & 20 deletions Compiler/Template/CodegenCppCommon.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2157,26 +2157,6 @@ template daeExpCall(Exp call, Context context, Text &preExp /*BUFP*/, Text &varD
error(sourceInfo(), 'Code generation does not support daeExpCall(<%ExpressionDumpTpl.dumpExp(call,"\"")%>)')
end daeExpCall;

template daeExpCallStart(Exp exp, Context context, Text &preExp /*BUFP*/,
Text &varDecls /*BUFP*/,SimCode simCode, Text& extraFuncs,Text& extraFuncsDecl,Text extraFuncsNamespace, Text stateDerVectorName /*=__zDot*/, Boolean useFlatArrayNotation)
"Generates code for an asub of a cref, which becomes cref + offset."
::=
let &varDeclsCref = buffer "" /*BUFD*/
match exp
case cr as CREF(__) then
match context
case ALGLOOP_CONTEXT(genInitialisation=false) then
'_system->get<%crefStartValueType(cr.componentRef)%>StartValue(<%cref1(cr.componentRef, simCode , extraFuncs, extraFuncsDecl, extraFuncsNamespace, context, &varDecls, stateDerVectorName , useFlatArrayNotation)%>)'
else
'SystemDefaultImplementation::get<%crefStartValueType(cr.componentRef)%>StartValue(<%cref1(cr.componentRef, simCode , extraFuncs, extraFuncsDecl, extraFuncsNamespace, context, &varDecls, stateDerVectorName , useFlatArrayNotation)%>)'
case ASUB(exp = cr as CREF(__), sub = {sub_exp}) then
let offset = daeExp(sub_exp, context, &preExp /*BUFC*/, &varDecls /*BUFD*/,simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
let cref = cref1(cr.componentRef,simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace,context,varDeclsCref,stateDerVectorName,useFlatArrayNotation)
'*(&$P$ATTRIBUTE<%cref(cr.componentRef, useFlatArrayNotation)%>.start + <%offset%>)'
else
error(sourceInfo(), 'Code generation does not support start(<%ExpressionDumpTpl.dumpExp(exp,"\"")%>)')
end daeExpCallStart;

template daeExpLunary(Exp exp, Context context, Text &preExp, Text &varDecls, SimCode simCode, Text& extraFuncs, Text& extraFuncsDecl,
Text extraFuncsNamespace, Text stateDerVectorName /*=__zDot*/, Boolean useFlatArrayNotation)
"Generates code for a logical unary expression."
Expand Down

0 comments on commit b78943f

Please sign in to comment.