diff options
author | Petr Machata <pmachata@redhat.com> | 2011-03-28 15:43:44 +0200 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2011-03-28 16:03:08 +0200 |
commit | 0c1f888bcaedeb4b4eed550294a93ea09d386b6f (patch) | |
tree | eeed6d5076940adaf09ff264631fe43805307a92 | |
parent | cb50be35ea31a28a98640b33e1629138749ffd83 (diff) | |
download | elfutils-0c1f888bcaedeb4b4eed550294a93ea09d386b6f.tar.gz |
dwarflint: Rewrite check_duplicate_DW_tag_variable as a per-DIE check
-rw-r--r-- | dwarflint/check_duplicate_DW_tag_variable.cc | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/dwarflint/check_duplicate_DW_tag_variable.cc b/dwarflint/check_duplicate_DW_tag_variable.cc index 80f96632..cd6f4abf 100644 --- a/dwarflint/check_duplicate_DW_tag_variable.cc +++ b/dwarflint/check_duplicate_DW_tag_variable.cc @@ -1,5 +1,5 @@ /* - 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 @@ -23,8 +23,7 @@ Network licensing program, please visit www.openinventionnetwork.com <http://www.openinventionnetwork.com>. */ -#include "highlevel_check.hh" -#include "all-dies-it.hh" +#include "check_die_tree.hh" #include "pri.hh" #include "messages.hh" #include <map> @@ -34,7 +33,7 @@ using elfutils::dwarf; namespace { class check_duplicate_DW_tag_variable - : public highlevel_check<check_duplicate_DW_tag_variable> + : public die_check { struct varinfo { @@ -65,18 +64,10 @@ namespace return &cd; } - check_duplicate_DW_tag_variable (checkstack &stack, dwarflint &lint); - }; - - reg<check_duplicate_DW_tag_variable> reg_duplicate_DW_tag_variable; -} + check_duplicate_DW_tag_variable (checkstack &, dwarflint &) {} -check_duplicate_DW_tag_variable -::check_duplicate_DW_tag_variable (checkstack &stack, dwarflint &lint) - : highlevel_check<check_duplicate_DW_tag_variable> (stack, lint) -{ - for (all_dies_iterator<dwarf> it = all_dies_iterator<dwarf> (dw); - it != all_dies_iterator<dwarf> (); ++it) + virtual void + die (all_dies_iterator<dwarf> const &it) { dwarf::debug_info_entry::children_type const &children = it->children (); @@ -91,7 +82,7 @@ check_duplicate_DW_tag_variable { dwarf::debug_info_entry::attributes_type const & attrs = jt->attributes (); - dwarf::debug_info_entry::attributes_type::const_iterator + dwarf::debug_info_entry::attributes_type::const_iterator at, et = attrs.end (); if ((at = attrs.find (DW_AT_name)) == et) continue; @@ -136,4 +127,6 @@ check_duplicate_DW_tag_variable } } } + }; + reg_die_check<check_duplicate_DW_tag_variable> reg; } |