Bug 468717 - enable static analysis for js/src, r=jorendorff
authorBenjamin Smedberg <benjamin@smedbergs.us>
Thu, 11 Dec 2008 11:40:04 -0500
changeset 22703 515cba6cd88ab2e2003312177ad9af5ab819f113
parent 22669 e0a2764942936fc859ed5df32e4db5cb7943adef
child 22704 8aaf017a677ca4bfff16991a511dea7abeafbe17
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs468717
milestone1.9.2a1pre
Bug 468717 - enable static analysis for js/src, r=jorendorff
config/static-checking-config.mk
config/static-checking.js
config/string-format.js
js/src/config/static-checking-config.mk
js/src/config/static-checking.js
js/src/config/string-format.js
js/src/jsstack.js
xpcom/analysis/jsstack.js
xpcom/analysis/outparams.js
xpcom/analysis/static-checking.js
xpcom/analysis/string-format.js
--- a/config/static-checking-config.mk
+++ b/config/static-checking-config.mk
@@ -1,22 +1,22 @@
 # The entire tree should be subject to static analysis using the XPCOM
 # script. Additional scripts may be added by specific subdirectories.
 
-DEHYDRA_SCRIPT = $(topsrcdir)/xpcom/analysis/static-checking.js
+DEHYDRA_SCRIPT = $(topsrcdir)/config/static-checking.js
 
 DEHYDRA_MODULES = \
   $(topsrcdir)/xpcom/analysis/final.js \
   $(NULL)
 
 TREEHYDRA_MODULES = \
   $(topsrcdir)/xpcom/analysis/outparams.js \
   $(topsrcdir)/xpcom/analysis/stack.js \
   $(topsrcdir)/xpcom/analysis/flow.js \
-  $(topsrcdir)/xpcom/analysis/jsstack.js \
+  $(topsrcdir)/js/src/jsstack.js \
   $(NULL)
 
 DEHYDRA_ARGS = \
   --topsrcdir=$(topsrcdir) \
   --objdir=$(DEPTH) \
   --dehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(DEHYDRA_MODULES))) \
   --treehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(TREEHYDRA_MODULES))) \
   $(NULL)
rename from xpcom/analysis/static-checking.js
rename to config/static-checking.js
--- a/xpcom/analysis/static-checking.js
+++ b/config/static-checking.js
@@ -8,18 +8,16 @@
 
 function treehydra_enabled() {
   return this.hasOwnProperty('TREE_CODE');
 }
 
 include('unstable/getopt.js');
 [options, args] = getopt();
 
-// XXXbugfix: when you pass arguments to -fplugin-arg, include_path[0] is bad
-sys.include_path[0] = options.topsrcdir + "/xpcom/analysis";
 sys.include_path.push(options.topsrcdir);
 
 include('string-format.js');
 
 let modules = [];
 
 function LoadModules(modulelist)
 {
rename from xpcom/analysis/string-format.js
rename to config/string-format.js
--- a/js/src/config/static-checking-config.mk
+++ b/js/src/config/static-checking-config.mk
@@ -1,24 +1,21 @@
-# Currently spidermonkey has no static checking infrastructure, but it will...
-# This is all dummy values now: see the Mozilla version of this file for
-# an example with real data.
-
-DEHYDRA_SCRIPT = $(error No Spidermonkey static-checking.js yet!)
+DEHYDRA_SCRIPT = $(topsrcdir)/config/static-checking.js
 
 DEHYDRA_MODULES = \
   $(NULL)
 
 TREEHYDRA_MODULES = \
+  $(topsrcdir)/jsstack.js \
   $(NULL)
 
 DEHYDRA_ARGS = \
   --topsrcdir=$(topsrcdir) \
   --objdir=$(DEPTH) \
   --dehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(DEHYDRA_MODULES))) \
   --treehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(TREEHYDRA_MODULES))) \
   $(NULL)
 
 DEHYDRA_FLAGS = -fplugin=$(DEHYDRA_PATH) -fplugin-arg='$(DEHYDRA_SCRIPT) $(DEHYDRA_ARGS)'
 
-# ifdef DEHYDRA_PATH
-# OS_CXXFLAGS += $(DEHYDRA_FLAGS)
-# endif
+ifdef DEHYDRA_PATH
+OS_CXXFLAGS += $(DEHYDRA_FLAGS)
+endif
copy from xpcom/analysis/static-checking.js
copy to js/src/config/static-checking.js
--- a/xpcom/analysis/static-checking.js
+++ b/js/src/config/static-checking.js
@@ -8,18 +8,16 @@
 
 function treehydra_enabled() {
   return this.hasOwnProperty('TREE_CODE');
 }
 
 include('unstable/getopt.js');
 [options, args] = getopt();
 
-// XXXbugfix: when you pass arguments to -fplugin-arg, include_path[0] is bad
-sys.include_path[0] = options.topsrcdir + "/xpcom/analysis";
 sys.include_path.push(options.topsrcdir);
 
 include('string-format.js');
 
 let modules = [];
 
 function LoadModules(modulelist)
 {
copy from xpcom/analysis/string-format.js
copy to js/src/config/string-format.js
rename from xpcom/analysis/jsstack.js
rename to js/src/jsstack.js
--- a/xpcom/analysis/outparams.js
+++ b/xpcom/analysis/outparams.js
@@ -7,17 +7,17 @@ include('util.js');
 include('gcc_util.js');
 include('gcc_print.js');
 include('unstable/adts.js');
 include('unstable/analysis.js');
 include('unstable/esp.js');
 let Zero_NonZero = {};
 include('unstable/zero_nonzero.js', Zero_NonZero);
 
-include('mayreturn.js');
+include('xpcom/analysis/mayreturn.js');
 
 function safe_location_of(t) {
   if (t === undefined)
     return UNKNOWN_LOCATION;
   
   return location_of(t);
 }