Skip to content

Commit

Permalink
- In DAE:mo made ppStatementStr public.
Browse files Browse the repository at this point in the history
- In Env.mo made avlTreeAdd public (avlTreeGet was already public).
- Added compiler option "noCse" to OptionManager (Specific option for MathCore backend, but other backends that in the future implement CSE (Common Subexpression Elimination) might also want to turn it off (similar as to turning tearing off).

git-svn-id: https://openmodelica.org/svn/OpenModelica/branches/MathCoreOSMC@3949 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Mar 13, 2009
1 parent 7ccaad0 commit d73218e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Compiler/DAE.mo
Expand Up @@ -2687,7 +2687,7 @@ algorithm
ppStmt(alg, 2);
end ppStatement;

protected function ppStatementStr
public function ppStatementStr
"function: ppStatementStr
Prettyprint an algorithm statement to a string."
input Algorithm.Statement alg;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Env.mo
Expand Up @@ -1570,7 +1570,7 @@ algorithm
tree := AVLTREENODE(NONE,0,NONE,NONE);
end avlTreeNew;

protected function avlTreeAdd "
public function avlTreeAdd "
Help function to avlTreeAdd.
"
input AvlTree inAvlTree;
Expand Down
21 changes: 11 additions & 10 deletions Compiler/runtime/optmanager.cpp
Expand Up @@ -54,29 +54,30 @@ extern "C"
{
#include "rml.h"
#include "../absyn_builder/yacclib.h"

// For all options to be used, add an initial value here.
void OptManager_5finit(void)
{
{
options.clear();
options.insert(std::pair<std::string,bool>("translateDAEString",true));
options.insert(std::pair<std::string,bool>("cevalEquation",true));
options.insert(std::pair<std::string,bool>("generateBoschCode",false));
options.insert(std::pair<std::string,bool>("noTearing",false));
options.insert(std::pair<std::string,bool>("noCse",false));
options.insert(std::pair<std::string,bool>("evaluatingSystem",false));
options.insert(std::pair<std::string,bool>("MOOSEScaleEquations",true));
//options.insert(std::pair<std::string,bool>("dummy",false));

/* for(stringMap::const_iterator it = options.begin(); it != options.end(); ++it)
{
cout << "Who(key = first): " << it->first;
cout << " Score(value = second): " << it->second << endl;
}
*/
}
}
RML_BEGIN_LABEL(OptManager__dumpOptions)
{
cout << endl << "Option mappings, (key, value):" <<endl;
cout << endl << "Option mappings, (key, value):" <<endl;
for(stringMap::const_iterator it = options.begin(); it != options.end(); ++it)
{
cout <<"(" << it->first;
Expand All @@ -89,21 +90,21 @@ extern "C"
RML_BEGIN_LABEL(OptManager__setOption)
{
void *entry = rmlA0;
void *value = rmlA1;
void *value = rmlA1;
char *strEntry = RML_STRINGDATA(entry);
bool strValue = RML_PRIM_MKBOOL(value);
stringMap::iterator iter = options.begin();
iter = options.find(strEntry);
if( iter != options.end() ){
if( iter != options.end() ){
options[strEntry] = strValue;
rmlA0 = RML_TRUE;//mk_bcon(1);
}
else{
cout << "Error, option " << strEntry << " is not defined in options-map. Every option needs to be defined at program start." << endl;
cout << "Error, option " << strEntry << " is not defined in options-map. Every option needs to be defined at program start." << endl;
RML_TAILCALLK(rmlFC);
rmlA0 = RML_FALSE; //mk_bcon(-1);
}

RML_TAILCALLK(rmlSC);
}
RML_END_LABEL
Expand All @@ -119,7 +120,7 @@ extern "C"
}
else{
cout << "Error, option " << strEntry << " is not defined in options-map" << endl;
RML_TAILCALLK(rmlFC);
RML_TAILCALLK(rmlFC);
}
RML_TAILCALLK(rmlSC);
}
Expand Down

0 comments on commit d73218e

Please sign in to comment.