Skip to content

Commit

Permalink
cSimplifier: some refactoring; make simplification optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ArmborstL committed Oct 7, 2024
1 parent 60db9ab commit 79e3e6d
Show file tree
Hide file tree
Showing 3 changed files with 286 additions and 92 deletions.
9 changes: 0 additions & 9 deletions src/col/vct/col/ast/unsorted/CNoParamImpl.scala

This file was deleted.

14 changes: 12 additions & 2 deletions src/main/vct/main/stages/Transformation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ object Transformation extends LazyLogging {

def cSimplifierOfOptions(options: Options): Transformation =
CSimplifier(onPassEvent =
writeOutFunctions(before, options.outputBeforePass) ++
options.outputIntermediatePrograms
.map(p => reportIntermediateProgram(p, "intermediate")).toSeq ++
writeOutFunctions(before, options.outputBeforePass) ++
writeOutFunctions(after, options.outputAfterPass)
)

Expand Down Expand Up @@ -463,4 +465,12 @@ case class VeyMontImplementationGeneration(
)

case class CSimplifier(override val onPassEvent: Seq[PassEventHandler] = Nil)
extends Transformation(onPassEvent, Seq(MakeRuntimeChecks))
extends Transformation(
onPassEvent,
Seq(
CIntBoolCoercion,
QuantifySubscriptAny, // no arr[*]
PropagateContextEverywhere, // inline context_everywhere into loop invariants
MakeRuntimeChecks,
),
)
Loading

0 comments on commit 79e3e6d

Please sign in to comment.