File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ trait Config {
55 val verbosity = System .getProperty(" lms.verbosity" ," 0" ).toInt
66 val sourceinfo = System .getProperty(" lms.sourceinfo" ," 0" ).toInt
77 val addControlDeps = System .getProperty(" lms.controldeps" ," true" ).toBoolean
8+
9+ val scalaExplicitTypes = System .getProperty(" lms.scala.explicitTypes" ," false" ).toBoolean
810
911 // memory management type for C++ target (refcnt or gc)
1012 val cppMemMgr = System .getProperty(" lms.cpp.memmgr" ," malloc" )
Original file line number Diff line number Diff line change @@ -99,13 +99,16 @@ trait ScalaCodegen extends GenericCodegen with Config {
9999 }
100100
101101 def emitValDef (sym : Sym [Any ], rhs : String ): Unit = {
102- stream.println(" val " + quote(sym) + " = " + rhs + valDefExtra(sym))
102+ if (scalaExplicitTypes)
103+ emitTypedValDef(sym, rhs)
104+ else
105+ stream.println(src " val $sym = $rhs" + valDefExtra(sym))
103106 }
104107
105108 def emitTypedValDef (sym : Sym [Any ], rhs : String ): Unit = {
106109 stream.println(src " val $sym: ${sym.tp} = $rhs" + valDefExtra(sym))
107110 }
108-
111+
109112 def emitVarDef (sym : Sym [Variable [Any ]], rhs : String ): Unit = {
110113 stream.println(" var " + quote(sym) + " : " + remap(sym.tp) + " = " + rhs)
111114 }
You can’t perform that action at this time.
0 commit comments