Skip to content

Commit

Permalink
- implemented side effects to set/get the information
Browse files Browse the repository at this point in the history
  that a model contains or not inner/outer definitions.
- using this functionality we can speed up some of the 
  Inst functions as we skip doing them.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4812 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Jan 20, 2010
1 parent 2811891 commit ce19563
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
22 changes: 22 additions & 0 deletions Compiler/System.mo
Expand Up @@ -544,15 +544,37 @@ public function readFileNoNumeric
end readFileNoNumeric;

public function setHasExpandableConnectors
"@author: adrpo
sets the external flag that signals the
presence of expandable connectors in a model"
input Boolean hasExpandable;
external "C" ;
end setHasExpandableConnectors;

public function getHasExpandableConnectors
"@author: adrpo
retrieves the external flag that signals the
presence of expandable connectors in a model"
output Boolean hasExpandable;
external "C" ;
end getHasExpandableConnectors;

public function setHasInnerOuterDefinitions
"@author: adrpo
sets the external flag that signals the presence
of inner/outer comoponent definitions in a model"
input Boolean hasInnerOuterDefinitions;
external "C" ;
end setHasInnerOuterDefinitions;

public function getHasInnerOuterDefinitions
"@author: adrpo
retrieves the external flag that signals the presence
of inner/outer comoponent definitions in a model"
output Boolean hasInnerOuterDefinitions;
external "C" ;
end getHasInnerOuterDefinitions;

public function tmpTick "returns a tick that can be reset"
output Integer tickNo;
external "C";
Expand Down
36 changes: 33 additions & 3 deletions Compiler/runtime/systemimpl.c
Expand Up @@ -3517,26 +3517,56 @@ void free_function(modelica_ptr_t func)
}

/*
* side effect to dectect if we have expandable conenctors in a program
* @author: adrpo
* side effect to detect if we have expandable conenctors in a program
*/
int hasExpandableConnector = 0;
/*
* side effect to dectect if we have expandable conenctors in a program
* @author: adrpo
* side effect to set if we have expandable conenctors in a program
*/
RML_BEGIN_LABEL(System__getHasExpandableConnectors)
{
rmlA0 = hasExpandableConnector ? RML_TRUE : RML_FALSE;
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL

/*
* @author: adrpo
* side effect to get if we have expandable conenctors in a program
*/
RML_BEGIN_LABEL(System__setHasExpandableConnectors)
{
hasExpandableConnector = (RML_UNTAGFIXNUM(rmlA0)) ? 1 : 0;
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL

/*
* @author: adrpo
* side effect to detect if we have expandable conenctors in a program
*/
int hasInnerOuterDefinitions = 0;
/*
* @author: adrpo
* side effect to set if we have expandable conenctors in a program
*/
RML_BEGIN_LABEL(System__getHasInnerOuterDefinitions)
{
rmlA0 = hasInnerOuterDefinitions ? RML_TRUE : RML_FALSE;
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL
/*
* @author: adrpo
* side effect to get if we have expandable conenctors in a program
*/
RML_BEGIN_LABEL(System__setHasInnerOuterDefinitions)
{
hasInnerOuterDefinitions = (RML_UNTAGFIXNUM(rmlA0)) ? 1 : 0;
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL

/*
* @author ppriv
Expand Down

0 comments on commit ce19563

Please sign in to comment.