Skip to content

Commit

Permalink
- M.E.D.E.Adder4 now compiles
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10441 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 11, 2011
1 parent ef52124 commit 2acad39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Compiler/BackEnd/SimCode.mo
Expand Up @@ -2239,8 +2239,7 @@ algorithm
simSettingsOpt,
filenamePrefix,
crefToSimVarHT);
// (simCode,(_,_,lits)) = traverseExpsSimCode(simCode,findLiteralsHelper,literals);
(_,_,lits) = literals;
(simCode,(_,_,lits)) = traverseExpsSimCode(simCode,findLiteralsHelper,literals);
simCode = setSimCodeLiterals(simCode,listReverse(lits));
Debug.fcall("execFiles",print, "*** SimCode -> collect all files started: " +& realString(clock()) +& "\n" );
// adrpo: collect all the files from Absyn.Info and DAE.ElementSource
Expand Down
9 changes: 6 additions & 3 deletions Compiler/susan_codegen/SimCode/SimCodeC.tpl
Expand Up @@ -5232,17 +5232,20 @@ template daeExpCall(Exp call, Context context, Text &preExp /*BUFP*/,

case CALL(attr=CALL_ATTR(ty=ty),
path=IDENT(name="DIVISION_ARRAY_SCALAR"),
expLst={e1, e2, DAE.SCONST(string=string)}) then
expLst={e1, e2, e3 as SHARED_LITERAL(__)}) then
let type = match ty case ET_ARRAY(ty=ET_INT(__)) then "integer_array"
case ET_ARRAY(ty=ET_ENUMERATION(__)) then "integer_array"
else "real_array"
let var = tempDecl(type, &varDecls)
let var1 = daeExp(e1, context, &preExp, &varDecls)
let var2 = daeExp(e2, context, &preExp, &varDecls)
let var3 = Util.escapeModelicaStringToCString(string)
let &preExp += 'division_alloc_<%type%>_scalar(&<%var1%>, <%var2%>, &<%var%>,"<%var3%>");<%\n%>'
let var3 = daeExp(e3, context, &preExp, &varDecls)
let &preExp += 'division_alloc_<%type%>_scalar(&<%var1%>, <%var2%>, &<%var%>, <%var3%>);<%\n%>'
'<%var%>'

case exp as CALL(path=IDENT(name="DIVISION_ARRAY_SCALAR")) then
error(sourceInfo(), 'Code generation does not support <%printExpStr(exp)%>')

case CALL(path=IDENT(name="der"), expLst={arg as CREF(__)}) then
'$P$DER<%cref(arg.componentRef)%>'
case CALL(path=IDENT(name="der"), expLst={exp}) then
Expand Down

0 comments on commit 2acad39

Please sign in to comment.