Skip to content

Commit

Permalink
Fix new backend implicit flags (#9803)
Browse files Browse the repository at this point in the history
- Move the setting of the implicit flags for the new backend from
  SimCodeMain to the frontend so they're always set even if not going
  through the `translateModel` path.
  • Loading branch information
perost committed Nov 29, 2022
1 parent 19b4cda commit c2b2da9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions OMCompiler/Compiler/NFFrontEnd/NFInst.mo
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ end instClassInProgram;
function resetGlobalFlags
"Resets the global flags that the frontend uses."
algorithm
if Flags.getConfigBool(Flags.NEW_BACKEND) then
FlagsUtil.set(Flags.NF_SCALARIZE, false);
FlagsUtil.set(Flags.ARRAY_CONNECT, true);
end if;

// gather here all the flags to disable expansion
// and scalarization if -d=-nfScalarize is on
if not Flags.isSet(Flags.NF_SCALARIZE) then
Expand Down
4 changes: 0 additions & 4 deletions OMCompiler/Compiler/SimCode/SimCodeMain.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1044,10 +1044,6 @@ algorithm
// new backend - also activates new frontend by default
case (graph, filenameprefix) guard(Flags.getConfigBool(Flags.NEW_BACKEND))
algorithm
// set implied flags to true
FlagsUtil.enableDebug(Flags.SCODE_INST);
FlagsUtil.enableDebug(Flags.ARRAY_CONNECT);
FlagsUtil.disableDebug(Flags.NF_SCALARIZE);
// ToDo: set permanently matching -> SBGraphs

// ================================
Expand Down

0 comments on commit c2b2da9

Please sign in to comment.