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 {
5
5
val verbosity = System .getProperty(" lms.verbosity" ," 0" ).toInt
6
6
val sourceinfo = System .getProperty(" lms.sourceinfo" ," 0" ).toInt
7
7
val addControlDeps = System .getProperty(" lms.controldeps" ," true" ).toBoolean
8
+
9
+ val scalaExplicitTypes = System .getProperty(" lms.scala.explicitTypes" ," false" ).toBoolean
8
10
9
11
// memory management type for C++ target (refcnt or gc)
10
12
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 {
99
99
}
100
100
101
101
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))
103
106
}
104
107
105
108
def emitTypedValDef (sym : Sym [Any ], rhs : String ): Unit = {
106
109
stream.println(src " val $sym: ${sym.tp} = $rhs" + valDefExtra(sym))
107
110
}
108
-
111
+
109
112
def emitVarDef (sym : Sym [Variable [Any ]], rhs : String ): Unit = {
110
113
stream.println(" var " + quote(sym) + " : " + remap(sym.tp) + " = " + rhs)
111
114
}
You can’t perform that action at this time.
0 commit comments