Skip to content

Commit

Permalink
- Started removing pattern inputs that are never used (OMC dead code):
Browse files Browse the repository at this point in the history
  case (1,_) ... case (2,_) => case 1 ... case 2
  - We have a lot of these because of RML forces us to put all inputs of the function as the inputs of a match-expression
  - This makes more match-expressions simplify into if-expressions
- Made all packages encapsulated (and fixed Susan so it outputs encapsulated packages)
  - This should make dependency analysis on OMC work better


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7671 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 10, 2011
1 parent d8d188b commit a81dd74
Show file tree
Hide file tree
Showing 102 changed files with 404 additions and 1,787 deletions.
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAE.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package BackendDAE
encapsulated package BackendDAE
" file: BackendDAE.mo
package: BackendDAE
description: BackendDAE contains the datatypes used by the backend.
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAECreate.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package BackendDAECreate
encapsulated package BackendDAECreate
" file: BackendDAECreate.mo
package: BackendDAECreate
description: This file contains all functions for transforming the DAE structure
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAEEXT.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package BackendDAEEXT
encapsulated package BackendDAEEXT
" file: BackendDAEEXT.mo
package: BackendDAEEXT
description: The BackendDAEEXT module is an externally implemented module (in file
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package BackendDAEOptimize
encapsulated package BackendDAEOptimize
" file: BackendDAEOptimize.mo
package: BackendDAEOptimize
description: BackendDAEOPtimize contains functions that do some kind of
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAETransform.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package BackendDAETransform
encapsulated package BackendDAETransform
" file: BackendDAETransform.mo
package: BackendDAETransform
description: BackendDAETransform contains functions that are needed to perform
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAEUtil.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package BackendDAEUtil
encapsulated package BackendDAEUtil
" file: BackendDAEUtil.mo
package: BackendDAEUtil
description: BackendDAEUtil comprised functions for BackendDAE data types.
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDump.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package BackendDump
encapsulated package BackendDump
" file: BackendDump.mo
package: BackendDump
description: Unparsing the BackendDAE structure
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendEquation.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package BackendEquation
encapsulated package BackendEquation
" file: BackendEquation.mo
package: BackendEquation
description: BackendEquation contains functions that do something with
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendVarTransform.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package BackendVarTransform
encapsulated package BackendVarTransform
" file: BackendVarTransform.mo
package: BackendVarTransform
description: BackendVarTransform contains a Binary Tree representation of variable replacements.
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendVariable.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package BackendVariable
encapsulated package BackendVariable
" file: mo
package: BackendVariable
description: BackendVariables contains the function that deals with the datytypes
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/DAEQuery.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package DAEQuery
encapsulated package DAEQuery
" file: DAEQuery.mo
package: DAEQuery
description: DAEQuery contains functionality for query of Incidence Matrix.
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/Derive.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package Derive
encapsulated package Derive
" file: Derive.mo
package: Derive
description: Differentiation of equations from BackendDAE.BackendDAE
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/ExpressionSolve.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package ExpressionSolve
encapsulated package ExpressionSolve
"
file: ExpressionSolve.mo
package: ExpressionSolve
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/PartFn.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package PartFn
encapsulated package PartFn
" file: PartFn.mo
package: PartFn
description: partially evaluated functions
Expand Down
3 changes: 1 addition & 2 deletions Compiler/BackEnd/SimCode.mo
Expand Up @@ -29,8 +29,7 @@
*
*/


package SimCode
encapsulated package SimCode
" file: SimCode.mo
package: SimCode
description: Code generation using Susan templates
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/TaskGraph.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package TaskGraph
encapsulated package TaskGraph
" file: TaskGraph.mo
package: TaskGraph
description: Building of task graphs from expressions, and equation systems.
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/TaskGraphExt.mo
Expand Up @@ -28,7 +28,7 @@
* See the full OSMC Public License conditions for more details.
*
*/
package TaskGraphExt
encapsulated package TaskGraphExt
" file: TaskGraphExt.mo
package: TaskGraphExt
description: The external representation of a task graph, using Boost Graph Library in C++.
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/XMLDump.mo
Expand Up @@ -71,7 +71,7 @@ within the equation element.
*/


package XMLDump
encapsulated package XMLDump
" file: XMLDump.mo
package: XMLDump
description: Dumping of DAE as XML
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Absyn.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package Absyn
encapsulated package Absyn
"
file: Absyn.mo
package: Absyn
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/AbsynDep.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package AbsynDep
encapsulated package AbsynDep
"
file: AbsynDep.mo
package: AbsynDep
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Algorithm.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package Algorithm
encapsulated package Algorithm
"
file: Algorithm.mo
package: Algorithm
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Builtin.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package Builtin
encapsulated package Builtin
" file: Builtin.mo
package: Builtin
description: Builting tyepes and variables
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Ceval.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package Ceval
encapsulated package Ceval
" file: Ceval.mo
package: Ceval
description: Constant propagation of expressions
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/CevalFunction.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package CevalFunction
encapsulated package CevalFunction
" file: CevalFunction.mo
package: CevalFunction
description: This module constant evaluates DAE.Function objects, i.e.
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/ClassInf.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package ClassInf
encapsulated package ClassInf
" file: ClassInf.mo
package: ClassInf
description: Class restrictions
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/ClassLoader.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package ClassLoader
encapsulated package ClassLoader
" file: ClassLoader.mo
package: ClassLoader
description: Loading of classes from $OPENMODELICALIBRARY.
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/ComponentReference.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package ComponentReference
encapsulated package ComponentReference
"
file: ComponentReference.mo
package: ComponentReference
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Connect.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package Connect
encapsulated package Connect
" file: Connect.mo
package: Connect
description: Connection set management
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/ConnectUtil.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package ConnectUtil
encapsulated package ConnectUtil
" file: ConnectUtil.mo
package: ConnectUtil
description: Connection set management
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/ConnectionGraph.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package ConnectionGraph
encapsulated package ConnectionGraph
" file: ConnectionGraph.mo
package: ConnectionGraph
description: Constant propagation of expressions
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Constants.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package Constants
encapsulated package Constants
" file: Constants.mo
package: Constants
description: definition of a set of constants
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/DAE.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package DAE
encapsulated package DAE
" file: DAE.mo
package: DAE
description: DAE management and output
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/DAEDump.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package DAEDump
encapsulated package DAEDump
" file: DAEDump.mo
package: DAEDump
description: DAEDump output
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/DAEUtil.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package DAEUtil
encapsulated package DAEUtil
" file: DAEUtil.mo
package: DAE
description: DAE management and output
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Dependency.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package Dependency
encapsulated package Dependency
" file: Dependency.mo
package: Dependency
description: This module contains functionality for dependency
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Dump.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package Dump
encapsulated package Dump
"
file: Dump.mo
package: Dump
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/DumpGraphviz.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package DumpGraphviz
encapsulated package DumpGraphviz
"
file: DumpGraphviz.mo
package: DumpGraphviz
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Env.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package Env
encapsulated package Env
"
file: Env.mo
package: Env
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/ExpandableConnectors.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package ExpandableConnectors
encapsulated package ExpandableConnectors
" file: ExpandableConnectors.mo
package: ExpandableConnectors
description: ExpandableConnectors translates Absyn to SCode intermediate form
Expand Down
16 changes: 15 additions & 1 deletion Compiler/FrontEnd/Expression.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package Expression
encapsulated package Expression
"
file: Expression.mo
package: Expression
Expand Down Expand Up @@ -6186,5 +6186,19 @@ algorithm
end matchcontinue;
end subscriptContain2;

public function hasNoSideEffects
"Returns true if the expression is free from side-effects. Use with traverseExp."
input tuple<DAE.Exp,Boolean> itpl;
output tuple<DAE.Exp,Boolean> otpl;
algorithm
otpl := match itpl
local
DAE.Exp e;
case ((e as DAE.CALL(path=_),_)) then ((e,false));
case ((e as DAE.MATCHEXPRESSION(matchType=_),_)) then ((e,false));
else itpl;
end match;
end hasNoSideEffects;

end Expression;

2 changes: 1 addition & 1 deletion Compiler/FrontEnd/ExpressionDump.mo
Expand Up @@ -29,7 +29,7 @@
*
*/

package ExpressionDump
encapsulated package ExpressionDump
"
file: ExpressionDump.mo
package: ExpressionDump
Expand Down

0 comments on commit a81dd74

Please sign in to comment.