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

Commit

Permalink
Reduced code used when bootstrapping
Browse files Browse the repository at this point in the history
- Stubbed away MidCode and NFUnitCheck
- Removed most NF packages from bootstrapping

Belonging to [master]:
  - #2324
  - OpenModelica/OpenModelica-testsuite#903
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Mar 28, 2018
1 parent 0e62fe0 commit 7199ae1
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 61 deletions.
File renamed without changes.
17 changes: 17 additions & 0 deletions Compiler/Stubs/CodegenMidToC.mo
@@ -0,0 +1,17 @@
encapsulated package CodegenMidToC
"
file: CodegenMidToC.mo
package: CodegenMidToC
description: Generated by Susan.
"

public function genProgram<Text, T>
input Text in_txt;
input T in_a_p;
output Text out_txt;
algorithm
assert(false, "MidToC not enabled with stubs");
end genProgram;

annotation(__OpenModelica_Interface="backend");
end CodegenMidToC;
44 changes: 44 additions & 0 deletions Compiler/Stubs/DAEToMid.mo
@@ -0,0 +1,44 @@
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-2018, Open Source Modelica Consortium (OSMC),
* c/o Linköpings universitet, Department of Computer and Information Science,
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR
* THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
* ACCORDING TO RECIPIENTS CHOICE.
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from OSMC, either from the above address,
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or
* http://www.openmodelica.org, and in the OpenModelica distribution.
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
*
* This program is distributed WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
*
* See the full OSMC Public License conditions for more details.
*
*/

encapsulated package DAEToMid

function DAEFunctionsToMid<T>
input list<T> simfuncs;
output list<Integer> midfuncs;
algorithm
assert(false, getInstanceName() + " is stubbed away");
end DAEFunctionsToMid;

annotation(__OpenModelica_Interface="backend");

end DAEToMid;

44 changes: 44 additions & 0 deletions Compiler/Stubs/MidCode.mo
@@ -0,0 +1,44 @@
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-2014, Open Source Modelica Consortium (OSMC),
* c/o Linköpings universitet, Department of Computer and Information Science,
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR
* THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
* ACCORDING TO RECIPIENTS CHOICE.
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from OSMC, either from the above address,
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or
* http://www.openmodelica.org, and in the OpenModelica distribution.
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
*
* This program is distributed WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
*
* See the full OSMC Public License conditions for more details.
*
*/

encapsulated package MidCode

uniontype Program
record PROGRAM
String name;
list<Integer> functions;
end PROGRAM;
end Program;

type Function = Integer;

annotation(__OpenModelica_Interface="backend");
end MidCode;
21 changes: 21 additions & 0 deletions Compiler/Stubs/NFUnitCheck.mo
@@ -0,0 +1,21 @@
encapsulated package NFUnitCheck
" file: NFUnitCheck.mo
package: UnitCheck
description: This package provides everything for advanced unit checking:
- for all variables unspecified units get calculated if possible
- inconsistent equations get reported in a user friendly way
authors: Jan Hagemann and Lennart Ochel (FH Bielefeld, Germany)"

import DAE;

public function checkUnits
input DAE.DAElist inDAE;
input DAE.FunctionTree func;
output DAE.DAElist outDAE = inDAE;
algorithm
return;
end checkUnits;

annotation(__OpenModelica_Interface="frontend");
end NFUnitCheck;

129 changes: 68 additions & 61 deletions Compiler/boot/LoadCompilerSources.mos
Expand Up @@ -60,6 +60,7 @@ if true then /* Suppress output */
"../FrontEnd/NFEnvExtends.mo",
"../FrontEnd/NFInstPrefix.mo",
"../FrontEnd/NFInstTypes.mo",
"../FrontEnd/NFInstUtil.mo",
"../FrontEnd/NFSCodeDependency.mo",
"../FrontEnd/NFSCodeEnv.mo",
"../FrontEnd/NFSCodeFlattenImports.mo",
Expand Down Expand Up @@ -88,60 +89,8 @@ if true then /* Suppress output */
"../FFrontEnd/FTraverse.mo",
"../FFrontEnd/FVisit.mo",

