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

Commit

Permalink
[NF] Don't evaluate external objects.
Browse files Browse the repository at this point in the history
- Ignore external objects when -d=evaluateAllParameters is used.

Belonging to [master]:
  - #3044
  • Loading branch information
perost authored and OpenModelica-Hudson committed Apr 8, 2019
1 parent d82185e commit f2e6265
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Compiler/NFFrontEnd/NFComponent.mo
Expand Up @@ -697,6 +697,17 @@ uniontype Component
output Boolean isConnector = ConnectorType.isExpandable(connectorType(component));
end isExpandableConnector;

function isExternalObject
input Component component;
output Boolean isEO;
algorithm
isEO := match component
case UNTYPED_COMPONENT() then Class.isExternalObject(InstNode.getClass(component.classInst));
case TYPED_COMPONENT() then Type.isExternalObject(component.ty);
else false;
end match;
end isExternalObject;

function isIdentical
input Component comp1;
input Component comp2;
Expand Down
4 changes: 4 additions & 0 deletions Compiler/NFFrontEnd/NFInst.mo
Expand Up @@ -3270,6 +3270,9 @@ algorithm
if not Component.getFixedAttribute(component) then
// Except non-fixed parameters.
isStructural := false;
elseif Component.isExternalObject(component) then
// Except external objects.
isStructural := false;
elseif Binding.isUnbound(compBinding) then
// Except parameters with no bindings.
if not evalAllParams then
Expand Down Expand Up @@ -3344,6 +3347,7 @@ algorithm
isNotFixed := false;
elseif var == Variability.PARAMETER and
(not requireFinal or Component.isFinal(c)) and
not Component.isExternalObject(c) and
Component.getFixedAttribute(c) then
isNotFixed := isBindingNotFixed(Component.getBinding(c), requireFinal, depth + 1);
else
Expand Down
10 changes: 10 additions & 0 deletions Compiler/NFFrontEnd/NFType.mo
Expand Up @@ -352,6 +352,16 @@ public
end match;
end isExpandableConnector;

function isExternalObject
input Type ty;
output Boolean isEO;
algorithm
isEO := match ty
case COMPLEX(complexTy = ComplexType.EXTERNAL_OBJECT()) then true;
else false;
end match;
end isExternalObject;

function isRecord
input Type ty;
output Boolean isRecord;
Expand Down

0 comments on commit f2e6265

Please sign in to comment.