Skip to content

Commit

Permalink
Avoid deprecated usage of flags
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#1959
  • Loading branch information
lochel authored and OpenModelica-Hudson committed Oct 31, 2017
1 parent ebaacfb commit bf377fa
Show file tree
Hide file tree
Showing 41 changed files with 83 additions and 83 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
@@ -1,5 +1,5 @@
# Jens Frenkel, Jens.Frenkel@tu-dresden.de, 2010-03-30
# CMakefile for compilation of OMC
# CMakefile for compilation of OMC

# CMAKE
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
Expand All @@ -9,7 +9,7 @@ PROJECT(OpenModelicaCompiler)
# Defines for Visual Studio
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -DNOMINMAX -D_COMPLEX_DEFINED)
endif(MSVC)
endif(MSVC)

# Global Variables
SET(OMCTRUNCHOME ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down Expand Up @@ -40,8 +40,8 @@ IF(RUN_TESTS)
# add here your models to compile (add filename without ".mo")
# Example:
# BUILDMODEL(model dir Flags CSRC)
#BUILDMODEL(BouncingBall ${CMAKE_CURRENT_SOURCE_DIR}/testsuite/mosfiles-dassl +d=bltdump "")
#BUILDMODELFMU(Test ${CMAKE_CURRENT_SOURCE_DIR}/build/bin/Test/FMU +d=bltdump "")
#BUILDMODEL(BouncingBall ${CMAKE_CURRENT_SOURCE_DIR}/testsuite/mosfiles-dassl -d=bltdump "")
#BUILDMODELFMU(Test ${CMAKE_CURRENT_SOURCE_DIR}/build/bin/Test/FMU -d=bltdump "")
#BUILDMODELMOS(PolyEvaluate2 PolynomialEvaluatorB.mos ${CMAKE_CURRENT_SOURCE_DIR}/testsuite/simulation/modelica/arrays +simCodeTarget=C "")
#BUILDMODELFMUMOS(WheelLoader D:/Temp/Modell/Radlader-CNH/WheelLoader.mos +d=bltdump "")
ENDIF(RUN_TESTS)
#BUILDMODELFMUMOS(WheelLoader D:/Temp/Modell/Radlader-CNH/WheelLoader.mos -d=bltdump "")
ENDIF(RUN_TESTS)
2 changes: 1 addition & 1 deletion Compiler/BackEnd/DynamicOptimization.mo
Expand Up @@ -104,7 +104,7 @@ algorithm

if not(inOptimicaFlag or inDynOptimization)
then
print("Something going wrong for postOptModul=createDynamicOptimization. Check your flags. You need +g=DynOpt or +g=Optimica!\n");
print("Something going wrong for postOptModul=createDynamicOptimization. Check your flags. You need -g=DynOpt or -g=Optimica!\n");
fail();
end if;
Flags.setConfigEnum(Flags.GRAMMAR, Flags.OPTIMICA);
Expand Down
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/ConnectionGraph.mo
Expand Up @@ -1461,7 +1461,7 @@ algorithm
IOStream.IOStream graphVizStream;
list<String> infoNode;

// don't do anything if we don't have +d=cgraphGraphVizFile or +d=cgraphGraphVizShow
// don't do anything if we don't have -d=cgraphGraphVizFile or -d=cgraphGraphVizShow
case(_, _, _, _, _, _, _, _)
equation
false = boolOr(Flags.isSet(Flags.CGRAPH_GRAPHVIZ_FILE), Flags.isSet(Flags.CGRAPH_GRAPHVIZ_SHOW));
Expand Down Expand Up @@ -1569,7 +1569,7 @@ algorithm
String leftyCMD, fileNameTraceRemovedConnections, omhome, brokenConnects;
Integer leftyExitStatus;

// do not start graphviz if we don't have +d=cgraphGraphVizShow
// do not start graphviz if we don't have -d=cgraphGraphVizShow
case (_, _)
equation
false = Flags.isSet(Flags.CGRAPH_GRAPHVIZ_SHOW);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Expression.mo
Expand Up @@ -3443,7 +3443,7 @@ end crefExp;
public function makeASUB
"@author: adrpo
Creates an ASUB given an expression and a list of expression indexes.
If flag +d=checkASUB is ON we give a warning that the given exp is
If flag -d=checkASUB is ON we give a warning that the given exp is
not a component reference."
input DAE.Exp inExp;
input list<DAE.Exp> inSubs;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Inst.mo
Expand Up @@ -5344,7 +5344,7 @@ algorithm
Option<CachedInstItem> opt;
list<Option<CachedInstItem>> lst;

// nothing is we have +d=noCache
// nothing is we have -d=noCache
case (_, _, _)
equation
false = Flags.isSet(Flags.CACHE);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/InstUtil.mo
Expand Up @@ -568,7 +568,7 @@ algorithm
list<SCode.AlgorithmSection> initialAlgorithmLst1,initialAlgorithmLst2;
SCode.ClassDef cd1, cd2;

// when +g=MetaModelica, check class equality!
// when -g=MetaModelica, check class equality!
case (_,_)
equation
true = Config.acceptMetaModelicaGrammar();
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/NFSCodeLookup.mo
Expand Up @@ -1560,7 +1560,7 @@ algorithm

case (_, _)
equation
// Don't do this if +d=newInst is used, it messed up the new
// Don't do this if -d=newInst is used, it messed up the new
// instantiation which handles this correctly.
false = Flags.isSet(Flags.SCODE_INST);
env_path = NFSCodeEnv.getEnvPath(inEnv);
Expand Down
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/Static.mo
Expand Up @@ -1984,7 +1984,7 @@ algorithm
resType := Types.fixPolymorphicRestype(resType, bindings, info);
(exp,ty) := checkReductionType2(exp, inType,typeA,typeB,resType,Types.equivtypes(typeA,typeB) or isSome(defaultBinding),Types.equivtypes(typeB,resType),info);
(outCache, Util.SUCCESS()) := instantiateDaeFunction(outCache, inEnv, path, false, NONE(), true);
Error.assertionOrAddSourceMessage(Config.acceptMetaModelicaGrammar() or Flags.isSet(Flags.EXPERIMENTAL_REDUCTIONS), Error.COMPILER_NOTIFICATION, {"Custom reduction functions are an OpenModelica extension to the Modelica Specification. Do not use them if you need your model to compile using other tools or if you are concerned about using experimental features. Use +d=experimentalReductions to disable this message."}, info);
Error.assertionOrAddSourceMessage(Config.acceptMetaModelicaGrammar() or Flags.isSet(Flags.EXPERIMENTAL_REDUCTIONS), Error.COMPILER_NOTIFICATION, {"Custom reduction functions are an OpenModelica extension to the Modelica Specification. Do not use them if you need your model to compile using other tools or if you are concerned about using experimental features. Use -d=experimentalReductions to disable this message."}, info);
then
(exp, ty, typeB, defaultBinding, path);
end match;
Expand Down Expand Up @@ -10434,7 +10434,7 @@ algorithm

case (_, env, c, _, _)
equation
// enabled with +d=failtrace
// enabled with -d=failtrace
true = Flags.isSet(Flags.FAILTRACE);
Debug.traceln("- Static.elabCref failed: " +
Dump.printComponentRefStr(c) + " in env: " +
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Types.mo
Expand Up @@ -4134,7 +4134,7 @@ algorithm

case(e, _, _, true)
equation
// activate on +d=types flag
// activate on -d=types flag
true = Flags.isSet(Flags.TYPES);
Debug.traceln("- Types.matchProp failed on exp: " + ExpressionDump.printExpStr(e));
Debug.traceln(printPropStr(inActualType) + " != ");
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Main/Main.mo
Expand Up @@ -783,7 +783,7 @@ algorithm
// print("Path set: " + newPath + "\n");
System.setEnv("PATH",newPath,true);
else
// do not display anything if +d=disableWindowsPathCheckWarning
// do not display anything if -d=disableWindowsPathCheckWarning
if not Flags.isSet(Flags.DISABLE_WINDOWS_PATH_CHECK_WARNING) then
print("We could not find some needed MINGW paths in $OPENMODELICAHOME or $OMDEV. Searched for paths:\n");
print("\t" + binDir + (if hasBinDir then " [found] " else " [not found] ") + "\n");
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Makefile.in
Expand Up @@ -75,7 +75,7 @@ else
simcode: OpenModelicaBootstrappingHeader.h
$(MAKE) -C Template/
OpenModelicaBootstrappingHeader.h: FrontEnd/Absyn.mo Script/GlobalScript.mo FrontEnd/Values.mo Util/Error.mo Util/Util.mo Util/FMI.mo GenerateOMCHeader.mos
@OMC@ +g=MetaModelica GenerateOMCHeader.mos > $@.log || (cat $@.log && false)
@OMC@ -g=MetaModelica GenerateOMCHeader.mos > $@.log || (cat $@.log && false)
@mv $@.new $@
endif
$(SUSANMO): simcode
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Makefile.omdev.mingw
Expand Up @@ -72,7 +72,7 @@ else
simcode: OpenModelicaBootstrappingHeader.h
$(MAKE) -C Template/ -f Makefile.omdev.mingw
OpenModelicaBootstrappingHeader.h: FrontEnd/Absyn.mo Script/GlobalScript.mo FrontEnd/Values.mo Util/Error.mo Util/Util.mo Util/FMI.mo GenerateOMCHeader.mos
$(OMBUILDDIR)/bin/omc +g=MetaModelica GenerateOMCHeader.mos > $@.log || (cat $@.log && false)
$(OMBUILDDIR)/bin/omc -g=MetaModelica GenerateOMCHeader.mos > $@.log || (cat $@.log && false)
@mv $@.new $@
endif
$(SUSANMO): simcode
Expand Down
2 changes: 1 addition & 1 deletion Compiler/NFFrontEnd/NFInst.mo
Expand Up @@ -34,7 +34,7 @@ encapsulated package NFInst
package: NFInst
description: Instantiation

New instantiation, enable with +d=newInst.
New instantiation, enable with -d=newInst.
"

import Absyn;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Script/Interactive.mo
Expand Up @@ -957,7 +957,7 @@ end getApiFunctionNamedArgs;

protected function evaluateGraphicalApi
"Evaluating graphical api.
NOTE: the graphical API is always evaluated with checkModel ON and +d=nogen,noevalfunc ON"
NOTE: the graphical API is always evaluated with checkModel ON and -d=nogen,noevalfunc ON"
input GlobalScript.Statements inStatements;
input GlobalScript.SymbolTable inSymbolTable;
input Boolean isPartialInst;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Script/Makefile.in
@@ -1,5 +1,5 @@
OMC_PATH=@OMC@
OMC=$(OMC_PATH) +d=failtrace
OMC=$(OMC_PATH) -d=failtrace
OMBUILDDIR=@OMBUILDDIR@

include Makefile.common
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Script/Makefile.omdev.mingw
@@ -1,3 +1,3 @@
OMC=OPENMODELICAHOME=$(OMBUILDDIR) $(OMBUILDDIR)/bin/omc +d=failtrace
OMC=OPENMODELICAHOME=$(OMBUILDDIR) $(OMBUILDDIR)/bin/omc -d=failtrace

include Makefile.common
2 changes: 1 addition & 1 deletion Compiler/Script/OpenModelicaScriptingAPI.mos
Expand Up @@ -2,7 +2,7 @@ echo(false);
(bool,a,b,c) := OpenModelica.Scripting.generateScriptingAPI(OpenModelica.Scripting, "OMCInterface");
if bool then
writeFile("OpenModelicaScriptingAPI.tmp.mo","encapsulated package OpenModelicaScriptingAPI\n\n" + a + "annotation(__OpenModelica_Interface=\"backend\");\nend OpenModelicaScriptingAPI;\n");getErrorString();
setCommandLineOptions("+g=MetaModelica");
setCommandLineOptions("-g=MetaModelica");
bool := loadFile("OpenModelicaScriptingAPI.tmp.mo");
if bool then
bool := 0 == system("mv OpenModelicaScriptingAPI.tmp.mo OpenModelicaScriptingAPI.mo");
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Template/CodegenCFunctions.tpl
Expand Up @@ -3548,7 +3548,7 @@ template expTypeShort(DAE.Type type)
case T_FUNCTION_REFERENCE_FUNC(__)
case T_FUNCTION_REFERENCE_VAR(__) then "fnptr"
case T_UNKNOWN(__) then if acceptMetaModelicaGrammar() /* TODO: Don't do this to me! */
then "complex /* assuming void* for unknown type! when +g=MetaModelica */ "
then "complex /* assuming void* for unknown type! when -g=MetaModelica */ "
else "real /* assuming real for unknown type! */"
case T_ANYTYPE(__) then "complex" /* TODO: Don't do this to me! */
else error(sourceInfo(),'expTypeShort: <%unparseType(type)%>')
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Template/Makefile.common
Expand Up @@ -159,7 +159,7 @@ CodegenJS.mo : CodegenJS.tpl SimCodeTV.mo

TplCodegen.mo : ../susan_codegen/TplCodegen.tpl ../susan_codegen/TplCodegenTV.mo
@echo " ** TplCodegen generation ** "
(cd ../susan_codegen && $(OMC) +d=failtrace TplCodegen.tpl) > $@.log || (cat $@.log && false)
(cd ../susan_codegen && $(OMC) -d=failtrace TplCodegen.tpl) > $@.log || (cat $@.log && false)
cp -a ../susan_codegen/TplCodegen.mo $@

TaskSystemDump.mo : TaskSystemDump.tpl SimCodeTV.mo CodegenUtil.tpl SCodeDumpTpl.tpl
Expand Down
14 changes: 7 additions & 7 deletions Compiler/Translation/de.po
Expand Up @@ -3827,7 +3827,7 @@ msgid ""
"Sets the name of the corba session if -d=interactiveCorba or --"
"interactive=corba is used."
msgstr ""
"Legt den Namen der CORBA-Sitzung fest, wenn +d=interactiveCorba verwendet "
"Legt den Namen der CORBA-Sitzung fest, wenn -d=interactiveCorba verwendet "
"wird."

#: ../Util/Flags.mo:941
Expand Down Expand Up @@ -4012,7 +4012,7 @@ msgstr ""
msgid ""
"Sets the path for corba object reference file if -d=interactiveCorba is used."
msgstr ""
"Legt den Pfad für die CORBA Referenzdatei fest, wenn +d=interactiveCorba "
"Legt den Pfad für die CORBA Referenzdatei fest, wenn -d=interactiveCorba "
"verwendet wird."

#: ../Util/Flags.mo:1066
Expand Down Expand Up @@ -4417,7 +4417,7 @@ msgstr ""
#: ../Util/Flags.mo:1293
msgid ""
"Deactivates tearing for the specified components.\n"
"Use '+d=tearingdump' to find out the relevant indexes."
"Use '-d=tearingdump' to find out the relevant indexes."
msgstr ""

#: ../Util/Flags.mo:1296
Expand All @@ -4438,7 +4438,7 @@ msgstr "Legt die Methode zur Reduktion fest."
#: ../Util/Flags.mo:1314
msgid ""
"Sets the tearing variables by its strong component indexes. Use "
"'+d=tearingdump' to find out the relevant indexes.\n"
"'-d=tearingdump' to find out the relevant indexes.\n"
"Use following format: '--setTearingVars=(sci,n,t1,...,tn)*', with sci = "
"strong component index, n = number of tearing variables, t1,...tn = tearing "
"variables.\n"
Expand All @@ -4449,7 +4449,7 @@ msgstr ""
#: ../Util/Flags.mo:1317
msgid ""
"Sets the residual equations by its strong component indexes. Use "
"'+d=tearingdump' to find out the relevant indexes for the collective "
"'-d=tearingdump' to find out the relevant indexes for the collective "
"equations.\n"
"Use following format: '--setResidualEqns=(sci,n,r1,...,rn)*', with sci = "
"strong component index, n = number of residual equations, r1,...rn = "
Expand Down Expand Up @@ -4477,7 +4477,7 @@ msgstr ""
msgid ""
"Activates total tearing (determination of all possible tearing sets) for the "
"specified components.\n"
"Use '+d=tearingdump' to find out the relevant indexes."
"Use '-d=tearingdump' to find out the relevant indexes."
msgstr ""

#: ../Util/Flags.mo:1332
Expand Down Expand Up @@ -4570,7 +4570,7 @@ msgstr ""
#, fuzzy
msgid "Sets the file suffix for zeroMQ port file if --interactive=zmq is used."
msgstr ""
"Legt den Pfad für die CORBA Referenzdatei fest, wenn +d=interactiveCorba "
"Legt den Pfad für die CORBA Referenzdatei fest, wenn -d=interactiveCorba "
"verwendet wird."

#: ../Util/Flags.mo:1383
Expand Down
8 changes: 4 additions & 4 deletions Compiler/Translation/openmodelica.pot
Expand Up @@ -4313,7 +4313,7 @@ msgstr ""
#: ../Util/Flags.mo:1293
msgid ""
"Deactivates tearing for the specified components.\n"
"Use '+d=tearingdump' to find out the relevant indexes."
"Use '-d=tearingdump' to find out the relevant indexes."
msgstr ""

#: ../Util/Flags.mo:1296
Expand All @@ -4333,7 +4333,7 @@ msgstr ""
#: ../Util/Flags.mo:1314
msgid ""
"Sets the tearing variables by its strong component indexes. Use "
"'+d=tearingdump' to find out the relevant indexes.\n"
"'-d=tearingdump' to find out the relevant indexes.\n"
"Use following format: '--setTearingVars=(sci,n,t1,...,tn)*', with sci = "
"strong component index, n = number of tearing variables, t1,...tn = tearing "
"variables.\n"
Expand All @@ -4344,7 +4344,7 @@ msgstr ""
#: ../Util/Flags.mo:1317
msgid ""
"Sets the residual equations by its strong component indexes. Use "
"'+d=tearingdump' to find out the relevant indexes for the collective "
"'-d=tearingdump' to find out the relevant indexes for the collective "
"equations.\n"
"Use following format: '--setResidualEqns=(sci,n,r1,...,rn)*', with sci = "
"strong component index, n = number of residual equations, r1,...rn = "
Expand Down Expand Up @@ -4372,7 +4372,7 @@ msgstr ""
msgid ""
"Activates total tearing (determination of all possible tearing sets) for the "
"specified components.\n"
"Use '+d=tearingdump' to find out the relevant indexes."
"Use '-d=tearingdump' to find out the relevant indexes."
msgstr ""

#: ../Util/Flags.mo:1332
Expand Down
26 changes: 13 additions & 13 deletions Compiler/Translation/sv.po
Expand Up @@ -3033,7 +3033,7 @@ msgstr "Genererar kod med debugsymboler."
#, fuzzy
msgid "Enables dumping of selected states. Extends -d=backenddaeinfo."
msgstr ""
"Slår på dumpning av valda tillståndsvariabler. Utökar +d=backenddaeinfo."
"Slår på dumpning av valda tillståndsvariabler. Utökar -d=backenddaeinfo."

#: ../Util/Flags.mo:312
msgid "Enables dumping of the equations in the order they are calculated."
Expand Down Expand Up @@ -3070,17 +3070,17 @@ msgstr "Utför grafbaserad instantiering."
#: ../Util/Flags.mo:326
#, fuzzy
msgid "Run scode dependency analysis. Use with -d=graphInst"
msgstr "Kör beroendeanalys på SCode. Används med +d=graphInst"
msgstr "Kör beroendeanalys på SCode. Används med -d=graphInst"

#: ../Util/Flags.mo:328
#, fuzzy
msgid "Dumps a graph of the program. Use with -d=graphInst"
msgstr "Skriver ut en graf av programmet.. Används med +d=graphInst"
msgstr "Skriver ut en graf av programmet.. Används med -d=graphInst"

#: ../Util/Flags.mo:330
#, fuzzy
msgid "Display a graph of the program interactively. Use with -d=graphInst"
msgstr "Visar en graf av programmet interaktivt. Används med +d=graphInst"
msgstr "Visar en graf av programmet interaktivt. Används med -d=graphInst"

#: ../Util/Flags.mo:332
msgid "Dump the found replacements for constants."
Expand Down Expand Up @@ -3132,7 +3132,7 @@ msgstr "Stänger av genereringen av ekvationer för okopplade flow-variabler."
#: ../Util/Flags.mo:354
#, fuzzy
msgid "Enables dumping of discrete variables. Extends -d=backenddaeinfo."
msgstr "Slår på dumpning av diskreta variabler. Utökar +d=backenddaeinfo."
msgstr "Slår på dumpning av diskreta variabler. Utökar -d=backenddaeinfo."

#: ../Util/Flags.mo:356
#, fuzzy
Expand Down Expand Up @@ -3814,7 +3814,7 @@ msgstr "Slår på tyst läge."
#: ../Util/Flags.mo:863
#, fuzzy
msgid "Sets the name of the corba session if -d=interactiveCorba is used."
msgstr "Anger namnet på corba-sessionen om +d=interactiveCorba används."
msgstr "Anger namnet på corba-sessionen om -d=interactiveCorba används."

#: ../Util/Flags.mo:867
msgid "Sets the number of processors to use (0=default=auto)."
Expand Down Expand Up @@ -4012,7 +4012,7 @@ msgstr "Skaläriserar alltid bindningar om sann."
msgid ""
"Sets the path for corba object reference file if -d=interactiveCorba is used."
msgstr ""
"Anger namnet på objektreferens-filen för corba om +d=interactiveCorba "
"Anger namnet på objektreferens-filen för corba om -d=interactiveCorba "
"används."

#: ../Util/Flags.mo:992
Expand Down Expand Up @@ -5044,22 +5044,22 @@ msgstr "Fel vid skrivning till fil %s."
#~ msgid "Enables experimental SCode instantiation shortcut phase."
#~ msgstr "Slår på experimentell SCode instansierings-fas."

#~ msgid "Shows the SCode result of +d=scodeInstShortcut."
#~ msgstr "Skriver ut SCode-resultatet av +d=scodeInstShortcut."
#~ msgid "Shows the SCode result of -d=scodeInstShortcut."
#~ msgstr "Skriver ut SCode-resultatet av -d=scodeInstShortcut."

#~ msgid ""
#~ "Prints the result of the redeclare analysis (only works with "
#~ "+d=scodeInstShortcut)."
#~ "-d=scodeInstShortcut)."
#~ msgstr ""
#~ "Skriver ut resultatet av omdeklarerings-analysen (fungerar endast med "
#~ "+d=scodeInstShortcut)."
#~ "-d=scodeInstShortcut)."

#~ msgid ""
#~ "Prints the replacements to be done on program to remove redeclares (only "
#~ "works with +d=scodeInstShortcut)."
#~ "works with -d=scodeInstShortcut)."
#~ msgstr ""
#~ "Skriver ut omdeklareringarna som behövs för att ta bort redeclares "
#~ "(fungerar endast med +d=scodeInstShortcut)."
#~ "(fungerar endast med -d=scodeInstShortcut)."

#~ msgid ""
#~ "Partitions the equation system into independent equation systems (which "
Expand Down

0 comments on commit bf377fa

Please sign in to comment.