// "NFFrontEnd";
"../NFFrontEnd/NFBinding.mo",
"../NFFrontEnd/NFBindingOrigin.mo",
"../NFFrontEnd/NFBuiltin.mo",
"../NFFrontEnd/NFBuiltinFuncs.mo",
"../NFFrontEnd/NFCall.mo",
"../NFFrontEnd/NFCeval.mo",
"../NFFrontEnd/NFComplexType.mo",
"../NFFrontEnd/NFComponent.mo",
"../NFFrontEnd/NFComponentRef.mo",
"../NFFrontEnd/NFConvertDAE.mo",
"../NFFrontEnd/NFConnectEquations.mo",
"../NFFrontEnd/NFConnection.mo",
"../NFFrontEnd/NFConnections.mo",
"../NFFrontEnd/NFConnectionSets.mo",
"../NFFrontEnd/NFConnector.mo",
"../NFFrontEnd/NFDimension.mo",
"../NFFrontEnd/NFEquation.mo",
//"../NFFrontEnd/NFEvalFunction.mo",
"../NFFrontEnd/NFExpression.mo",
"../NFFrontEnd/NFExpressionIterator.mo",
"../NFFrontEnd/NFExpOrigin.mo",
"../NFFrontEnd/NFFlatModel.mo",
"../NFFrontEnd/NFFlatten.mo",
"../NFFrontEnd/NFFunction.mo",
"../NFFrontEnd/NFInst.mo",
"../NFFrontEnd/NFClass.mo",
"../NFFrontEnd/NFClassTree.mo",
"../NFFrontEnd/NFImport.mo",
"../NFFrontEnd/NFInstNode.mo",
"../NFFrontEnd/NFInstUtil.mo",
"../NFFrontEnd/NFLookup.mo",
"../NFFrontEnd/NFLookupState.mo",
"../NFFrontEnd/NFModifier.mo",
"../NFFrontEnd/NFOperator.mo",
"../NFFrontEnd/NFPrefixes.mo",
"../NFFrontEnd/NFRangeIterator.mo",
"../NFFrontEnd/NFRecord.mo",
"../NFFrontEnd/NFRestriction.mo",
"../NFFrontEnd/NFScalarize.mo",
"../NFFrontEnd/NFSimplifyExp.mo",
"../NFFrontEnd/NFSections.mo",
"../NFFrontEnd/NFStatement.mo",
"../NFFrontEnd/NFSubscript.mo",
"../NFFrontEnd/NFPackage.mo",
"../NFFrontEnd/NFType.mo",
"../NFFrontEnd/NFTypeCheck.mo",
"../NFFrontEnd/NFTyping.mo",
"../NFFrontEnd/NFUnitCheck.mo",
"../NFFrontEnd/NFHashTableStringToUnit.mo",
"../NFFrontEnd/NFHashTableUnitToString.mo",
"../NFFrontEnd/NFHashTableCrToUnit.mo",
"../NFFrontEnd/NFUnit.mo",
"../NFFrontEnd/NFVariable.mo",
// NF files required for bootstrapping are put in the FrontEnd folder
// NF files not required for bootstrapping are put together with the backend files

// "BackEnd";
"../BackEnd/BackendDAE.mo",
Expand Down Expand Up @@ -243,22 +192,20 @@ if true then /* Suppress output */
"../Util/System.mo",
"../Util/Util.mo",
"../Util/VarTransform.mo",
"../Util/ZeroMQ.mo",

