2 * A script for GCC-dehydra to analyze the Mozilla codebase and catch
3 * patterns that are incorrect, but which cannot be detected by a compiler. */
6 * Activate Treehydra outparams analysis if running in Treehydra.
9 function treehydra_enabled() {
10 return this.hasOwnProperty('TREE_CODE');
13 include('unstable/getopt.js');
14 [options, args] = getopt();
16 sys.include_path.push(options.topsrcdir);
18 include('string-format.js');
22 function LoadModules(modulelist)
27 let modulenames = modulelist.split(',');
28 for each (let modulename in modulenames) {
29 let module = { __proto__: this };
30 include(modulename, module);
35 LoadModules(options['dehydra-modules']);
36 if (treehydra_enabled())
37 LoadModules(options['treehydra-modules']);
39 function process_type(c)
41 for each (let module in modules)
42 if (module.hasOwnProperty('process_type'))
43 module.process_type(c);
46 function hasAttribute(c, attrname)
50 if (c.attributes === undefined)
53 for each (attr in c.attributes)
54 if (attr.name == 'user' && attr.value[0] == attrname)
60 const forward_functions = [
67 'process_cp_pre_genericize',
71 function setup_forwarding(n)
73 this[n] = function() {
74 for each (let module in modules) {
75 if (module.hasOwnProperty(n)) {
76 module[n].apply(this, arguments);
82 for each (let n in forward_functions)