comp: add --no-check-all
authorJean Privat <jean@pryen.org>
Wed, 13 Aug 2014 14:12:59 +0000 (10:12 -0400)
committerJean Privat <jean@pryen.org>
Wed, 13 Aug 2014 14:12:59 +0000 (10:12 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/abstract_compiler.nit
src/separate_erasure_compiler.nit

index 7c5d9a6..b6bb116 100644 (file)
@@ -53,6 +53,8 @@ redef class ToolContext
        var opt_no_check_autocast: OptionBool = new OptionBool("Disable implicit casts on unsafe expression usage (dangerous)", "--no-check-autocast")
        # --no-check-null
        var opt_no_check_null: OptionBool = new OptionBool("Disable tests of null receiver (dangerous)", "--no-check-null")
+       # --no-check-all
+       var opt_no_check_all: OptionBool = new OptionBool("Disable all tests (dangerous)", "--no-check-all")
        # --typing-test-metrics
        var opt_typing_test_metrics: OptionBool = new OptionBool("Enable static and dynamic count of all type tests", "--typing-test-metrics")
        # --invocation-metrics
@@ -70,7 +72,7 @@ redef class ToolContext
        do
                super
                self.option_context.add_option(self.opt_output, self.opt_dir, self.opt_no_cc, self.opt_no_main, self.opt_make_flags, self.opt_compile_dir, self.opt_hardening, self.opt_no_shortcut_range)
-               self.option_context.add_option(self.opt_no_check_covariance, self.opt_no_check_attr_isset, self.opt_no_check_assert, self.opt_no_check_autocast, self.opt_no_check_null)
+               self.option_context.add_option(self.opt_no_check_covariance, self.opt_no_check_attr_isset, self.opt_no_check_assert, self.opt_no_check_autocast, self.opt_no_check_null, self.opt_no_check_all)
                self.option_context.add_option(self.opt_typing_test_metrics, self.opt_invocation_metrics, self.opt_isset_checks_metrics)
                self.option_context.add_option(self.opt_stacktrace)
                self.option_context.add_option(self.opt_no_gcc_directive)
@@ -96,6 +98,14 @@ redef class ToolContext
                        print "Error: cannot use both --dir and --output"
                        exit(1)
                end
+
+               if opt_no_check_all.value then
+                       opt_no_check_covariance.value = true
+                       opt_no_check_attr_isset.value = true
+                       opt_no_check_assert.value = true
+                       opt_no_check_autocast.value = true
+                       opt_no_check_null.value = true
+               end
        end
 end
 
index a60cccd..f1d3300 100644 (file)
@@ -32,6 +32,15 @@ redef class ToolContext
                self.option_context.add_option(self.opt_erasure, self.opt_no_check_erasure_cast, opt_rta)
        end
 
+       redef fun process_options(args)
+       do
+               super
+
+               if opt_no_check_all.value then
+                       opt_no_check_erasure_cast.value = true
+               end
+       end
+
        var erasure_compiler_phase = new ErasureCompilerPhase(self, null)
 end