// "MidCode";
"../MidCode/MidCode.mo",
"../MidCode/DAEToMid.mo",
"../MidCode/MidToMid.mo",
"../MidCode/HashTableMidVar.mo"
"../Util/ZeroMQ.mo"
};
backendfiles := if OpenModelica.Scripting.getEnvironmentVar("OPENMODELICA_BACKEND_STUBS")<>"" then
{
"../Stubs/BackendDAECreate.mo",
"../Stubs/BackendDAEUtil.mo",
"../Stubs/CevalScriptBackend.mo",
"../Stubs/CodegenMidToC.mo",
"../Stubs/DAEToMid.mo",
"../Stubs/DumpGraphviz.mo",
"../Stubs/FGraphStream.mo",
"../Stubs/MidCode.mo",
"../Stubs/NFInstDump.mo",
"../Stubs/NFUnitCheck.mo",
"../Stubs/Refactor.mo",
"../Stubs/RewriteRules.mo",
"../Stubs/SimCode.mo",
Expand Down Expand Up @@ -334,6 +281,66 @@ if true then /* Suppress output */
"../FrontEnd/UnitAbsynBuilder.mo",
"../FrontEnd/UnitChecker.mo",

// "MidCode";
"../MidCode/MidCode.mo",
"../MidCode/DAEToMid.mo",
"../MidCode/MidToMid.mo",
"../MidCode/HashTableMidVar.mo",

// "NFFrontEnd";
"../NFFrontEnd/NFBinding.mo",
"../NFFrontEnd/NFBindingOrigin.mo",
"../NFFrontEnd/NFBuiltin.mo",
"../NFFrontEnd/NFBuiltinFuncs.mo",
"../NFFrontEnd/NFCall.mo",
"../NFFrontEnd/NFCeval.mo",
"../NFFrontEnd/NFComplexType.mo",
"../NFFrontEnd/NFComponent.mo",
"../NFFrontEnd/NFComponentRef.mo",
"../NFFrontEnd/NFConvertDAE.mo",
"../NFFrontEnd/NFConnectEquations.mo",
"../NFFrontEnd/NFConnection.mo",
"../NFFrontEnd/NFConnections.mo",
"../NFFrontEnd/NFConnectionSets.mo",
"../NFFrontEnd/NFConnector.mo",
"../NFFrontEnd/NFDimension.mo",
"../NFFrontEnd/NFEquation.mo",
//"../NFFrontEnd/NFEvalFunction.mo",
"../NFFrontEnd/NFExpression.mo",
"../NFFrontEnd/NFExpressionIterator.mo",
"../NFFrontEnd/NFExpOrigin.mo",
"../NFFrontEnd/NFFlatModel.mo",
"../NFFrontEnd/NFFlatten.mo",
"../NFFrontEnd/NFFunction.mo",
"../NFFrontEnd/NFInst.mo",
"../NFFrontEnd/NFClass.mo",
"../NFFrontEnd/NFClassTree.mo",
"../NFFrontEnd/NFImport.mo",
"../NFFrontEnd/NFInstNode.mo",
"../NFFrontEnd/NFLookup.mo",
"../NFFrontEnd/NFLookupState.mo",
"../NFFrontEnd/NFModifier.mo",
"../NFFrontEnd/NFOperator.mo",
"../NFFrontEnd/NFPrefixes.mo",
"../NFFrontEnd/NFRangeIterator.mo",
"../NFFrontEnd/NFRecord.mo",
"../NFFrontEnd/NFRestriction.mo",
"../NFFrontEnd/NFScalarize.mo",
"../NFFrontEnd/NFSimplifyExp.mo",
"../NFFrontEnd/NFSections.mo",
"../NFFrontEnd/NFStatement.mo",
"../NFFrontEnd/NFSubscript.mo",
"../NFFrontEnd/NFPackage.mo",
"../NFFrontEnd/NFType.mo",
"../NFFrontEnd/NFTypeCheck.mo",
"../NFFrontEnd/NFTyping.mo",
"../NFFrontEnd/NFUnitCheck.mo",
"../NFFrontEnd/NFHashTableStringToUnit.mo",
"../NFFrontEnd/NFHashTableUnitToString.mo",
"../NFFrontEnd/NFHashTableCrToUnit.mo",
"../NFFrontEnd/NFUnit.mo",
"../NFFrontEnd/NFVariable.mo",

"../Lexers/LexerJSON.mo",
"../Lexers/LexerModelicaDiff.mo",
"../Parsers/JSON.mo",
Expand Down

0 comments on commit 7199ae1

Please sign in to comment.