Changeset 8066773 in OpenModelica
- Timestamp:
- 2020-06-17T21:21:23+02:00 (4 years ago)
- Branches:
- maintenance/v1.16
- Children:
- 302444f
- Parents:
- ed49d5f
- git-author:
- Per Östlund <perost86@…> (06/02/20 12:59:40)
- git-committer:
- Adrian Pop <adrian.pop@…> (06/17/20 21:21:23)
- Location:
- OMCompiler/Compiler/NFFrontEnd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/Compiler/NFFrontEnd/NFEvalConstants.mo
re84fce5 r8066773 235 235 fail(); 236 236 end if; 237 238 outExp := evaluateExpTraverser(if cond.value then tb else fb, info); 237 239 then 238 evaluateExpTraverser(if cond.value then tb else fb, info);240 (outExp, true); 239 241 240 242 else … … 253 255 // condition is a literal boolean value. 254 256 case Expression.BOOLEAN() 255 then evaluateExpTraverser(if cond.value then tb else fb, info); 257 algorithm 258 outExp := evaluateExpTraverser(if cond.value then tb else fb, info); 259 then 260 (outExp, true); 256 261 257 262 // Otherwise evaluate constants in both branches and return the whole -
OMCompiler/Compiler/NFFrontEnd/NFExpression.mo
ra87a6a00 r8066773 4341 4341 local 4342 4342 list<Dimension> dims; 4343 Type ty; 4343 4344 4344 4345 case RANGE() … … 4355 4356 (); 4356 4357 4357 else (); 4358 else 4359 algorithm 4360 ty := typeOf(exp); 4361 4362 if Type.isConditionalArray(ty) then 4363 ty := Type.simplifyConditionalArray(ty); 4364 exp := setType(ty, exp); 4365 end if; 4366 then 4367 (); 4368 4358 4369 end match; 4359 4370 end retype; -
OMCompiler/Compiler/NFFrontEnd/NFType.mo
re293f5a r8066773 345 345 end if; 346 346 end isMatchedBranch; 347 348 function simplifyConditionalArray 349 input Type ty; 350 output Type outType; 351 algorithm 352 outType := match ty 353 case CONDITIONAL_ARRAY() 354 then match ty.matchedBranch 355 case Branch.TRUE then ty.trueType; 356 case Branch.FALSE then ty.falseType; 357 else ty; 358 end match; 359 360 else ty; 361 end match; 362 end simplifyConditionalArray; 347 363 348 364 function isVector
Note: See TracChangeset
for help on using the changeset viewer.