From: Petr Machata Date: Fri, 8 Apr 2011 00:03:01 +0000 (+0200) Subject: dwarflint: Drop checkdescriptor::{prereq,inherit} X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7be495335b9ba23471f5a4d6539f58070758d57d;p=thirdparty%2Felfutils.git dwarflint: Drop checkdescriptor::{prereq,inherit} - ... which was just duplicating the lint.check<> calls in check initializers. It was needed for --list-checks to display all the checks. Now we register all the checks that we either want to show in the list or run, and mark them as hidden or unscheduled as needed. We lose the ability to list dependees in --list-checks, but I don't think that is too interesting anyway. --- diff --git a/dwarflint/Makefile.am b/dwarflint/Makefile.am index f485ef3ab..56e261152 100644 --- a/dwarflint/Makefile.am +++ b/dwarflint/Makefile.am @@ -41,7 +41,7 @@ noinst_PROGRAMS = tests/test-coverage tests/test-wrap tests/test-all-dies-it dwarflint_SOURCES = \ addr-record.cc addr-record.hh \ all-dies-it.hh \ - check_registrar.cc check_registrar.hh check_registrar_i.hh \ + check_registrar.hh check_registrar_i.hh \ checkdescriptor.cc checkdescriptor.hh checkdescriptor_i.hh \ checked_read.cc checked_read.hh \ checkrule.cc checkrule.hh \ diff --git a/dwarflint/check_debug_abbrev.cc b/dwarflint/check_debug_abbrev.cc index 7fb9015c4..3b5e3bab6 100644 --- a/dwarflint/check_debug_abbrev.cc +++ b/dwarflint/check_debug_abbrev.cc @@ -49,8 +49,7 @@ check_debug_abbrev::descriptor () static checkdescriptor cd (checkdescriptor::create ("check_debug_abbrev") .groups ("@low") - .prereq () - .prereq () + .schedule (false) .description ( "Checks for low-level structure of .debug_abbrev. In addition it " "checks:\n" @@ -79,6 +78,8 @@ check_debug_abbrev::descriptor () return &cd; } +static reg reg_debug_abbrev; + abbrev * abbrev_table::find_abbrev (uint64_t abbrev_code) const { diff --git a/dwarflint/check_debug_aranges.cc b/dwarflint/check_debug_aranges.cc index 0d3e3b309..b95597022 100644 --- a/dwarflint/check_debug_aranges.cc +++ b/dwarflint/check_debug_aranges.cc @@ -48,9 +48,6 @@ check_debug_aranges::descriptor () static checkdescriptor cd (checkdescriptor::create ("check_debug_aranges") .groups ("@low") - .prereq () - .prereq () - .prereq () .description ( "Checks for low-level structure of .debug_aranges. In addition it " "checks:\n" @@ -64,6 +61,8 @@ check_debug_aranges::descriptor () return &cd; } +static reg reg_debug_aranges; + static struct cu * cu_find_cu (struct cu *cu_chain, uint64_t offset) { diff --git a/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc index 1b23829a7..46d4ec512 100644 --- a/dwarflint/check_debug_info.cc +++ b/dwarflint/check_debug_info.cc @@ -50,7 +50,7 @@ read_cu_headers::descriptor () { static checkdescriptor cd (checkdescriptor::create ("read_cu_headers") - .prereq ()); + .hidden ()); return &cd; } @@ -64,11 +64,8 @@ check_debug_info::descriptor () static checkdescriptor cd (checkdescriptor::create ("check_debug_info") .groups ("@low") + .schedule (false) .option (dump_die_offsets) - .prereq () - .prereq () - .prereq () - .prereq () .description ( "Checks for low-level structure of .debug_info. In addition it " "checks:\n" @@ -102,6 +99,8 @@ check_debug_info::descriptor () return &cd; } +static reg reg_debug_info; + namespace { bool @@ -1251,8 +1250,7 @@ check_debug_info_refs::descriptor () static checkdescriptor cd (checkdescriptor::create ("check_debug_info_refs") .groups ("@low") - .prereq () - .prereq () + .schedule (false) .description ( "This pass checks:\n" " - for outstanding unresolved references from .debug_info to .debug_line\n" @@ -1261,6 +1259,8 @@ check_debug_info_refs::descriptor () return &cd; } +static reg reg_debug_info_refs; + check_debug_info_refs::check_debug_info_refs (checkstack &stack, dwarflint &lint) : _m_info (lint.check (stack, _m_info)) @@ -1292,5 +1292,3 @@ check_debug_info_refs::check_debug_info_refs (checkstack &stack, << "no aranges table is associated with this CU." << std::endl; } } - -static reg reg_debug_info_refs; diff --git a/dwarflint/check_debug_line.cc b/dwarflint/check_debug_line.cc index 4a21125c3..93637238e 100644 --- a/dwarflint/check_debug_line.cc +++ b/dwarflint/check_debug_line.cc @@ -43,7 +43,7 @@ check_debug_line::descriptor () static checkdescriptor cd (checkdescriptor::create ("check_debug_line") .groups ("@low") - .prereq () + .schedule (false) .description ( "Checks for low-level structure of .debug_line. In addition it\n" "checks:\n" @@ -74,6 +74,8 @@ check_debug_line::descriptor () return &cd; } +static reg reg_debug_line; + namespace { struct include_directory_t diff --git a/dwarflint/check_debug_loc_range.cc b/dwarflint/check_debug_loc_range.cc index f87b2aa47..74b4d272e 100644 --- a/dwarflint/check_debug_loc_range.cc +++ b/dwarflint/check_debug_loc_range.cc @@ -55,8 +55,7 @@ check_debug_ranges::descriptor () static checkdescriptor cd (checkdescriptor::create ("check_debug_ranges") .groups ("@low") - .prereq () - .prereq () + .schedule (false) .description ( "Checks for low-level structure of .debug_ranges. In addition it " "checks:\n" @@ -72,14 +71,15 @@ check_debug_ranges::descriptor () return &cd; } +static reg reg_debug_ranges; + checkdescriptor const * check_debug_loc::descriptor () { static checkdescriptor cd (checkdescriptor::create ("check_debug_loc") .groups ("@low") - .prereq () - .prereq () + .schedule (false) .description ( "Checks for low-level structure of .debug_loc. In addition it " "makes the same checks as .debug_ranges. For location expressions " @@ -95,6 +95,8 @@ check_debug_loc::descriptor () return &cd; } +static reg reg_debug_loc; + namespace { bool diff --git a/dwarflint/check_debug_pub.cc b/dwarflint/check_debug_pub.cc index 0f18e682f..c44cab4b0 100644 --- a/dwarflint/check_debug_pub.cc +++ b/dwarflint/check_debug_pub.cc @@ -1,5 +1,5 @@ /* Low-level checking of .debug_pub*. - Copyright (C) 2009, 2010 Red Hat, Inc. + Copyright (C) 2009, 2010, 2011 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -47,8 +47,7 @@ check_debug_pubnames::descriptor () static checkdescriptor cd (checkdescriptor::create ("check_debug_pubnames") .groups ("@low") - .prereq () - .prereq () + .schedule (false) .description ( "Checks for low-level structure of .debug_pubnames. In addition it " "checks:\n" @@ -60,25 +59,31 @@ check_debug_pubnames::descriptor () " - that there's only one pub section per CU\n")); return &cd; } + template check_debug_pub::check_debug_pub (checkstack &stack, dwarflint &lint); +static reg reg_debug_pubnames; + checkdescriptor const * check_debug_pubtypes::descriptor () { static checkdescriptor cd (checkdescriptor::create ("check_debug_pubtypes") .groups ("@low") - .prereq () - .prereq () + .schedule (false) .description ( "Checks for low-level structure of .debug_pubtypes. In addition it " "makes the same checks as check_debug_pubnames.\n")); return &cd; } + template check_debug_pub::check_debug_pub (checkstack &stack, dwarflint &lint); +static reg reg_debug_pubtypes; + + template bool check_debug_pub::check_pub_structural () diff --git a/dwarflint/check_die_tree.cc b/dwarflint/check_die_tree.cc index 14b2cf4e5..0e0b38d49 100644 --- a/dwarflint/check_die_tree.cc +++ b/dwarflint/check_die_tree.cc @@ -45,8 +45,6 @@ namespace return &inst; } }; - - reg reg; } void diff --git a/dwarflint/check_die_tree.hh b/dwarflint/check_die_tree.hh index 5d1c807d6..d4dabedc0 100644 --- a/dwarflint/check_die_tree.hh +++ b/dwarflint/check_die_tree.hh @@ -54,7 +54,6 @@ public: { static checkdescriptor cd (checkdescriptor::create ("check_die_tree") - .inherit > () .hidden () .description ("A pass over the DIE tree that dispatches to various per-DIE checks.\n")); return &cd; @@ -103,11 +102,7 @@ private: public: static checkdescriptor const *descriptor () { - static checkdescriptor cd - (checkdescriptor::create (*T::descriptor ()) - .prereq () - .inherit > ()); - return &cd; + return T::descriptor (); } check_stub (checkstack &stack, dwarflint &lint) diff --git a/dwarflint/check_duplicate_DW_tag_variable.cc b/dwarflint/check_duplicate_DW_tag_variable.cc index 822b3d8cd..838e3f693 100644 --- a/dwarflint/check_duplicate_DW_tag_variable.cc +++ b/dwarflint/check_duplicate_DW_tag_variable.cc @@ -54,7 +54,6 @@ namespace static checkdescriptor const *descriptor () { static checkdescriptor cd (checkdescriptor::create ("check_duplicate_DW_tag_variable") - .inherit > () .description ( "Implements a check for two full DW_TAG_variable DIEs with the same " "DW_AT_name value. This covers duplicate declaration, duplicate " diff --git a/dwarflint/check_dups_abstract_origin.cc b/dwarflint/check_dups_abstract_origin.cc index 03b1c820e..ece80a88d 100644 --- a/dwarflint/check_dups_abstract_origin.cc +++ b/dwarflint/check_dups_abstract_origin.cc @@ -45,7 +45,6 @@ namespace { static checkdescriptor cd (checkdescriptor::create ("check_dups_abstract_origin") - .inherit > () .description ( "If a given attribute name is present on a DIE, it is " "suspicious if that attribute name appears on the DIE that's the " diff --git a/dwarflint/check_expected_trees.cc b/dwarflint/check_expected_trees.cc index ab91a7125..a758c7c3f 100644 --- a/dwarflint/check_expected_trees.cc +++ b/dwarflint/check_expected_trees.cc @@ -46,7 +46,6 @@ namespace static checkdescriptor const *descriptor () { static checkdescriptor cd (checkdescriptor::create ("check_expected_trees") - .inherit > () .description ( "Checks whether all DIEs have the right attributes and the right children.\n" "Currently this is very much a work in progress.\n")); diff --git a/dwarflint/check_linkage_external_die.cc b/dwarflint/check_linkage_external_die.cc index 3731e106e..7af738ab7 100644 --- a/dwarflint/check_linkage_external_die.cc +++ b/dwarflint/check_linkage_external_die.cc @@ -39,10 +39,8 @@ namespace { static checkdescriptor cd (checkdescriptor::create ("check_linkage_external_die") - .inherit > () - .description ( -"Check that each DIE that has a linkage_name also has an external attribute.\n" - )); + .description ("Check that each DIE that has a linkage_name " + "also has an external attribute.\n")); return &cd; } diff --git a/dwarflint/check_matching_ranges.cc b/dwarflint/check_matching_ranges.cc index a567ce48f..6f2f4eb67 100644 --- a/dwarflint/check_matching_ranges.cc +++ b/dwarflint/check_matching_ranges.cc @@ -1,5 +1,5 @@ /* Pedantic checking of DWARF files - Copyright (C) 2009,2010 Red Hat, Inc. + Copyright (C) 2009,2010,2011 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -42,7 +42,6 @@ namespace static checkdescriptor const *descriptor () { static checkdescriptor cd (checkdescriptor::create ("check_matching_ranges") - .inherit > () .description ( "Check that the ranges in .debug_aranges and .debug_ranges match.\n" )); diff --git a/dwarflint/check_range_out_of_scope.cc b/dwarflint/check_range_out_of_scope.cc index 131fe187e..c0312917a 100644 --- a/dwarflint/check_range_out_of_scope.cc +++ b/dwarflint/check_range_out_of_scope.cc @@ -52,7 +52,6 @@ namespace static checkdescriptor const *descriptor () { static checkdescriptor cd (checkdescriptor::create ("check_range_out_of_scope") - .inherit > () .description ( "Check whether PC ranges reported at DIEs fall into the containing scope.\n")); return &cd; diff --git a/dwarflint/check_registrar.cc b/dwarflint/check_registrar.cc deleted file mode 100644 index 35198482f..000000000 --- a/dwarflint/check_registrar.cc +++ /dev/null @@ -1,101 +0,0 @@ -/* Pedantic checking of DWARF files - Copyright (C) 2011 Red Hat, Inc. - This file is part of Red Hat elfutils. - - Red Hat elfutils is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by the - Free Software Foundation; version 2 of the License. - - Red Hat elfutils is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with Red Hat elfutils; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. - - Red Hat elfutils is an included package of the Open Invention Network. - An included package of the Open Invention Network is a package for which - Open Invention Network licensees cross-license their patents. No patent - license is granted, either expressly or impliedly, by designation as an - included package. Should you wish to participate in the Open Invention - Network licensing program, please visit www.openinventionnetwork.com - . */ - -#include "check_registrar.hh" -#include "checkdescriptor.hh" -#include "dwarflint.hh" -#include "main.hh" -#include "wrap.hh" - -void -check_registrar_aux::add_deps (std::set &to, - checkdescriptor const *cd) -{ - for (std::set::const_iterator it - = cd->prereq ().begin (); it != cd->prereq ().end (); ++it) - include (to, *it); -} - -void -check_registrar_aux::include (std::set &to, - checkdescriptor const *cd) -{ - if (cd->hidden ()) - add_deps (to, cd); - else - to.insert (cd); -} - -bool -check_registrar_aux::be_verbose () -{ - // We can hopefully assume that the option doesn't change during - // execution, so we can simply cache it this was. - static bool be_verbose = opt_list_checks.value () == "full"; - return be_verbose; -} - -void -check_registrar_aux::list_one_check (checkdescriptor const &cd) -{ - const size_t columns = 70; - - if (be_verbose ()) - std::cout << "=== " << cd.name () << " ==="; - else - std::cout << cd.name (); - - checkgroups const &groups = cd.groups (); - if (!groups.empty ()) - { - if (be_verbose ()) - std::cout << std::endl << "groups: "; - else - std::cout << ' '; - std::cout << groups; - } - std::cout << std::endl; - - if (be_verbose ()) - { - prereqs const &prereq = cd.prereq (); - if (!prereq.empty ()) - std::cout << "prerequisites: " << prereq << std::endl; - - char const *desc = cd.description (); - if (desc != NULL) - std::cout << wrap_str (desc, columns).join (); - - options const &opts = cd.opts (); - if (!opts.empty ()) - { - std::cout << "recognized options:" << std::endl; - argp a = opts.build_argp (); - argp_help (&a, stdout, ARGP_HELP_LONG, NULL); - } - - std::cout << std::endl; - } -} diff --git a/dwarflint/check_registrar.hh b/dwarflint/check_registrar.hh index a95bf500f..2cf3085ce 100644 --- a/dwarflint/check_registrar.hh +++ b/dwarflint/check_registrar.hh @@ -36,11 +36,6 @@ namespace check_registrar_aux { bool be_verbose (); void list_one_check (checkdescriptor const &cd); - - void include (std::set &to, - checkdescriptor const *cd); - void add_deps (std::set &to, - checkdescriptor const *cd); } template @@ -60,10 +55,10 @@ public: checkdescriptors_t get_descriptors () const { - std::set descriptors; + checkdescriptors_t ret; for (typename _super_t::const_iterator it = begin (); it != end (); ++it) - check_registrar_aux::include (descriptors, (*it)->descriptor ()); - return checkdescriptors_t (descriptors.begin (), descriptors.end ()); + ret.push_back ((*it)->descriptor ()); + return ret; } }; diff --git a/dwarflint/check_self_referential_die.cc b/dwarflint/check_self_referential_die.cc index c25493481..e81560aa6 100644 --- a/dwarflint/check_self_referential_die.cc +++ b/dwarflint/check_self_referential_die.cc @@ -39,7 +39,6 @@ namespace { static checkdescriptor cd (checkdescriptor::create ("check_self_referential_die") - .inherit > () .description ( "A reference attribute referencing the DIE itself is suspicious.\n" "One example is a DW_AT_containing_type pointing to itself.\n" diff --git a/dwarflint/checkdescriptor.cc b/dwarflint/checkdescriptor.cc index a74d69c01..9fdde4a8b 100644 --- a/dwarflint/checkdescriptor.cc +++ b/dwarflint/checkdescriptor.cc @@ -24,6 +24,7 @@ . */ #include "checkdescriptor.hh" +#include "wrap.hh" #include #include @@ -42,32 +43,19 @@ operator << (std::ostream &o, checkgroups const &groups) return o; } -std::ostream & -operator << (std::ostream &o, prereqs const &p) -{ - o << "("; - for (prereqs::const_iterator it = p.begin (); it != p.end (); ++it) - { - if (it != p.begin ()) - o << ','; - o << (*it)->name (); - } - o << ")"; - return o; -} - checkdescriptor::create::create (char const *name) : _m_name (name) , _m_description (NULL) , _m_hidden (false) + , _m_schedule (true) {} checkdescriptor::create::create (checkdescriptor const &base) : _m_groups (base.groups ()) - , _m_prereq (base.prereq ()) , _m_name (base.name ()) , _m_description (base.description ()) , _m_hidden (base.hidden ()) + , _m_schedule (base.schedule ()) , _m_opts (base.opts ()) {} @@ -81,12 +69,21 @@ checkdescriptor::create::groups (char const *a_groups) return *this; } +checkdescriptor::checkdescriptor () + : _m_name (NULL) + , _m_description (NULL) + , _m_groups () + , _m_hidden (false) + , _m_schedule (true) + , _m_opts () +{} + checkdescriptor::checkdescriptor (create const &c) : _m_name (c._m_name) , _m_description (c._m_description) , _m_groups (c._m_groups) - , _m_prereq (c._m_prereq) , _m_hidden (c._m_hidden) + , _m_schedule (c._m_schedule) , _m_opts (c._m_opts) {} @@ -95,3 +92,42 @@ checkdescriptor::in_group (std::string const &group) const { return _m_groups.find (group) != _m_groups.end (); } + +void +checkdescriptor::list (bool verbose) const +{ + const size_t columns = 70; + + if (verbose) + std::cout << "=== " << name () << " ==="; + else + std::cout << name (); + + checkgroups const &g = groups (); + if (!g.empty ()) + { + if (verbose) + std::cout << std::endl << "groups: "; + else + std::cout << ' '; + std::cout << g; + } + std::cout << std::endl; + + if (verbose) + { + char const *desc = description (); + if (desc != NULL) + std::cout << wrap_str (desc, columns).join (); + + options const &o = opts (); + if (!o.empty ()) + { + std::cout << "recognized options:" << std::endl; + argp a = o.build_argp (); + argp_help (&a, stdout, ARGP_HELP_LONG, NULL); + } + + std::cout << std::endl; + } +} diff --git a/dwarflint/checkdescriptor.hh b/dwarflint/checkdescriptor.hh index 2127d5f54..2382cc27d 100644 --- a/dwarflint/checkdescriptor.hh +++ b/dwarflint/checkdescriptor.hh @@ -38,23 +38,16 @@ struct checkgroups {}; std::ostream &operator << (std::ostream &o, checkgroups const &groups); -struct checkdescriptor; - -struct prereqs - : public std::set -{}; -std::ostream &operator << (std::ostream &o, prereqs const &p); - struct checkdescriptor { class create { friend class checkdescriptor; checkgroups _m_groups; - prereqs _m_prereq; char const *const _m_name; char const *_m_description; bool _m_hidden; + bool _m_schedule; options _m_opts; public: @@ -68,10 +61,6 @@ struct checkdescriptor return *this; } - template create &prereq (); - - template create &inherit (); - create hidden () { _m_hidden = true; @@ -83,47 +72,37 @@ struct checkdescriptor _m_opts.add (&opt); return *this; } + + create schedule (bool whether) + { + _m_schedule = whether; + return *this; + } }; + checkdescriptor (); checkdescriptor (create const &c); char const *name () const { return _m_name; } char const *description () const { return _m_description; } - prereqs const &prereq () const { return _m_prereq; } checkgroups const &groups () const { return _m_groups; } bool in_group (std::string const &group) const; bool hidden () const { return _m_hidden; } + bool schedule () const { return _m_schedule; } options const &opts () const { return _m_opts; } + void list (bool verbose) const; + private: char const *const _m_name; char const *const _m_description; checkgroups const _m_groups; - prereqs const _m_prereq; - bool _m_hidden; + bool const _m_hidden; + bool const _m_schedule; options const _m_opts; }; -template -checkdescriptor::create & -checkdescriptor::create::prereq () -{ - _m_prereq.insert (T::descriptor ()); - return *this; -} - -template -checkdescriptor::create & -checkdescriptor::create::inherit () -{ - checkdescriptor const &cd = *T::descriptor (); - for (prereqs::const_iterator it = cd.prereq ().begin (); - it != cd.prereq ().end (); ++it) - _m_prereq.insert (*it); - return *this; -} - #endif//DWARFLINT_CHECKDESCRIPTOR_HH diff --git a/dwarflint/cu_coverage.cc b/dwarflint/cu_coverage.cc index f836040b1..c09ecabda 100644 --- a/dwarflint/cu_coverage.cc +++ b/dwarflint/cu_coverage.cc @@ -1,5 +1,5 @@ /* Pedantic checking of DWARF files - Copyright (C) 2010 Red Hat, Inc. + Copyright (C) 2010, 2011 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -33,8 +33,7 @@ cu_coverage::descriptor () { static checkdescriptor cd (checkdescriptor::create ("cu_coverage") - .prereq () - .prereq ()); + .hidden ()); return &cd; } diff --git a/dwarflint/dwarflint.cc b/dwarflint/dwarflint.cc index 86468d907..b0ea7db93 100644 --- a/dwarflint/dwarflint.cc +++ b/dwarflint/dwarflint.cc @@ -32,6 +32,7 @@ #include "checks.hh" #include "check_registrar.hh" #include "files.hh" +#include "main.hh" #include #include @@ -57,10 +58,11 @@ void main_check_registrar::run (dwarflint &lint) { for (const_iterator it = begin (); it != end (); ++it) - { - checkstack stack; - (*it)->run (stack, lint); - } + if ((*it)->descriptor ()->schedule ()) + { + checkstack stack; + (*it)->run (stack, lint); + } } dwarflint::dwarflint (char const *a_fname, checkrules const &a_rules) @@ -115,13 +117,23 @@ dwarflint::main_registrar () namespace { + bool + be_verbose () + { + // We can hopefully assume that the option doesn't change during + // execution, so we can simply cache it this was. + static bool be_verbose = opt_list_checks.value () == "full"; + return be_verbose; + } + template void list_part_checks (T const &descriptors) { for (typename T::const_iterator it = descriptors.begin (); it != descriptors.end (); ++it) - check_registrar_aux::list_one_check (**it); + if (!(*it)->hidden ()) + (*it)->list (be_verbose ()); } } @@ -130,7 +142,7 @@ dwarflint::list_checks () { list_part_checks (dwarflint::main_registrar ()->get_descriptors ()); - if (!check_registrar_aux::be_verbose ()) + if (!be_verbose ()) std::cout << "Use --list-checks=full to get more detailed description." << std::endl; diff --git a/dwarflint/highlevel_check.hh b/dwarflint/highlevel_check.hh index 26dfbd355..007756a41 100644 --- a/dwarflint/highlevel_check.hh +++ b/dwarflint/highlevel_check.hh @@ -73,9 +73,7 @@ class highlevel_check open_highlevel_dwarf *_m_loader; public: static checkdescriptor const *descriptor () { - static checkdescriptor cd - (checkdescriptor::create ("highlevel_check") - .prereq ()); + static checkdescriptor cd ("highlevel_check"); return &cd; } diff --git a/dwarflint/lowlevel_checks.cc b/dwarflint/lowlevel_checks.cc index 77e6bbbff..987c56dfb 100644 --- a/dwarflint/lowlevel_checks.cc +++ b/dwarflint/lowlevel_checks.cc @@ -1,5 +1,5 @@ /* Scheduler for low_level checks - Copyright (C) 2010 Red Hat, Inc. + Copyright (C) 2010, 2011 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -37,19 +37,10 @@ lowlevel_checks::descriptor () { static checkdescriptor cd (checkdescriptor::create ("lowlevel_checks") - .prereq () - .prereq () - .prereq () - .prereq () - .prereq () - .prereq () - .prereq () - .prereq () - .prereq () - .hidden () - ); + .hidden ()); return &cd; } + static reg reg_lowlevel_checks; namespace diff --git a/dwarflint/sections.cc b/dwarflint/sections.cc index f9a64b08a..6f9f25461 100644 --- a/dwarflint/sections.cc +++ b/dwarflint/sections.cc @@ -48,9 +48,7 @@ load_sections::descriptor () checkdescriptor const * section_base::descriptor () { - static checkdescriptor cd - (checkdescriptor::create () - .prereq ()); + static checkdescriptor cd; return &cd; } diff --git a/dwarflint/sections.hh b/dwarflint/sections.hh index 1d488fbc6..ba059d576 100644 --- a/dwarflint/sections.hh +++ b/dwarflint/sections.hh @@ -1,5 +1,5 @@ /* Low-level section handling. - Copyright (C) 2009, 2010 Red Hat, Inc. + Copyright (C) 2009, 2010, 2011 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -68,7 +68,6 @@ public: static checkdescriptor const *descriptor () { static checkdescriptor cd (checkdescriptor::create (section_name[sec_id]) - .inherit () .hidden ()); return &cd; }