nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RTA: force primitive types to be alive
[nit.git]
/
src
/
rapid_type_analysis.nit
diff --git
a/src/rapid_type_analysis.nit
b/src/rapid_type_analysis.nit
index
820819d
..
e2422aa
100644
(file)
--- a/
src/rapid_type_analysis.nit
+++ b/
src/rapid_type_analysis.nit
@@
-81,6
+81,12
@@
class RapidTypeAnalysis
# The method definitions that remain to visit
private var todo = new List[MMethodDef]
# The method definitions that remain to visit
private var todo = new List[MMethodDef]
+ private fun force_alive(classname: String)
+ do
+ var classes = self.modelbuilder.model.get_mclasses_by_name(classname)
+ if classes != null then for c in classes do self.add_new(c.mclass_type, c.mclass_type)
+ end
+
# Run the analysis until all visitable method definitions are visited.
fun run_analysis
do
# Run the analysis until all visitable method definitions are visited.
fun run_analysis
do
@@
-96,9
+102,11
@@
class RapidTypeAnalysis
add_send(maintype, mainprop)
end
add_send(maintype, mainprop)
end
- # Force Bool
- var classes = self.modelbuilder.model.get_mclasses_by_name("Bool")
- if classes != null then for c in classes do self.add_new(c.mclass_type, c.mclass_type)
+ # Force primitive types
+ force_alive("Bool")
+ force_alive("Int")
+ force_alive("Float")
+ force_alive("Char")
while not todo.is_empty do
var mmethoddef = todo.shift
while not todo.is_empty do
var mmethoddef = todo.shift