Skip to content
Snippets Groups Projects
Commit dc153c66 authored by Ali Sinan Köksal's avatar Ali Sinan Köksal
Browse files

make the compiler phase quiet by default

parent e25d1553
No related branches found
No related tags found
No related merge requests found
...@@ -33,20 +33,27 @@ class CPComponent(val global: Global, val pluginInstance: CPPlugin) ...@@ -33,20 +33,27 @@ class CPComponent(val global: Global, val pluginInstance: CPPlugin)
//global ref to freshName creator //global ref to freshName creator
fresh = unit.fresh fresh = unit.fresh
println("Starting CP phase") if (Settings.verbose)
println("Starting CP phase")
val prog: purescala.Definitions.Program = extractCode(unit) val prog: purescala.Definitions.Program = extractCode(unit)
println("Analyzing specification functions") if (Settings.verbose)
val analysis = new purescala.Analysis(prog) println("Analyzing specification functions")
val analysisReporter =
if (Settings.verbose) new purescala.DefaultReporter
else new purescala.QuietReporter
val analysis = new purescala.Analysis(prog, analysisReporter)
analysis.analyse analysis.analyse
println("Finished analysis, starting transformation") if (Settings.verbose)
println("Finished analysis, starting transformation")
val serializedProg = serialize(prog) val serializedProg = serialize(prog)
transformCalls(unit, prog, serializedProg) transformCalls(unit, prog, serializedProg)
println("Finished transformation") if (Settings.verbose)
println("Finished transformation")
} }
} }
} }
...@@ -37,7 +37,9 @@ trait CallTransformation ...@@ -37,7 +37,9 @@ trait CallTransformation
case _ => false case _ => false
} }
val purescalaReporter = purescala.Settings.reporter val purescalaReporter =
if (Settings.verbose) purescala.Settings.reporter
else new purescala.QuietReporter
/** extract predicates and functions beforehand so the stored last used ID value is valid */ /** extract predicates and functions beforehand so the stored last used ID value is valid */
def funDefMap(unit: CompilationUnit) : Map[Position,FunDef] = { def funDefMap(unit: CompilationUnit) : Map[Position,FunDef] = {
......
...@@ -41,6 +41,11 @@ object LTrees { ...@@ -41,6 +41,11 @@ object LTrees {
cache = Some(toRet) cache = Some(toRet)
toRet toRet
} }
override def toString: String = cache match {
case Some(v) => "L[" + v.toString + "]"
case None => "L[" + ids.mkString(",") + "]"
}
} }
trait LTuple[T] { trait LTuple[T] {
...@@ -224,7 +229,7 @@ object LTrees { ...@@ -224,7 +229,7 @@ object LTrees {
val (newConsts, newExpr) = combineConstraint(instantiatedCnstr) val (newConsts, newExpr) = combineConstraint(instantiatedCnstr)
val typedPlaceHolders = newConsts map { val typedPlaceHolders = newConsts map {
case cst => FreshIdentifier("fresh", true).setType(cst.getType) case cst => FreshIdentifier(cst.name, true).setType(cst.getType)
} }
// println("types : " + typedPlaceHolders.map(_.getType)) // println("types : " + typedPlaceHolders.map(_.getType))
val subst1 = ((newConsts map (Variable(_))) zip (typedPlaceHolders map (Variable(_)))).toMap val subst1 = ((newConsts map (Variable(_))) zip (typedPlaceHolders map (Variable(_)))).toMap
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment