This repository was archived by the owner on May 18, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -343,7 +343,9 @@ uniontype Call
343343 typed_args := matchedFunc. args;
344344
345345 args := {};
346- var := Variability . CONSTANT ;
346+ var := if Function . isImpure(func ) or Function . isOMImpure(func ) // if is impure, make it highest variability
347+ then Variability . CONTINUOUS
348+ else Variability . CONSTANT ;
347349 for a in typed_args loop
348350 (arg_exp, _, arg_var) := a;
349351 args := arg_exp :: args;
Original file line number Diff line number Diff line change @@ -174,9 +174,7 @@ algorithm
174174
175175 case Expression . CALL ()
176176 then
177- if Call . isImpure(exp. call) // do NOT evaluate impure calls!
178- then exp
179- else evalCall(exp. call, target);
177+ evalCall(exp. call, target);
180178
181179 case Expression . SIZE (dimIndex = SOME (exp1))
182180 algorithm
Original file line number Diff line number Diff line change @@ -1288,6 +1288,11 @@ uniontype Function
12881288 output Boolean isImpure = fn. attributes. isImpure;
12891289 end isImpure;
12901290
1291+ function isOMImpure
1292+ input Function fn;
1293+ output Boolean isImpure = not fn. attributes. isOpenModelicaPure;
1294+ end isOMImpure;
1295+
12911296 function isFunctionPointer
12921297 input Function fn;
12931298 output Boolean isPointer = fn. attributes. isFunctionPointer;
You can’t perform that action at this time.
0 commit comments