Skip to content

Commit 5ae6e0e

Browse files
FedericoAurelianopolgreen
authored andcommitted
dont replace instance variables
1 parent 88459bb commit 5ae6e0e

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

src/main/scala/uclid/lang/PrimedVariableEliminator.scala

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -171,26 +171,7 @@ class PrimedVariableEliminatorPass extends RewritePass {
171171
lazy val primeVarMap = primedVariableCollector.primeVarMap.get
172172
val modType = instD.modType.get
173173
val writeableArgs = (modType.outputs ++ modType.sharedVars).map(p => p._1).toSet
174-
val argsP = instD.arguments.map {
175-
case (argId, exprOption) => {
176-
exprOption match {
177-
case Some(expr) =>
178-
if (writeableArgs.contains(argId)) {
179-
// Output arguments must strictly be identifiers.
180-
Utils.assert(expr.isInstanceOf[Identifier], "Module outputs and shared variables must be identifiers.")
181-
val varId = expr.asInstanceOf[Identifier]
182-
primeVarMap.get(varId) match {
183-
case Some(varIdP) => (argId, Some(varIdP))
184-
case None => (argId, exprOption)
185-
}
186-
} else {
187-
(argId, exprOption)
188-
}
189-
case None =>
190-
(argId, exprOption)
191-
}
192-
}
193-
}
174+
val argsP = instD.arguments
194175
val instP = InstanceDecl(instD.instanceId, instD.moduleId, argsP, instD.instType, instD.modType)
195176
Some(instP)
196177
}

0 commit comments

Comments
 (0)