Skip to content

Commit

Permalink
[NF] Fill in dims when creating DAE.Element.VAR.
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2200
  • Loading branch information
perost authored and OpenModelica-Hudson committed Feb 14, 2018
1 parent 3bd1e3c commit 027e5cb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Compiler/NFFrontEnd/NFConvertDAE.mo
Expand Up @@ -61,6 +61,7 @@ import ClassTree = NFClassTree;
import NFPrefixes.Visibility;
import NFPrefixes.Direction;
import Variable = NFVariable;
import ComponentReference;

public
function convert
Expand Down Expand Up @@ -111,7 +112,7 @@ algorithm
binding_exp := convertBinding(var.binding);
var_attr := convertVarAttributes(var.typeAttributes, var.ty);
daeVar := makeDAEVar(var.name, var.ty, binding_exp, var.attributes,
var.visibility, var_attr, var.comment, useLocalDir, var.info);
var.visibility, var_attr, var.comment, useLocalDir, false, var.info);
end convertVariable;

function makeDAEVar
Expand All @@ -123,6 +124,7 @@ function makeDAEVar
input Option<DAE.VariableAttributes> vattr;
input Option<SCode.Comment> comment;
input Boolean useLocalDir;
input Boolean isFunctionParam;
input SourceInfo info;
output DAE.Element var;
protected
Expand Down Expand Up @@ -154,7 +156,7 @@ algorithm
Prefixes.visibilityToDAE(vis),
dty,
binding,
{},
if isFunctionParam then {} else ComponentReference.crefDims(dcref),
Prefixes.connectorTypeToDAE(attr.connectorType),
source,
vattr,
Expand Down Expand Up @@ -952,7 +954,7 @@ algorithm
var_attr := convertVarAttributes(ty_attr, ty);
attr := comp.attributes;
then
makeDAEVar(cref, ty, binding, attr, InstNode.visibility(node), var_attr, comp.comment, true, info);
makeDAEVar(cref, ty, binding, attr, InstNode.visibility(node), var_attr, comp.comment, true, true, info);

else
algorithm
Expand Down

0 comments on commit 027e5cb

Please sign in to comment.