# See the License for the specific language governing permissions and
# limitations under the License.
-# Package containing all bases for the reachable from init method analysis
+# Module containing all bases for the reachable from init method analysis
package reachable_from_init_method_analysis
import icode
# This method will create a file and output the name of all methods reachable
# from an init in it
fun dump_reachable_methods_from_init(directory_name: String) do
- var f = new OFStream.open("{directory_name}/{module.name}.reachable_methods_from_init.log")
+ var f = new OFStream.open("{directory_name}/{main_module.name}.reachable_methods_from_init.log")
with_each_methods !action(m) do
if rfima.is_method_reachable_from_init(m) then
f.write("{m.full_name}\n")
# This method will create a file and output the name of all reachable methods that
# can not be reached from an init in it
fun dump_unreachable_methods_from_init(directory_name: String) do
- var f = new OFStream.open("{directory_name}/{module.name}.unreachable_methods_from_init.log")
+ var f = new OFStream.open("{directory_name}/{main_module.name}.unreachable_methods_from_init.log")
with_each_methods !action(m) do
if not rfima.is_method_reachable_from_init(m) and rma.is_method_reachable(m) then
f.write("{m.full_name}\n")
# Default behavior is to say that all methods/iroutines are reachable
# from at least one init
class DefaultReachableFromInitMethodAnalysis
-special ReachableFromInitMethodAnalysis
+ super ReachableFromInitMethodAnalysis
redef fun is_iroutine_reachable_from_init(ir: nullable IRoutine): Bool do return true
redef fun is_method_reachable_from_init(method: MMMethod): Bool do return true