Skip to content

Commit

Permalink
Add new flag --useLocalDirection.
Browse files Browse the repository at this point in the history
- Used to revert back to the old behaviour of not stripping input/output
  from non-toplevel variables.
  • Loading branch information
perost committed Oct 14, 2015
1 parent 91f79f8 commit 1e22e09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Compiler/FrontEnd/InstVar.mo
Expand Up @@ -1167,7 +1167,9 @@ algorithm
// Propagate the final prefix from the modifier.
//fin = InstUtil.propagateModFinal(mod, fin);

attr = stripVarAttrDirection(cr, ih, inState, inPrefix, attr);
if not Flags.getConfigBool(Flags.USE_LOCAL_DIRECTION) then
attr = stripVarAttrDirection(cr, ih, inState, inPrefix, attr);
end if;

// Propagate prefixes to any elements inside this components if it's a
// structured component.
Expand Down
6 changes: 5 additions & 1 deletion Compiler/Util/Flags.mo
Expand Up @@ -1189,6 +1189,9 @@ constant ConfigFlag INIT_OPT_MODULES = CONFIG_FLAG(78, "initOptModules",
constant ConfigFlag MAX_MIXED_DETERMINED_INDEX = CONFIG_FLAG(79, "maxMixedDeterminedIndex",
NONE(), EXTERNAL(), INT_FLAG(3), NONE(),
Util.gettext("Sets the maximum mixed-determined index that is handled by the initialization."));
constant ConfigFlag USE_LOCAL_DIRECTION = CONFIG_FLAG(80, "useLocalDirection",
NONE(), EXTERNAL(), BOOL_FLAG(false), NONE(),
Util.gettext("Keeps the input/output prefix for all variables in the flat model, not only top-level ones."));

protected
// This is a list of all configuration flags. A flag can not be used unless it's
Expand Down Expand Up @@ -1273,7 +1276,8 @@ constant list<ConfigFlag> allConfigFlags = {
MATRIX_FORMAT,
PARTLINTORN,
INIT_OPT_MODULES,
MAX_MIXED_DETERMINED_INDEX
MAX_MIXED_DETERMINED_INDEX,
USE_LOCAL_DIRECTION
};

public function new
Expand Down

0 comments on commit 1e22e09

Please sign in to comment.